X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Ftask_functions.php;h=96355fa9ce87d9db026064103452239b1a84be91;hb=0851db137e420b90617f47b77de2302e770f5f02;hp=1d04801e83f0c6a11d197302763fe4c26d1bbbb0;hpb=c3b4eaf29946349ff058691db2dcb615a5379bb2;p=mailer.git diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 1d04801e83..96355fa9ce 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -231,7 +231,8 @@ function outputAdvancedOverview (&$result_main) { $content['send_bonus_mails'] = '{--ADMIN_EXTENSION_BONUS_404--}'; } - if (isExtensionActive('autopurge')) { + // Both extensions must be there + if ((isExtensionActive('autopurge')) && (isExtensionActive('user'))) { // Start finding them... $EXCLUDE_LIST = ''; @@ -253,9 +254,9 @@ FROM `{?_MYSQL_PREFIX?}_user_data` AS d WHERE d.`status`='CONFIRMED' AND - d.joined < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND - d.last_online < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND - d.ap_notified < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) + (UNIX_TIMESTAMP() - d.`joined`) >= {?ap_inactive_since?} AND + (UNIX_TIMESTAMP() - d.`last_online`) >= {?ap_inactive_since?} AND + (UNIX_TIMESTAMP() - d.`ap_notified`) >= {?ap_inactive_since?} ".$EXCLUDE_LIST." ORDER BY d.userid ASC"); @@ -264,13 +265,13 @@ ORDER BY $TITLEs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE_TITLE--}'; } - if (isExtensionInstalledAndNewer('sql_patches', '0.3.4')) { + if ((isExtensionInstalledAndNewer('sql_patches', '0.3.4')) && (isExtensionActive('user'))) { // Check for accounts without referal addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 ORDER BY `userid` ASC"); $DESCRs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREF--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREFERAL_TITLE--}'; $WHATs[] = 'list_user&mode=norefs'; - } + } // END - if if (isExtensionActive('payout')) { // List new payout requests @@ -278,7 +279,7 @@ ORDER BY $WHATs[] = 'list_payouts'; $DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING_TITLE--}'; - addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` ORDER BY `userid` ASC"); + addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` ORDER BY `userid` ASC'); $WHATs[] = 'list_payouts'; $DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL_TITLE--}'; @@ -286,7 +287,7 @@ ORDER BY if (isExtensionActive('wernis')) { // List new wernis requests - addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_wernis` ORDER BY `userid` ASC"); + addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_wernis` ORDER BY `userid` ASC'); $WHATs[] = 'list_wernis'; $DESCRs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL_TITLE--}'; @@ -294,7 +295,7 @@ ORDER BY if (isExtensionActive('primera')) { // List new primera requests - addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC"); + addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC'); $WHATs[] = 'list_primera'; $DESCRs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL_TITLE--}'; @@ -302,7 +303,7 @@ ORDER BY if (isExtensionActive('holiday')) { // List holiday requests - addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC"); + addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC'); $WHATs[] = 'list_holiday'; $DESCRs[] = '{--ADMIN_TASK_LIST_HOLIDAYS--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_HOLIDAYS_TITLE--}'; @@ -316,7 +317,8 @@ ORDER BY $TITLEs[] = '{--ADMIN_TASK_LIST_NOTIFICATIONS_TITLE--}'; } // END - if - if (isExtensionInstalledAndNewer('bonus', '0.2.3')) { + // Both extensions must be there + if ((isExtensionInstalledAndNewer('bonus', '0.2.3')) && (isExtensionActive('user'))) { // Active rallye if (isExtensionInstalledAndNewer('bonus', '0.6.9')) { // Add more bonus points here @@ -332,15 +334,17 @@ ORDER BY $USE = 'turbo_bonus'; } - // Autopurge installed? + // Init variable $lastOnline = ''; - if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) { + + // Autopurge installed? + if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) { // Use last online timestamp to keep inactive members away from here - $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})'; + $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}'; } // END - if addSql("SELECT - " . $USE . " AS points + " . $USE . " AS `points` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE @@ -355,14 +359,17 @@ ORDER BY $TITLEs[] = '{--ADMIN_TASK_LIST_BONUS_TITLE--}'; } - if (isExtensionInstalledAndNewer('beg', '0.1.2')) { - // Begging rallye + // Again both extensions must be there + if ((isExtensionInstalledAndNewer('beg', '0.1.2')) && (isExtensionActive('user'))) { + // ----- Begging rallye ----- - // Autopurge installed? + // Init variable $lastOnline = ''; - if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) { + + // Autopurge installed? + if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) { // Use last online timestamp to keep inactive members away from here - $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})'; + $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}'; } // END - if addSql("SELECT @@ -387,7 +394,7 @@ ORDER BY $WHATs[] = 'list_doubler&mode=waiting&select=all'; $DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE--}'; - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` ORDER BY `id` ASC"); + addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` ORDER BY `id` ASC'); $WHATs[] = 'list_doubler'; $DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL_TITLE--}'; @@ -396,7 +403,7 @@ ORDER BY // // All referal banner // - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC"); + addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC'); $WHATs[] = 'refbanner'; $DESCRs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL_TITLE--}'; @@ -412,7 +419,7 @@ ORDER BY // // All extensions // - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `id` ASC"); + addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `id` ASC'); $WHATs[] = 'extensions'; $DESCRs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL_TITLE--}'; @@ -425,35 +432,9 @@ ORDER BY $DESCRs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ACTIVE--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ACTIVE_TITLE--}'; - if (isExtensionActive('engine')) { - // List all export accounts - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` ORDER BY `id` ASC"); - $WHATs[] = 'list_engine'; - $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE--}'; - $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_TITLE--}'; - - // List all pending accounts - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` WHERE `status`='UNCONFIRMED' ORDER BY `id` ASC"); - $WHATs[] = 'unlock_engine'; - $DESCRs[] = '{--ADMIN_TASK_UNLOCK_ENGINE--}'; - $TITLEs[] = '{--ADMIN_TASK_UNLOCK_ENGINE_TITLE--}'; - - // List all safes - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_safe` ORDER BY `id` ASC"); - $WHATs[] = 'list_engine&mode=safe'; - $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE_SAFES--}'; - $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_SAFES_TITLE--}'; - - // List all export URLs - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_urls` ORDER BY `id` ASC"); - $WHATs[] = 'engine_urls'; - $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE_URLS--}'; - $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_URLS_TITLE--}'; - } // END - if - if (isExtensionActive('sponsor')) { // List all sponsors - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` ORDER BY `id` ASC"); + addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` ORDER BY `id` ASC'); $WHATs[] = 'list_sponsor'; $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_TITLE--}'; @@ -491,7 +472,7 @@ ORDER BY if (isExtensionActive('country')) { // List country codes - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `id` ASC"); + addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `id` ASC'); $WHATs[] = 'list_country'; $DESCRs[] = '{--ADMIN_TASK_LIST_COUNTRY--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_COUNTRY_TITLE--}'; @@ -499,7 +480,7 @@ ORDER BY if (isExtensionActive('theme')) { // List all themes - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC"); + addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC'); $WHATs[] = 'theme_edit'; $DESCRs[] = '{--ADMIN_TASK_LIST_THEME_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_THEME_ALL_TITLE--}'; @@ -513,7 +494,7 @@ ORDER BY if (isExtensionActive('admins')) { // List all administrator logins - addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC"); + addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC'); $WHATs[] = 'admins_edit'; $DESCRs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL_TITLE--}'; @@ -521,7 +502,7 @@ ORDER BY if (isExtensionActive('surfbar')) { // List all URLs in surfbar - addSql("SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `url_id` ASC"); + addSql('SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `url_id` ASC'); $WHATs[] = 'list_surfbar_urls'; $DESCRs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL_TITLE--}'; @@ -537,7 +518,9 @@ ORDER BY $EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs); // If empty just keep a forced-space left for CSS issues - if (empty($EXTRAS)) $EXTRAS = ' '; + if (empty($EXTRAS)) { + $EXTRAS = ' '; + } // END - if // Add compiled string to constant for final template $content['extra_table'] = $EXTRAS; @@ -565,7 +548,9 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) { ); // Rewrite CSS class if not last entry is reached - if ($key < (count($sqls) - 1)) $content['bottom'] = 'bottom'; + if ($key < (count($sqls) - 1)) { + $content['bottom'] = 'bottom'; + } // END - if if ((!SQL_HASZERONUMS($result)) && (!empty($WHATs[$key]))) { if (empty($TITLEs[$key])) { @@ -588,5 +573,5 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) { return loadTemplate('admin_overview_task_extras', true, $OUT); } -// +// [EOF] ?>