]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/task_functions.php
Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / libs / task_functions.php
index b1451b999f5fa11c56540321c997b67afece807c..b8258a4d0d13dca5cb7d4d0ac73a926cea83efee 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -67,7 +67,7 @@ function outputAdvancedOverview (&$result_main) {
        foreach (
                array(
                        // Member accounts
-                       'confirmed_members','unconfirmed_members','locked_members','random_refid',
+                       'confirmed_members','unconfirmed_members','locked_members','random_refid','testers',
                        // Tasks
                        'update_tasks','new_tasks','closed_tasks','your_tasks','deleted_tasks','solved_tasks',
                        // Mail orders
@@ -93,19 +93,17 @@ function outputAdvancedOverview (&$result_main) {
        //
        // Confirmed accounts
        $value = getTotalConfirmedUser();
-
        if ($value > 0) {
                $content['confirmed_members'] = '<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;status=confirmed%}">' . $value . '</a>';
        } // END - if
 
        // Unconfirmed accounts
        $value = getTotalUnconfirmedUser();
-
        if ($value > 0) {
                $content['unconfirmed_members'] = '<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;status=UNCONFIRMED%}">' . $value . '</a>';
        } // END - if
 
-       // And locked accounts
+       // Locked accounts
        $value = getTotalLockedUser();
        if ($value > 0) {
                $content['locked_members'] = '<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;status=locked%}">' . $value . '</a>';
@@ -115,7 +113,15 @@ function outputAdvancedOverview (&$result_main) {
                // And random refid
                $value = getTotalRandomRefidUser();
                if ($value > 0) {
-                       $content['random_refid'] = '<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;mode=random_refid%}">' . $value . '</a>';
+                       $content['random_refid'] = '<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;do=random_refid%}">' . $value . '</a>';
+               } // END - if
+
+               if (isExtensionInstalledAndNewer('user', '0.5.0')) {
+                       // And tester accounts
+                       $value = getTotalTesterUsers();
+                       if ($value > 0) {
+                               $content['testers'] = '<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;do=testers%}">' . $value . '</a>';
+                       } // END - if
                } // END - if
        } // END - if
 
@@ -215,11 +221,11 @@ function outputAdvancedOverview (&$result_main) {
                } elseif (isExtensionActive('bonus')) {
                        $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>';
+                       $content['purged_bonus_mails'] = '<span class="bad">{--ADMIN_EXTENSION_BONUS_404--}</span>';
                }
        } else {
-               $content['purged_bonus_mails'] = '<span class="notice">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
-               $content['purged_mails'] = '<span class="notice">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
+               $content['purged_bonus_mails'] = '<span class="bad">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
+               $content['purged_mails'] = '<span class="bad">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
        }
 
        //
@@ -241,7 +247,7 @@ function outputAdvancedOverview (&$result_main) {
        // Both extensions must be there
        if ((isExtensionActive('autopurge')) && (isExtensionActive('user'))) {
                // Start finding them...
-               $EXCLUDE_LIST = '';
+               $EXCLUDE_LIST = ' ';
 
                // Check for more extensions
                // @TODO These can be rewritten to filter
@@ -253,31 +259,38 @@ function outputAdvancedOverview (&$result_main) {
                        // Recent ext-holiday found
                        $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
                } // END - if
+               if (isExtensionInstalledAndNewer('user', '0.5.0')) {
+                       // Exclude test accounts
+                       $EXCLUDE_LIST = runFilterChain('user_exclusion_sql', $EXCLUDE_LIST);
+               } // END - if
 
                // Check for all accounts
                addSql("SELECT
-       d.userid, d.email, d.last_online
+       d.`userid`,
+       d.`email`,
+       d.`last_online`
 FROM
        `{?_MYSQL_PREFIX?}_user_data` AS d
 WHERE
-       d.`status`='CONFIRMED' AND
+       d.`status`='CONFIRMED'
+       " . runFilterChain('user_exclusion_sql', ' ') . " AND
        (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");
+       d.`userid` ASC");
                $WHATs[]  = 'list_autopurge';
                $DESCRs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE--}';
                $TITLEs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE_TITLE--}';
-       }
+       } // END - if
 
        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 OR `refid` IS NULL ORDER BY `userid` ASC");
-               $DESCRs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREF--}';
-               $TITLEs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREFERAL_TITLE--}';
-               $WHATs[]  = 'list_user&amp;mode=norefs';
+               // Check for accounts without referral
+               addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 OR `refid` IS NULL ' . runFilterChain('user_exclusion_sql', ' ') . ' ORDER BY `userid` ASC');
+               $DESCRs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NO_REFERRAL--}';
+               $TITLEs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NO_REFERRAL_TITLE--}';
+               $WHATs[]  = 'list_user&amp;do=norefs';
        } // END - if
 
        if (isExtensionActive('payout')) {
@@ -290,7 +303,7 @@ ORDER BY
                $WHATs[]  = 'list_payouts';
                $DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL_TITLE--}';
-       }
+       } // END - if
 
        if (isExtensionActive('wernis')) {
                // List new wernis requests
@@ -298,15 +311,7 @@ ORDER BY
                $WHATs[]  = 'list_wernis';
                $DESCRs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL_TITLE--}';
-       }
-
-       if (isExtensionActive('primera')) {
-               // List new primera requests
-               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--}';
-       }
+       } // END - if
 
        if (isExtensionActive('holiday')) {
                // List holiday requests
@@ -314,7 +319,7 @@ ORDER BY
                $WHATs[]  = 'list_holiday';
                $DESCRs[] = '{--ADMIN_TASK_LIST_HOLIDAYS--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_HOLIDAYS_TITLE--}';
-       }
+       } // END - if
 
        if (isExtensionInstalledAndNewer('bonus', '0.8.7')) {
                // List all notifications
@@ -326,20 +331,14 @@ ORDER BY
 
        // 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
-                       $USE = '(0';
-                       if (getConfig('bonus_click_yn') == 'Y') $USE .= ' + `turbo_bonus`';
-                       if (getConfig('bonus_login_yn') == 'Y') $USE .= ' + `login_bonus`';
-                       if (getConfig('bonus_order_yn') == 'Y') $USE .= ' + `bonus_order`';
-                       if (getConfig('bonus_stats_yn') == 'Y') $USE .= ' + `bonus_stats`';
-                       if (getConfig('bonus_ref_yn')   == 'Y') $USE .= ' + `bonus_ref`';
-                       $USE .= ')';
-               } else {
-                       // Old version ???
-                       $USE = 'turbo_bonus';
-               }
+               // Get more columns
+               $add = runFilterChain('add_bonus_points_user_columns', '');
+
+               // Active rallye, so add more point columns, if not empty
+               $pointsColumns = '`turbo_bonus`';
+               if (!empty($add)) {
+                       $pointsColumns = '(0' . $add . ')';
+               } // END - if
 
                // Init variable
                $lastOnline = '';
@@ -351,12 +350,12 @@ ORDER BY
                } // END - if
 
                addSql("SELECT
-       " . $USE . " AS `points`
+       " . $pointsColumns . " AS `points`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
        `status`='CONFIRMED' AND
-       " . $USE . " > 0
+       " . $pointsColumns . " > 0
        " . $lastOnline . "
 ORDER BY
        `points` DESC,
@@ -398,7 +397,7 @@ ORDER BY
        if (isExtensionActive('doubler')) {
                // List waiting payouts
                addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` WHERE `completed`='N' ORDER BY `id` ASC");
-               $WHATs[]  = 'list_doubler&amp;mode=waiting&amp;select=all';
+               $WHATs[]  = 'list_doubler&amp;do=waiting&amp;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');
@@ -408,7 +407,7 @@ ORDER BY
        } // END - if
 
        //
-       // All referal banner
+       // All referral banner
        //
        addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC');
        $WHATs[] = 'refbanner';
@@ -416,7 +415,7 @@ ORDER BY
        $TITLEs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL_TITLE--}';
 
        //
-       // All activated referal banner
+       // All activated referral banner
        //
        addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `visible`='Y' ORDER BY `id` ASC");
        $WHATs[] = 'refbanner';