From 700bc24c3ab00d51273e93cdc816e177bac34aa5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 8 Sep 2008 19:19:42 +0000 Subject: [PATCH] Counter for yester hits in surfbar added --- inc/extensions/ext-surfbar.php | 1 + inc/reset/reset_surfbar.php | 3 ++- surfbar.php | 15 ++++++++------- templates/de/html/surfbar/surfbar_frame_stats.tpl | 1 + 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 739272cfe8..f77381e276 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -129,6 +129,7 @@ INDEX (`userid`,`url_id`) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_yester_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30"; diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index 4fc2f6b741..3b83306d32 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -44,7 +44,8 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { if (($CSS == 1) || (defined('__DAILY_RESET'))) return; // Reset surfbar counter -UPDATE_CONFIG("surfbar_daily_counter", "0"); +UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter`"), array(0, $_CONFIG['surfbar_daily_counter'])); +$_CONFIG['surfbar_yester_counter'] = $_CONFIG['surfbar_daily_counter']; $_CONFIG['surfbar_daily_counter'] = 0; // diff --git a/surfbar.php b/surfbar.php index 8202188438..690443a957 100644 --- a/surfbar.php +++ b/surfbar.php @@ -83,13 +83,14 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install // Prepare content $content = array( - 'points' => TRANSLATE_COMMA($points), - 'online' => SURFBAR_DETERMINE_TOTAL_ONLINE(), - 'reload' => ($_CONFIG['surfbar_stats_reload'] * 1000), - 'c_total' => TRANSLATE_COMMA($_CONFIG['surfbar_total_counter']), - 'c_today' => TRANSLATE_COMMA($_CONFIG['surfbar_daily_counter']), - 'c_week' => TRANSLATE_COMMA($_CONFIG['surfbar_weekly_counter']), - 'c_month' => TRANSLATE_COMMA($_CONFIG['surfbar_monthly_counter']), + 'points' => TRANSLATE_COMMA($points), + 'online' => SURFBAR_DETERMINE_TOTAL_ONLINE(), + 'reload' => ($_CONFIG['surfbar_stats_reload'] * 1000), + 'c_total' => TRANSLATE_COMMA($_CONFIG['surfbar_total_counter']), + 'c_today' => TRANSLATE_COMMA($_CONFIG['surfbar_yester_counter']), + 'c_yester' => TRANSLATE_COMMA($_CONFIG['surfbar_daily_counter']), + 'c_week' => TRANSLATE_COMMA($_CONFIG['surfbar_weekly_counter']), + 'c_month' => TRANSLATE_COMMA($_CONFIG['surfbar_monthly_counter']), ); // Load template for "stats" page diff --git a/templates/de/html/surfbar/surfbar_frame_stats.tpl b/templates/de/html/surfbar/surfbar_frame_stats.tpl index 0e0ca5a329..ca2ee0f627 100644 --- a/templates/de/html/surfbar/surfbar_frame_stats.tpl +++ b/templates/de/html/surfbar/surfbar_frame_stats.tpl @@ -4,6 +4,7 @@ »Guthaben: $content[points] {!POINTS!}« - »Jetzt Online: $content[online]« - »Seitenaufrufe: Heute:$content[c_today] - + Gestern:$content[c_yester] - Woche:$content[c_week] - Monat:$content[c_month] - Gesamt:$content[c_total]« -- 2.39.5