]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/task_functions.php
More queries now depends on UNIX_TIMESTAMP() not on time(), more fixes for not instal...
[mailer.git] / inc / libs / task_functions.php
index 1aced16f60ee5ed4cb060d3ad899bdd6d5992617..20e653b4bd823b4d8d3907b80ce783afdeed0433 100644 (file)
@@ -272,7 +272,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main)
 
        if (EXT_IS_ACTIVE("autopurge")) {
                // Start finding them...
-               $since = (time() - $_CONFIG['ap_inactive_since']);
+               $since = $_CONFIG['ap_inactive_since'];
                $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']."";
 
                // Check for more extensions
@@ -284,7 +284,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main)
                // Check for all accounts
                $SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online
 FROM "._MYSQL_PREFIX."_user_data AS d
-WHERE d.status='CONFIRMED' AND d.joined < ".$since." AND d.last_online < ".$since." AND d.ap_notified < ".$since."
+WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < ".$since." AND d.ap_notified < ".$since."
 ".$EXCLUDE_LIST."
 ORDER BY d.userid";
                $WHATs[]  = "list_autopurge";
@@ -353,15 +353,14 @@ ORDER BY d.userid";
                }
 
                // Autopurge installed?
-               $LAST = ""; $ONLINE = "";
+               $LAST = "";
                if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['ap_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
                        // Use last online timestamp to keep inactive members away from here
-                       $LAST   = " AND last_online >= ";
-                       $ONLINE = bigintval(time() - $_CONFIG['ap_inactive_since']);
+                       $LAST   = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
                }
 
                $SQLs[]   = "SELECT ".$USE." AS active_bonus FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."".$ONLINE."
+WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."
 ORDER BY active_bonus DESC, userid";
                $WHATs[]  = "list_bonus";
                $DESCRs[] = TASK_ADMIN_LIST_BONUS;
@@ -372,15 +371,14 @@ ORDER BY active_bonus DESC, userid";
                // Begging rallye
 
                // Autopurge installed?
-               $LAST = ""; $ONLINE = "";
+               $LAST = "";
                if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['ap_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
                        // Use last online timestamp to keep inactive members away from here
-                       $LAST   = " AND last_online >= ";
-                       $ONLINE = bigintval(time() - $_CONFIG['ap_inactive_since']);
+                       $LAST   = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
                }
 
                $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND beg_points>0".$LAST."".$ONLINE."
+WHERE status='CONFIRMED' AND beg_points>0".$LAST."
 ORDER BY beg_points DESC, userid";
                $WHATs[]  = "list_beg";
                $DESCRs[] = TASK_ADMIN_LIST_BEG;