]> git.mxchange.org Git - mailer.git/blobdiff - inc/autopurge/purge-general.php
More rewrites to make use of (cached) wrapper functions
[mailer.git] / inc / autopurge / purge-general.php
index 0e26307b13849fa5b71121dcf1c509b2bd787710..68b98ac43524d0510fb1c02395d827cbb4d4b386 100644 (file)
@@ -66,7 +66,7 @@ WHERE
        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)) {
@@ -108,14 +108,14 @@ ORDER BY
        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);