Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
matt committed Jun 15, 2010
1 parent e74c02b commit b611b5a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions config/global.ini.php
Expand Up @@ -135,8 +135,8 @@
; maximum number of rows for pages in categories (sub pages, when clicking on the + for a page category)
datatable_archiving_maximum_rows_subtable_actions = 100

; maximum number of rows for the provider table
datatable_archiving_maximum_rows_providers = 500
; maximum number of rows for other tables (Providers, User settings configurations)
datatable_archiving_maximum_rows_standard = 500

; by default, Piwik uses self-hosted AJAX libraries.
; If set to 1, Piwik uses a Content Distribution Network
Expand Down
8 changes: 4 additions & 4 deletions plugins/Provider/Provider.php
Expand Up @@ -85,10 +85,10 @@ function postLoad()

function archivePeriod( $notification )
{
$maximumRowsInDataTableLevelZero = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_providers;
$maximumRowsInDataTable = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_standard;
$archiveProcessing = $notification->getNotificationObject();
$dataTableToSum = array( 'Provider_hostnameExt' );
$archiveProcessing->archiveDataTable($dataTableToSum, null, $maximumRowsInDataTableLevelZero);
$archiveProcessing->archiveDataTable($dataTableToSum, null, $maximumRowsInDataTable);
}

/**
Expand All @@ -103,8 +103,8 @@ function archiveDay($notification)
$interestByProvider = $archiveProcessing->getArrayInterestForLabel($labelSQL);
$tableProvider = $archiveProcessing->getDataTableFromArray($interestByProvider);
$columnToSortByBeforeTruncation = Piwik_Archive::INDEX_NB_VISITS;
$maximumRowsInDataTableLevelZero = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_providers;
$archiveProcessing->insertBlobRecord($recordName, $tableProvider->getSerialized($maximumRowsInDataTableLevelZero, null, $columnToSortByBeforeTruncation));
$maximumRowsInDataTable = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_standard;
$archiveProcessing->insertBlobRecord($recordName, $tableProvider->getSerialized($maximumRowsInDataTable, null, $columnToSortByBeforeTruncation));
destroy($tableProvider);
}

Expand Down
1 change: 1 addition & 0 deletions plugins/UserSettings/API.php
Expand Up @@ -39,6 +39,7 @@ protected function getDataTable($name, $idSite, $period, $date)
$dataTable = $archive->getDataTable($name);
$dataTable->filter('Sort', array(Piwik_Archive::INDEX_NB_VISITS));
$dataTable->queueFilter('ReplaceColumnNames');
$dataTable->queueFilter('ReplaceSummaryRowLabel');
return $dataTable;
}

Expand Down
13 changes: 8 additions & 5 deletions plugins/UserSettings/UserSettings.php
Expand Up @@ -66,6 +66,8 @@ function addMenu()
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;
Expand All @@ -74,21 +76,21 @@ function archiveDay( $notification )
$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);
Expand All @@ -101,7 +103,7 @@ function archiveDay( $notification )
$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);
Expand All @@ -118,6 +120,7 @@ function archiveDay( $notification )
function archivePeriod( $notification )
{
$archiveProcessing = $notification->getNotificationObject();
$maximumRowsInDataTable = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_standard;

$dataTableToSum = array(
'UserSettings_configuration',
Expand All @@ -129,7 +132,7 @@ function archivePeriod( $notification )
'UserSettings_plugin',
);

$archiveProcessing->archiveDataTable($dataTableToSum);
$archiveProcessing->archiveDataTable($dataTableToSum, null, $maximumRowsInDataTable);
}

protected function getTableWideScreen($tableResolution)
Expand Down
8 changes: 8 additions & 0 deletions plugins/UserSettings/functions.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit b611b5a

Please sign in to comment.