From: Roland Häder Date: Fri, 1 Feb 2013 23:39:22 +0000 (+0000) Subject: Further fixes for all resets X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d7d40e177e09a7161b79bfc95a1d2e91fdff4691;p=mailer.git Further fixes for all resets --- diff --git a/inc/filters.php b/inc/filters.php index 7815b2f3dc..9e135b3e47 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -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(); diff --git a/inc/functions.php b/inc/functions.php index 2d87018af2..0ae32cc285 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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.) diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index 0890b75da5..089ebf9b50 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -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__); diff --git a/templates/de/emails/admin/admin_purge_task_row.tpl b/templates/de/emails/admin/admin_purge_task_row.tpl index e3f4e43dcd..812e87db22 100644 --- a/templates/de/emails/admin/admin_purge_task_row.tpl +++ b/templates/de/emails/admin/admin_purge_task_row.tpl @@ -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]