More queries now depends on UNIX_TIMESTAMP() not on time(), more fixes for not instal...
[mailer.git] / inc / modules / admin / what-list_bonus.php
index 7b02b64a92348de6184214e81487d95ff74ce458..6cd69df1a27e5c0a5d6ab2c1c3fb78a6b14c4dfb 100644 (file)
@@ -69,8 +69,8 @@ if ($_CONFIG['bonus_active'] == "Y") {
        $LAST = "%s"; $ONLINE = "";
        if (EXT_IS_ACTIVE("autopurge")) {
                // Use last online timestamp to keep inactive members away from here
-               $LAST   = " AND last_online >= %s";
-               $ONLINE = bigintval(time() - $_CONFIG['ap_inactive_since']);
+               $LAST   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+               $ONLINE = $_CONFIG['ap_inactive_since'];
        }
 
        // Check if at least one is in the active rallye
@@ -127,7 +127,11 @@ ORDER BY active_bonus DESC, last_online DESC, userid",
                }
 
                // Prepare constant for timemark
-               define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2"));
+               if (EXT_IS_ACTIVE("autopurge")) {
+                       define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2"));
+               } else {
+                       define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge"));
+               }
 
                // Load final template
                LOAD_TEMPLATE("admin_list_bonus");