Further fixes for all resets
authorRoland Häder <roland@mxchange.org>
Fri, 1 Feb 2013 23:39:22 +0000 (23:39 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 1 Feb 2013 23:39:22 +0000 (23:39 +0000)
inc/filters.php
inc/functions.php
inc/monthly/monthly_bonus.php
templates/de/emails/admin/admin_purge_task_row.tpl

index 7815b2f3dc83f77ae78cd25fb7d1e1eaf8aa96da..9e135b3e4788cc0fc180dd7f9f25227fd356831e 100644 (file)
@@ -581,23 +581,21 @@ function FILTER_UPDATE_EXTENSION_DATA ($ext_name) {
 // Load more hourly reset scripts
 function FILTER_RUN_HOURLY_INCLUDES () {
        // Is the reset set or old sql_patches?
-       if (((!isHourlyResetEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.7.5'))) && (isHtmlOutputMode())) {
+       if (((!isHourlyResetEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.8'))) && (isHtmlOutputMode())) {
                // Then abort here
-               reportBug(__FUNCTION__, __LINE__, 'Cannot run hourly reset! enabled='.intval(isHourlyResetEnabled()).',ext='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
+               reportBug(__FUNCTION__, __LINE__, 'Cannot run hourly reset! enabled='.intval(isHourlyResetEnabled()).',isExtensionInstalledAndNewer='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
        } // END - if
 
-       // Is the config entry set?
-       if (isExtensionInstalledAndNewer('sql_patches', '0.7.5')) {
-               // Get more hourly reset scripts
-               setIncludePool('hourly', getArrayFromDirectory('inc/hourly/', 'hourly_'));
-
-               // Update database
-               if ((!isConfigEntrySet('DEBUG_HOURLY')) || (!isDebugHourlyEnabled())) {
-                       updateConfiguration('last_hourly', getHour());
-               } // END - if
+       // Is ext-sql_patches at least 0.9.8?
+       if (isExtensionInstalledAndNewer('sql_patches', '0.9.8')) {
+               // Has it changed?
+               if ((getLastHourly() != getHour()) || (isDebugHourlyEnabled())) {
+                       // Get more hourly reset scripts
+                       setIncludePool('hourly', getArrayFromDirectory('inc/hourly/', 'hourly_'));
 
                // Run the filter
                runFilterChain('load_includes', 'hourly');
+               } // END - if
        } // END - if
 }
 
@@ -606,74 +604,62 @@ function FILTER_RUN_DAILY_INCLUDES () {
        // Is the reset set or old sql_patches?
        if (((!isDailyResetEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.8'))) && (isHtmlOutputMode())) {
                // Then abort here
-               reportBug(__FUNCTION__, __LINE__, 'Cannot run daily reset! enabled='.intval(isDailyResetEnabled()).',ext='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
+               reportBug(__FUNCTION__, __LINE__, 'Cannot run daily reset! enabled='.intval(isDailyResetEnabled()).',isExtensionInstalledAndNewer='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
        } // END - if
 
-       // Get more daily reset scripts
-       setIncludePool('daily', getArrayFromDirectory('inc/daily/', 'daily_'));
+       // Is ext-sql_patches at least 0.9.8?
+       if (isExtensionInstalledAndNewer('sql_patches', '0.9.8')) {
+               // Has it changed?
+               if ((getLastDaily() != getDay()) || (isDebugDailyEnabled())) {
+                       // Get more daily reset scripts
+                       setIncludePool('daily', getArrayFromDirectory('inc/daily/', 'daily_'));
 
-       // Update configuration if this reset is not being debugged
-       if (!isDebugDailyEnabled()) {
-               updateConfiguration('last_daily', getDay());
+                       // Run the filter
+                       runFilterChain('load_includes', 'daily');
+               } // END - if
        } // END - if
-
-       // Run the filter
-       runFilterChain('load_includes', 'daily');
 }
 
 // Load more weeklt scripts
 function FILTER_RUN_WEEKLY_INCLUDES () {
        // Is the reset set or old sql_patches?
-       if (((!isWeeklyResetDebugEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.8'))) && (isHtmlOutputMode())) {
+       if (((!isWeeklyResetEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.8'))) && (isHtmlOutputMode())) {
                // Then abort here
-               reportBug(__FUNCTION__, __LINE__, 'Cannot run weekly reset! enabled='.intval(isWeeklyResetDebugEnabled()).',ext='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
+               reportBug(__FUNCTION__, __LINE__, 'Cannot run weekly reset! enabled='.intval(isWeeklyResetEnabled()).',isExtensionInstalledAndNewer()='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
        } // END - if
 
-       // Is the config entry set?
-       if (isExtensionInstalledAndNewer('sql_patches', '0.4.2')) {
+       // Is ext-sql_patches at least 0.9.8?
+       if (isExtensionInstalledAndNewer('sql_patches', '0.9.8')) {
                // Has it changed?
-               if (((isConfigEntrySet('last_weekly')) && (getLastWeekly() != getWeek())) || (isWeeklyResetDebugEnabled())) {
+               if ((getLastWeekly() != getWeek()) || (isDebugWeeklyEnabled())) {
                        // Include weekly reset scripts
                        setIncludePool('weekly', getArrayFromDirectory('inc/weekly/', 'weekly_'));
 
-                       // Update configuration if this reset is not being debugged
-                       if (!isWeeklyResetDebugEnabled()) {
-                               updateConfiguration('last_weekly', getWeek());
-                       } // END - if
+                       // Run the filter
+                       runFilterChain('load_includes', 'weekly');
                } // END - if
-
-               // Run the filter
-               runFilterChain('load_includes', 'weekly');
        } // END - if
 }
 
 // Load more monthly scripts
 function FILTER_RUN_MONTHLY_INCLUDES () {
        // Is the reset set or old sql_patches?
-       if (((!isMonthlyResetDebugEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.8'))) && (isHtmlOutputMode())) {
+       if (((!isMonthlyResetEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.8'))) && (isHtmlOutputMode())) {
                // Then abort here
-               reportBug(__FUNCTION__, __LINE__, 'Cannot run monthly reset! enabled='.intval(isMonthlyResetDebugEnabled()).',ext='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
+               reportBug(__FUNCTION__, __LINE__, 'Cannot run monthly reset! enabled='.intval(isMonthlyResetEnabled()).',isExtensionInstalledAndNewer='.intval(isExtensionInstalledAndNewer('sql_patches', '0.9.8')).' Please report this bug. Thanks');
        } // END - if
 
-       // Is the config entry set?
-       if (isExtensionInstalledAndNewer('sql_patches', '0.4.2')) {
-               // Create current month mark
-               $currMonth = getMonth();
-
+       // Is ext-sql_patches at least 0.9.8?
+       if (isExtensionInstalledAndNewer('sql_patches', '0.9.8')) {
                // Has it changed?
-               if ((getLastMonthly() != $currMonth) || (isMonthlyResetDebugEnabled())) {
+               if ((getLastMonthly() != getMonth()) || (isDebugMonthlyEnabled())) {
                        // Include monthly reset scripts
                        setIncludePool('monthly', getArrayFromDirectory('inc/monthly/', 'monthly_'));
 
-                       // Update configuration if this reset is not being debugged
-                       if (!isMonthlyResetDebugEnabled()) {
-                               updateConfiguration('last_monthly', $currMonth);
-                       } // END - if
+                       // Run the filter
+                       runFilterChain('load_includes', 'monthly');
                } // END - if
        } // END - if
-
-       // Run the filter
-       runFilterChain('load_includes', 'monthly');
 }
 
 // Filter for removing the given extension
@@ -843,6 +829,7 @@ function FILTER_RUN_HOURLY_RESET () {
        } // END - if
 
        // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getLastHourly()=' . getLastHourly() . ',getHour()=' . getHour());
        if (((getLastHourly() != getHour()) || (isDebugHourlyEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestElementSet('setup')) && (!isCssOutputMode())) {
                // Tell every module we are in reset-mode!
                doHourly();
@@ -857,6 +844,7 @@ function FILTER_RUN_DAILY_RESET () {
        } // END - if
 
        // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getLastDaily()=' . getLastDaily() . ',getDay()=' . getDay());
        if (((getLastDaily() != getDay()) || (isDebugDailyEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestElementSet('setup')) && (!isCssOutputMode())) {
                // Tell every module we are in reset-mode!
                doDaily();
@@ -871,6 +859,7 @@ function FILTER_RUN_WEEKLY_RESET () {
        } // END - if
 
        // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getLastWeekly()=' . getLastWeekly() . ',getWeek()=' . getWeek());
        if (((getLastWeekly() != getWeek()) || (isDebugWeeklyEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestElementSet('setup')) && (!isCssOutputMode())) {
                // Tell every module we are in reset-mode!
                doWeekly();
@@ -885,6 +874,7 @@ function FILTER_RUN_MONTHLY_RESET () {
        } // END - if
 
        // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getLastMonthly()=' . getLastMonthly() . ',getMonth()=' . getMonth());
        if (((getLastMonthly() != getMonth()) || (isDebugMonthlyEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestElementSet('setup')) && (!isCssOutputMode())) {
                // Tell every module we are in reset-mode!
                doMonthly();
index 2d87018af23e5926d500834ec2f213aa34c2e114..0ae32cc285d5ae0374d50b71a14a1f7937b22027 100644 (file)
@@ -1629,6 +1629,12 @@ function doHourly () {
 
        // Run filters (one always!)
        runFilterChain('hourly');
+
+       // Do not update in hourly debug mode
+       if ((!isConfigEntrySet('DEBUG_HOURLY')) || (!isDebugHourlyEnabled())) {
+               // Update database
+               updateConfiguration('last_hourly', getHour());
+       } // END - if
 }
 
 // Enables the daily reset mode and runs it
@@ -1638,6 +1644,12 @@ function doDaily () {
 
        // Run filters
        runFilterChain('daily');
+
+       // Do not update in daily debug mode
+       if ((!isConfigEntrySet('DEBUG_DAILY')) || (!isDebugDailyEnabled())) {
+               // Update database
+               updateConfiguration('last_daily', getDay());
+       } // END - if
 }
 
 // Enables the weekly reset mode and runs it
@@ -1647,6 +1659,12 @@ function doWeekly () {
 
        // Run filters
        runFilterChain('weekly');
+
+       // Do not update in weekly debug mode
+       if ((!isConfigEntrySet('DEBUG_WEEKLY')) || (!isDebugWeeklyEnabled())) {
+               // Update database
+               updateConfiguration('last_weekly', getWeek());
+       } // END - if
 }
 
 // Enables the monthly reset mode and runs it
@@ -1656,6 +1674,12 @@ function doMonthly () {
 
        // Run filters
        runFilterChain('monthly');
+
+       // Do not update in monthly debug mode
+       if ((!isConfigEntrySet('DEBUG_MONTHLY')) || (!isDebugMonthlyEnabled())) {
+               // Update database
+               updateConfiguration('last_monthly', getMonth());
+       } // END - if
 }
 
 // Shuts down the mailer (e.g. closing database link, flushing output/filters, etc.)
index 0890b75da59d36bf959641935c50c08fc6fce6da..089ebf9b50b4e84340c801136ddf771e8bf05eef 100644 (file)
@@ -82,7 +82,7 @@ FROM
        `{?_MYSQL_PREFIX?}_user_data` AS `d`
 ' . $whereStatement . '
 ORDER BY
-       `d`.`points` DESC,
+       `points` DESC,
        `d`.`userid` ASC
 LIMIT {?bonus_ranks?}', __FILE__, __LINE__);
 
index e3f4e43dcd5670bcc21b4bbe58e67f821b8fc6a4..812e87db22f0be4cd6e09857fdbd104654100e24 100644 (file)
@@ -1 +1 @@
-$content[id]  |  {%pipe,convertZeroToNull=$content[assigned_admin]%}  |  {%pipe,convertZeroToNull=$content[userid]%}  |  {%pipe,translateTaskStatus=$content[task_type]%}  |  {%pipe,translateTaskType=$content[status]%}  |  $content[task_created]
+$content[id]  |  {%pipe,convertZeroToNull=$content[assigned_admin]%}  |  {%pipe,convertZeroToNull=$content[userid]%}  |  {%pipe,translateTaskType=$content[task_type]%}  |  {%pipe,translateTaskStatus=$content[status]%}  |  $content[task_created]