]> git.mxchange.org Git - mailer.git/blobdiff - inc/autopurge/purge-inact.php
More cached wrapper functions added for config entries
[mailer.git] / inc / autopurge / purge-inact.php
index 74dd7469a14577fc6becaa474bcc9d51fd868393..d3c9b49150e6029b551c22b2e6a877e23358b1f2 100644 (file)
@@ -56,10 +56,7 @@ if (getConfig('autopurge_inactive') == 'Y') {
        // Init exclusion list
        // @TODO Rewrite these if() blocks to a filter
        $EXCLUDE_LIST = '';
-       if (getConfig('def_refid') > 0) {
-               $EXCLUDE_LIST = ' AND d.`userid` != {?def_refid?}';
-       } // END - if
-
+       if (isValidUserId(getConfig('def_refid'))) $EXCLUDE_LIST .= ' AND d.`userid` != {?def_refid?}';
        // Check for more extensions
        if (isExtensionActive('beg'))     $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}';
        if (isExtensionActive('bonus'))   $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}';
@@ -89,11 +86,11 @@ ORDER BY
                        getApInactiveSince()
                ), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_inactive) > 0) {
+       if (!SQL_HASZERONUMS($result_inactive)) {
                // Prepare variables and constants...
                $useridsContent = '';
                $content['since'] = (getApInactiveSince() / 60 / 60);
-               $content['time']  = (getConfig('ap_inactive_time')  / 60 / 60);
+               $content['time']  = (getApInactiveTime()  / 60 / 60);
 
                // Mark found accounts as inactive and send an email
                while ($row = SQL_FETCHARRAY($result_inactive)) {
@@ -140,7 +137,7 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_inactive) > 0) {
+       if (!SQL_HASZERONUMS($result_inactive)) {
                // Prepare variable...
                $useridsContent = '';