diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-15 14:04:53 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-15 14:04:53 +0400 |
commit | b611b5ac75f79ab459b5e584766a6e88c12b8828 (patch) | |
tree | 919e2117826a99b4056b3776a7326fb3f9a18311 /plugins/UserSettings | |
parent | e74c02b0d038aac627fdd5a8e64c7f8fb10ee123 (diff) |
Diffstat (limited to 'plugins/UserSettings')
-rw-r--r-- | plugins/UserSettings/API.php | 1 | ||||
-rw-r--r-- | plugins/UserSettings/UserSettings.php | 13 | ||||
-rw-r--r-- | plugins/UserSettings/functions.php | 8 |
3 files changed, 17 insertions, 5 deletions
diff --git a/plugins/UserSettings/API.php b/plugins/UserSettings/API.php index 09f146fe1f..aab8f3416a 100644 --- a/plugins/UserSettings/API.php +++ b/plugins/UserSettings/API.php @@ -39,6 +39,7 @@ class Piwik_UserSettings_API $dataTable = $archive->getDataTable($name); $dataTable->filter('Sort', array(Piwik_Archive::INDEX_NB_VISITS)); $dataTable->queueFilter('ReplaceColumnNames'); + $dataTable->queueFilter('ReplaceSummaryRowLabel'); return $dataTable; } diff --git a/plugins/UserSettings/UserSettings.php b/plugins/UserSettings/UserSettings.php index dc1db413b5..bb0c10dddf 100644 --- a/plugins/UserSettings/UserSettings.php +++ b/plugins/UserSettings/UserSettings.php @@ -66,6 +66,8 @@ class Piwik_UserSettings extends Piwik_Plugin function archiveDay( $notification ) { require_once PIWIK_INCLUDE_PATH . '/plugins/UserSettings/functions.php'; + $maximumRowsInDataTable = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_standard; + $columnToSortByBeforeTruncation = Piwik_Archive::INDEX_NB_VISITS; $archiveProcessing = $notification->getNotificationObject(); $this->archiveProcessing = $archiveProcessing; @@ -74,21 +76,21 @@ class Piwik_UserSettings extends Piwik_Plugin $labelSQL = "CONCAT(config_os, ';', config_browser_name, ';', config_resolution)"; $interestByConfiguration = $archiveProcessing->getArrayInterestForLabel($labelSQL); $tableConfiguration = $archiveProcessing->getDataTableFromArray($interestByConfiguration); - $archiveProcessing->insertBlobRecord($recordName, $tableConfiguration->getSerialized()); + $archiveProcessing->insertBlobRecord($recordName, $tableConfiguration->getSerialized($maximumRowsInDataTable, null, $columnToSortByBeforeTruncation)); destroy($tableConfiguration); $recordName = 'UserSettings_os'; $labelSQL = "config_os"; $interestByOs = $archiveProcessing->getArrayInterestForLabel($labelSQL); $tableOs = $archiveProcessing->getDataTableFromArray($interestByOs); - $archiveProcessing->insertBlobRecord($recordName, $tableOs->getSerialized()); + $archiveProcessing->insertBlobRecord($recordName, $tableOs->getSerialized($maximumRowsInDataTable, null, $columnToSortByBeforeTruncation)); destroy($tableOs); $recordName = 'UserSettings_browser'; $labelSQL = "CONCAT(config_browser_name, ';', config_browser_version)"; $interestByBrowser = $archiveProcessing->getArrayInterestForLabel($labelSQL); $tableBrowser = $archiveProcessing->getDataTableFromArray($interestByBrowser); - $archiveProcessing->insertBlobRecord($recordName, $tableBrowser->getSerialized()); + $archiveProcessing->insertBlobRecord($recordName, $tableBrowser->getSerialized($maximumRowsInDataTable, null, $columnToSortByBeforeTruncation)); $recordName = 'UserSettings_browserType'; $tableBrowserType = $this->getTableBrowserByType($tableBrowser); @@ -101,7 +103,7 @@ class Piwik_UserSettings extends Piwik_Plugin $interestByResolution = $archiveProcessing->getArrayInterestForLabel($labelSQL); $tableResolution = $archiveProcessing->getDataTableFromArray($interestByResolution); $tableResolution->filter('ColumnCallbackDeleteRow', array('label', 'Piwik_UserSettings_keepStrlenGreater')); - $archiveProcessing->insertBlobRecord($recordName, $tableResolution->getSerialized()); + $archiveProcessing->insertBlobRecord($recordName, $tableResolution->getSerialized($maximumRowsInDataTable, null, $columnToSortByBeforeTruncation)); $recordName = 'UserSettings_wideScreen'; $tableWideScreen = $this->getTableWideScreen($tableResolution); @@ -118,6 +120,7 @@ class Piwik_UserSettings extends Piwik_Plugin function archivePeriod( $notification ) { $archiveProcessing = $notification->getNotificationObject(); + $maximumRowsInDataTable = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_standard; $dataTableToSum = array( 'UserSettings_configuration', @@ -129,7 +132,7 @@ class Piwik_UserSettings extends Piwik_Plugin 'UserSettings_plugin', ); - $archiveProcessing->archiveDataTable($dataTableToSum); + $archiveProcessing->archiveDataTable($dataTableToSum, null, $maximumRowsInDataTable); } protected function getTableWideScreen($tableResolution) diff --git a/plugins/UserSettings/functions.php b/plugins/UserSettings/functions.php index e16ed60867..c2aebe7b64 100644 --- a/plugins/UserSettings/functions.php +++ b/plugins/UserSettings/functions.php @@ -126,11 +126,19 @@ function Piwik_getBrowserVersion($str) function Piwik_getBrowsersLogo($label) { $id = Piwik_getBrowserId($label); + // For aggregated row 'Others' + if(empty($id)) { + $id = 'UNK'; + } return 'plugins/UserSettings/images/browsers/'. $id . '.gif'; } function Piwik_getOSLogo($label) { + // For aggregated row 'Others' + if(empty($label)) { + $label = 'UNK'; + } $path = 'plugins/UserSettings/images/os/'. $label . '.gif'; return $path; } |