- $time = bigintval($_CONFIG['ap_in_time']);
- $result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online
-FROM "._MYSQL_PREFIX."_user_data AS d, "._MYSQL_PREFIX."_config AS c
-WHERE status='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND last_online < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s)
-".$EXCLUDE_LIST."
-ORDER BY userid",
- array($since, $since, $time), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_inactive) > 0) {
+ $result_inactive = SQL_QUERY('SELECT
+ d.userid, d.email, d.last_online
+FROM
+ `{?_MYSQL_PREFIX?}_user_data` AS d
+WHERE
+ `status`='CONFIRMED' AND
+ `joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
+ `last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
+ `ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_time?})
+' . $EXCLUDE_LIST . '
+ORDER BY
+ `userid` ASC', __FILE__, __LINE__);
+
+ if (!SQL_HASZERONUMS($result_inactive)) {