Reset scripts rewritten in header
authorRoland Häder <roland@mxchange.org>
Mon, 6 Oct 2008 16:03:38 +0000 (16:03 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 6 Oct 2008 16:03:38 +0000 (16:03 +0000)
18 files changed:
inc/databases.php
inc/mails/_mails.php
inc/mails/beg_mails.php
inc/mails/birthday_mails.php
inc/mails/bonus_mails.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/monthly/monthly_newsletter.php
inc/monthly/monthly_surfbar.php
inc/reset/reset_
inc/reset/reset_beg.php
inc/reset/reset_bonus.php
inc/reset/reset_daily.php
inc/reset/reset_engine.php
inc/reset/reset_holiday.php
inc/reset/reset_surfbar.php
inc/weekly/weekly_
inc/weekly/weekly_surfbar.php

index 81b7b59e3d8497add534d1f8cd68011ec2e5f69c..a9558a3c8e36c55b462e106e53b05f3a10bfe7c1 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "456");
+define('CURR_SVN_REVISION', "457");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 2032d04786bc54bca4b6a4d1c5956125a193873d..a208c5376f65abb0465f41a894f08c97409a1a0b 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "");
+} elseif (!EXT_IS_ACTIVE("")) {
        return;
 }
 
 // Do not execute when script is in CSS mode
        return;
 }
 
 // Do not execute when script is in CSS mode
-if ($CSS == 1) return;
+global $CSS;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 //
 ?>
 
 //
 ?>
index 824313d9bcbee1df05a9dfc66e5156fd7e172360..3247190093cd75d992717ee33ec1c86050b4b916 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+} elseif (!EXT_IS_ACTIVE("beg")) {
        return;
 }
 
 // Do not execute when script is in CSS mode
 global $CSS;
        return;
 }
 
 // Do not execute when script is in CSS mode
 global $CSS;
-if ($CSS == 1) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
index ab74796524e13786cb535c224ed9b714d1f24379..83d8eb4ea8ca70020ef59b7d71d07ac53fd5f4df 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("birthday")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "birthday");
+} elseif (!EXT_IS_ACTIVE("birthday")) {
        return;
 }
 
 // Do not execute when script is in CSS mode
 global $CSS;
        return;
 }
 
 // Do not execute when script is in CSS mode
 global $CSS;
-if ($CSS == 1) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Get current day (01 to 31), month (01 to 12) and year (4-digits year)
 $DAY   = date("d", time());
 
 // Get current day (01 to 31), month (01 to 12) and year (4-digits year)
 $DAY   = date("d", time());
index a66f714ed3788c19fb2d09f92116952d23891e67..50726857f9c473296c3df3e462286b394f0b4c77 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+} elseif (!EXT_IS_ACTIVE("bonus")) {
        return;
 }
 
 // Do not execute when script is in CSS mode
 global $CSS;
        return;
 }
 
 // Do not execute when script is in CSS mode
 global $CSS;
-if ($CSS == 1) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET')))  return;
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
index cc69c583b44a218b2999033d24eea9bb126c7b13..3680e6d904b08924135602698d226da6412499f3 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+} elseif (!EXT_IS_ACTIVE("beg")) {
        return;
 }
 
        return;
 }
 
index c67f734f2113641afebc4fa4793976ece404f572..a7c002584bd1d0921c9f2bd34cf7898766043fd8 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+} elseif (!EXT_IS_ACTIVE("bonus")) {
        return;
 }
 
        return;
 }
 
index 3e1ab6618ee18977e1c1563bea03c5117ddab1c8..776c99bd7f316d66181e95ffdcc1c3a813306864 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("newsletter")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "newsletter");
+} elseif (!EXT_IS_ACTIVE("newsletter")) {
        return;
 }
 
        return;
 }
 
index 4b23ca9f79a86da2978d16de26c7d438d3d28280..35de46718f5b33598e28467369bf898c3fd53cf9 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Reset surfbar counter
 UPDATE_CONFIG("surfbar_monthly_counter", "0");
 
 // Reset surfbar counter
 UPDATE_CONFIG("surfbar_monthly_counter", "0");
index fa3bff08003d248b74097f807947fe39713b90d5..f9a56e2bf32a59f5c38b167298a04f15e0a23b15 100644 (file)
@@ -36,12 +36,11 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 } elseif (!EXT_IS_ACTIVE("")) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 } elseif (!EXT_IS_ACTIVE("")) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 //
 ?>
 
 //
 ?>
index ddad449cc0dcdcd4449a512738603e9e657eb763..66be41d6645d786a9e4963129773342ad446c3cd 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+} elseif (!EXT_IS_ACTIVE("beg")) {
        return;
 }
 
        return;
 }
 
index d0a57bf66bd104e9f5093b8a67027bdd0ee5c250..60e8003002e98c98ad61e1d9435b5820784c514e 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+} elseif (!EXT_IS_ACTIVE("bonus")) {
        return;
 }
 
        return;
 }
 
index 9ae3f045b139dff97dfcb5912770ac1d299a3a1f..d0ee83a5a2894f0f0f0487bf190e6cf5b3ec9a00 100644 (file)
@@ -35,6 +35,8 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
+} elseif (!EXT_IS_ACTIVE("sql_patches")) {
+       return;
 }
 
 // Update user profiles
 }
 
 // Update user profiles
@@ -65,7 +67,7 @@ WHERE userid=%s AND locked_points != 0.00000 ORDER BY ref_depth",
                        // Ok transfer points
                        while (list($dep, $locked) = SQL_FETCHROW($result_points))
                        {
                        // Ok transfer points
                        while (list($dep, $locked) = SQL_FETCHROW($result_points))
                        {
-                       //* DEBUG: */ echo basename(__FILE__).":uid={$uid},depth={$dep},locked={$locked}<br />\n";
+                               //* DEBUG: */ echo basename(__FILE__).":uid={$uid},depth={$dep},locked={$locked}<br />\n";
                                $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s, locked_points=0.00000
 WHERE userid=%s AND ref_depth=%d LIMIT 1",
                                 array($locked, bigintval($uid), $dep), __FILE__, __LINE__);
                                $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s, locked_points=0.00000
 WHERE userid=%s AND ref_depth=%d LIMIT 1",
                                 array($locked, bigintval($uid), $dep), __FILE__, __LINE__);
index 9688395dace4620298c600817497dfebf4516aab..9643621a016444edf57f03caba4187ace7560367 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("engine")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "engine");
+} elseif (!EXT_IS_ACTIVE("engine")) {
        return;
 }
 
        return;
 }
 
index b323667ddd8ffff2d5afbcac2e230f65f0779fb3..8545a247a097dcc4c2b92dbe473593459c108113 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "holiday");
+} elseif (!EXT_IS_ACTIVE("holiday")) {
        return;
 }
 
        return;
 }
 
index 9c9f0a1e216f81e259d2cf721c7e8feb7bc6d8c8..5398a779e80ebd855428efec32b04b5a55e076d1 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Reset surfbar counter
 UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter`"), array(0, $_CONFIG['surfbar_daily_counter']));
 
 // Reset surfbar counter
 UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter`"), array(0, $_CONFIG['surfbar_daily_counter']));
index 8e3bc85796e00d2dbafabb8a29a7309e628f33b0..aeed2d5a78663f0ba21bcfb09f65014105c371d3 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+} elseif (!EXT_IS_ACTIVE("")) {
        return;
 }
 
        return;
 }
 
index 2a9a0be3a210fb1c433acf7fc74b6381457b470e..b2a160abb49f4b7bae2632fefd132b652330756d 100644 (file)
@@ -35,8 +35,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
        return;
 }
 
        return;
 }