// 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
// 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__);