// Init stats system
function initStatsSystem () {
// Is stats cache loaded?
- if ((!isset($GLOBALS['stats_loaded'])) && (getConfig('STATS_ENABLED') == 'Y')) {
+ if ((!isset($GLOBALS['stats_loaded'])) && (ifStatsAreEnabled())) {
// Init statistics array
$GLOBALS['stats'] = array();
// Increments a statistics entry
function incrementStatsEntry ($entry, $amount=1) {
// Do we have stats enabled?
- if (getConfig('STATS_ENABLED') != 'Y') return;
+ if (!ifStatsAreEnabled()) return;
// Is it there?
if (isStatsEntrySet($entry)) {
} // END - if
// Load it from database
- $result = SQL_QUERY_ESC("SELECT `stats_entry`,`stats_value` FROM `{?_MYSQL_PREFIX?}_stats_%s` ORDER BY `stats_entry` ASC",
- array(generateDateTime(time(), '6')), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `stats_entry`, `stats_value` FROM `{?_MYSQL_PREFIX?}_stats_%s` ORDER BY `stats_entry` ASC",
+ array(
+ generateDateTime(time(), '6')
+ ), __FUNCTION__, __LINE__);
// Read all rows
while ($row = SQL_FETCHARRAY($result)) {
// Filter for flushing statistics
function FILTER_FLUSH_STATS () {
// Now do we have stats?
- if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (getConfig('STATS_ENABLED') == 'Y')) {
+ if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (ifStatsAreEnabled())) {
// Write statistics to temporary table
writeStatsTable();
} // END - if