]> git.mxchange.org Git - mailer.git/blobdiff - inc/monthly/monthly_beg.php
Fix for inserted codes while registering of extensions, many rewrites/cleanups:
[mailer.git] / inc / monthly / monthly_beg.php
index 2e664ec27bf1bec0968d47914ffdba7ea8d613ce..2ce572fc9d418b869ee0c2c742b70908c1702532 100644 (file)
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-} elseif ((getOutputMode() == 1) || (!isResetModeEnabled())) {
+} elseif ((getScriptOutputMode() == 1) || (!isResetModeEnabled())) {
        // Do not execute when script is in CSS mode or no daily reset
        return;
-} elseif ((!isExtensionActive('beg')) || (getConfig('beg_rallye') != 'Y')) {
+} elseif ((!isExtensionActive('beg')) || (!isBegRallyeEnabled())) {
        logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
        return;
 }
@@ -52,12 +52,12 @@ if (!defined('__SECURITY')) {
 $curr = getMonth();
 
 // Check if month is done
-if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && (getOutputMode() != 1)) {
+if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && (getScriptOutputMode() != 1)) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = '';
 
        // Shall we exclude webmaster's own userid?
-       if ((getConfig('beg_include_own') != 'Y') && (getConfig('beg_userid') > 0)) {
+       if ((getConfig('beg_include_own') != 'Y') && (isValidUserId(getConfig('beg_userid')))) {
                // Exclude it
                $whereStatement1 = " AND `userid` != {?beg_userid?}";
        } // END - if
@@ -84,7 +84,7 @@ ORDER BY
        `userid` ASC
 LIMIT {?beg_ranks?}", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                // Load our winners...
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Add points to user's account directly
@@ -96,7 +96,7 @@ LIMIT {?beg_ranks?}", __FILE__, __LINE__);
                } // END - while
 
                // Reset accounts
-               $result = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_points`=0.00000 WHERE `beg_points` > 0", __FILE__, __LINE__);
+               $result = SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_points`=0.00000 WHERE `beg_points` > 0', __FILE__, __LINE__);
        } // END - if
 
        // Free memory