Permalink
Browse files

Coding style, Refs #1120

  • Loading branch information...
1 parent 8324340 commit 208988c3aeae639e0d05776e5357b26d47a830d5 peterb committed Jul 29, 2010
Showing with 9 additions and 10 deletions.
  1. +1 −2 lang/en.php
  2. +8 −8 plugins/Live/API.php
View
@@ -576,6 +576,7 @@
'Installation_ConfigurationHelp' => 'Your Piwik configuration file appears to be misconfigured. You can either remove config/config.ini.php and resume installation, or correct the database connection settings.',
'Installation_ErrorInvalidState' => 'Error: it seems you tried to skip a step of the Installation process, or your cookies are disabled, or the Piwik configuration file was already created. %1$sMake sure your cookies are enabled%2$s and go back %3$s to the first page of the installation %4$s.',
'LanguagesManager_PluginDescription' => 'This plugin will display a list of the available languages for the Piwik interface. The language selected will be saved in the preferences for each user.',
+ 'LanguagesManager_AboutPiwikTranslations' => 'About Piwik translations',
'Live_PluginDescription' => 'Spy on your visitors, live, in real-time!',
'Live_LinkVisitorLog' => 'View detailed visitor log',
'Live_Actions' => 'Actions',
@@ -585,8 +586,6 @@
'Live_Time' => 'Time',
'Live_Referrer_URL' => 'Referrer URL',
'Live_Last30Minutes' => 'Last 30 minutes',
- 'Live_Referrer_URL' => 'Referrer URL',
- 'Live_Last30Minutes' => 'Last 30 minutes',
'Login_PluginDescription' => 'Login Authentication plugin, reading the credentials from the config/config.inc.php file for the Super User, and from the Database for the other users. Can be easily replaced to introduce a new Authentication mechanism (OpenID, htaccess, custom Auth, etc.).',
'Login_LoginPasswordNotCorrect' => 'Username & Password not correct',
'Login_Password' => 'Password',
View
@@ -51,7 +51,7 @@ public function getLastVisitForVisitor( $visitorId, $idSite )
public function getLastVisitsForVisitor( $visitorId, $idSite, $limit = 10 )
{
Piwik::checkUserHasViewAccess($idSite);
- $visitorDetails = $this->loadLastVisitorDetailsFromDatabase($idSite, $period = null, $date = null, $limit, $offset = null, $minIdVisit = null, $visitorId);
+ $visitorDetails = $this->loadLastVisitorDetailsFromDatabase($idSite, $period = false, $date = false, $limit, $offset = false, $minIdVisit = false, $visitorId);
$table = $this->getCleanedVisitorsFromDetails($visitorDetails, $idSite);
return $table;
}
@@ -62,15 +62,15 @@ public function getLastVisitsForVisitor( $visitorId, $idSite, $limit = 10 )
public function getLastVisits( $idSite, $limit = 10, $minIdVisit = false )
{
Piwik::checkUserHasViewAccess($idSite);
- $visitorDetails = $this->loadLastVisitorDetailsFromDatabase($idSite, $period = null, $date = null, $limit, $offset = null, $minIdVisit, $visitorId = null);
+ $visitorDetails = $this->loadLastVisitorDetailsFromDatabase($idSite, $period = false, $date = false, $limit, $offset = false, $minIdVisit, $visitorId = false);
$table = $this->getCleanedVisitorsFromDetails($visitorDetails, $idSite);
return $table;
}
/*
* @return Piwik_DataTable
*/
- public function getLastVisitsDetails( $idSite, $period = null, $date = null, $limit = 25, $filter_offset = 0, $minIdVisit = false )
+ public function getLastVisitsDetails( $idSite, $period = false, $date = false, $limit = 25, $filter_offset = 0, $minIdVisit = false )
{
Piwik::checkUserHasViewAccess($idSite);
$visitorDetails = $this->loadLastVisitorDetailsFromDatabase($idSite, $period, $date, $limit, $filter_offset, $minIdVisit);
@@ -169,7 +169,7 @@ private function getCleanedVisitorsFromDetails($visitorDetails, $idSite)
/*
* @return array
*/
- private function loadLastVisitorDetailsFromDatabase($idSite, $period = null, $date = null, $limit = null, $offset = null, $minIdVisit = false, $visitorId = null)
+ private function loadLastVisitorDetailsFromDatabase($idSite, $period = false, $date = false, $limit = false, $offset = false, $minIdVisit = false, $visitorId = false)
{
$where = $whereBind = array();
@@ -189,8 +189,8 @@ private function loadLastVisitorDetailsFromDatabase($idSite, $period = null, $da
}
//increse limit by offset when visitor paginates
- if(isset($offset)) {
- $limit += $offset;
+ if(!empty($offset)) {
+ $limit += (int)$offset;
}
// SQL Filter with provided period
@@ -224,7 +224,7 @@ private function loadLastVisitorDetailsFromDatabase($idSite, $period = null, $da
AND " . Piwik_Common::prefixTable('goal') . ".deleted = 0
$sqlWhere
ORDER BY idvisit DESC
- LIMIT $limit";
+ LIMIT ".(int)$limit;
return Piwik_FetchAll($sql, $whereBind);
}
@@ -276,7 +276,7 @@ private function loadLastVisitorInLastXTimeFromDatabase($idSite, $minutes = 0, $
$sql = "SELECT " . Piwik_Common::prefixTable('log_visit') . ".idvisit
FROM " . Piwik_Common::prefixTable('log_visit') . "
$sqlWhere
- ORDER BY idsite,idvisit DESC";
+ ORDER BY idvisit DESC";
}
// Pages
elseif($type == self::TYPE_FETCH_PAGEVIEWS)

0 comments on commit 208988c

Please sign in to comment.