From 09c13e4c494c7a9630679748524d94ffd2ce325c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 6 Oct 2008 23:20:03 +0000 Subject: [PATCH] Resets debugable --- inc/config.php | 12 ++++++++++++ inc/databases.php | 2 +- inc/functions.php | 7 +++++-- inc/reset/reset_daily.php | 6 ------ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/inc/config.php b/inc/config.php index 897b03aa86..644925084c 100644 --- a/inc/config.php +++ b/inc/config.php @@ -110,6 +110,18 @@ define('frameset_active', false); // CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!) define('DEBUG_MODE', false); +// CFG: DEBUG-MAIL (turn this on if you need to debug mails, only affects if DEBUG_MODE is true) +//define('DEBUG_MAIL', true); + +// CFG: DEBUG-RESET (comment in to test daily reset, comment out to not test) +//define('DEBUG_RESET', true); + +// CFG: DEBUG-MONTHLY (comment in to test monthly reset, comment out to not test) +//define('DEBUG_MONTHLY', true); + +// CFG: DEBUG-WEEKLY (comment in to test weekly reset, comment out to not test) +//define('DEBUG_WEEKLY', true); + // When we are not installing if (!defined('mxchange_installing')) define('mxchange_installing', false); diff --git a/inc/databases.php b/inc/databases.php index 64fd579e14..1ec95e0dfc 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "467"); +define('CURR_SVN_REVISION', "468"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/functions.php b/inc/functions.php index b9369d3ebc..28ecf9e432 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2390,6 +2390,9 @@ function RESET_ADD_INCLUDES () { // Get more daily reset scripts $INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/reset/", "reset_"); + // Update database + if (!defined('DEBUG_RESET')) UPDATE_CONFIG("last_update", time()); + // Create current week mark $currWeek = date("W", time()); @@ -2399,7 +2402,7 @@ function RESET_ADD_INCLUDES () { $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_")); // Update config - UPDATE_CONFIG("last_week", $currWeek); + if (!defined('DEBUG_WEEKLY')) UPDATE_CONFIG("last_week", $currWeek); } // END - if // Create current month mark @@ -2411,7 +2414,7 @@ function RESET_ADD_INCLUDES () { $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_")); // Update config - UPDATE_CONFIG("last_month", $currMonth); + if (!defined('DEBUG_MONTHLY')) UPDATE_CONFIG("last_month", $currMonth); } // END - if // Return array diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php index d0ee83a5a2..59df1fb8ce 100644 --- a/inc/reset/reset_daily.php +++ b/inc/reset/reset_daily.php @@ -89,11 +89,5 @@ WHERE userid=%s AND ref_depth=%d LIMIT 1", // Free memory SQL_FREERESULT($result_daily); -// Save config value for later references -$_CONFIG['last_update'] = time(); - -// Update database -UPDATE_CONFIG("last_update", time()); - // ?> -- 2.39.5