Admin user details extended, DEBUG_LOG() rewritten, random userid on refid=0 added
[mailer.git] / inc / monthly / monthly_beg.php
index 73d3a57f361958282af0dec7fbc7cc64079ab82c..fde8d234f21ea8855fc3cf168be201bbe191c1c5 100644 (file)
@@ -57,7 +57,7 @@ if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONF
                // Use last online stamp only when autopurge for inactive members is activated
                if (($_CONFIG['ap_inactive_since'] > 0) && ($_CONFIG['beg_active'] == "Y")) {
                        // Okay, include last online timestamp
-                       $whereStatement1 = sprintf("AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval($_CONFIG['ap_inactive_since']));;
+                       $whereStatement1 = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval($_CONFIG['ap_inactive_since']));;
                        $whereStatement2 = bigintval($_CONFIG['beg_ranks']);
                } // END - if
        } // END - if
@@ -65,7 +65,7 @@ if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONF
        // SQL string to check for accounts
        $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points AS points
 FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' ".$whereStatement1." AND beg_points > 0
+WHERE status='CONFIRMED'".$whereStatement1." AND beg_points > 0
 ORDER BY beg_points DESC, userid
 LIMIT %s",
                array($whereStatement2), __FILE__, __LINE__);