]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/task_functions.php
Way more usage of EL code:
[mailer.git] / inc / libs / task_functions.php
index 46dd7e1dd4406f5bd27a1c961f813f26fc739d43..e1daec9d31b1dc3c8edc95747e4d5e906a158a1a 100644 (file)
@@ -206,7 +206,7 @@ function outputAdvancedOverview (&$result_main) {
                                $content['purged_bonus_mails'] = '<a href="{%url=modules.php?module=admin&amp;what=email_details%}">' . $value . '</a>';
                        } // END - if
                } elseif (isExtensionActive('bonus')) {
-                       $content['purged_bonus_mails'] = getMaskedMessage('ADMIN_EXTENSION_BONUS_OUTDATED', '0.1.8');
+                       $content['purged_bonus_mails'] = '{%message,ADMIN_EXTENSION_BONUS_OUTDATED=0.1.8%}';
                } else {
                        $content['purged_bonus_mails'] = '<span class="notice">{--ADMIN_EXTENSION_BONUS_404--}</span>';
                }
@@ -226,12 +226,13 @@ function outputAdvancedOverview (&$result_main) {
                        $content['send_bonus_mails'] = '<a href="{%url=modules.php?module=admin&amp;what=email_details%}">' . $value . '</a>';
                } // END - if
        } elseif (isExtensionActive('bonus')) {
-               $content['send_bonus_mails'] = getMaskedMessage('ADMIN_EXTENSION_BONUS_OUTDATED', '0.1.8');
+               $content['send_bonus_mails'] = '{%message,ADMIN_EXTENSION_BONUS_OUTDATED=0.1.8%}';
        } else {
                $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&amp;mode=norefs';
-       }
+       } // END - if
 
        if (isExtensionActive('payout')) {
                // List new payout requests
@@ -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,11 +334,13 @@ 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
@@ -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
@@ -425,32 +432,6 @@ 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&amp;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');