]> git.mxchange.org Git - mailer.git/blobdiff - inc/autopurge/purge-general.php
More cached wrapper functions added for config entries
[mailer.git] / inc / autopurge / purge-general.php
index 0e26307b13849fa5b71121dcf1c509b2bd787710..c932ff47df0686a215b28a140b73e8e01c362744 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
        return false;
 }
 
-if (getConfig('auto_purge') > 0) {
+if (getAutoPurge() > 0) {
        // Init SQLs
        initSqls();
 
@@ -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);