s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
ORDER BY
s.userid ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Start deleting procedure
$userid = '0'; $points = '0';
while ($content = SQL_FETCHARRAY($result)) {
if (isExtensionActive('bonus', true)) {
// Check for bonus campaigns
$result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Start deleting procedure
$points = '0';
while ($content = SQL_FETCHARRAY($result)) {
// Check if confirmation links are purged or not
$result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
array(bigintval($content['id'])), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_links) > 0) {
+ if (!SQL_HASZERONUMS($result_links)) {
// At least one link was found, enougth to pay back the points
$points += $content['points'] * SQL_NUMROWS($result_links);