]> git.mxchange.org Git - mailer.git/blobdiff - inc/monthly/monthly_beg.php
- Rewrites to use more the userid than the actual email address when sending
[mailer.git] / inc / monthly / monthly_beg.php
index c1effc065c918e777e5a0581d5dee514865a223c..56a93a07860904f87f75e3cc98446efa602d0d46 100644 (file)
@@ -52,21 +52,18 @@ if (!defined('__SECURITY')) {
 // Check if month is done
 if ((getBegRanks() > 0) && (!isCssOutputMode())) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
-       $whereStatement1 = '';
+       $whereStatement = '';
 
        // Shall we exclude webmaster's own userid?
        if ((!isBegIncludeOwnEnabled()) && (isValidUserId(getBegUserid()))) {
                // Exclude it
-               $whereStatement1 = " AND `userid` != {?beg_userid?}";
+               $whereStatement = " AND `userid` != {?beg_userid?}";
        } // END - if
 
        // Let's check if there are some points left we can pay...
-       if (isExtensionActive('autopurge')) {
-               // Use last online stamp only when autopurge for inactive members is activated
-               if ((getApInactiveSince() > 0) && (isBegActiveEnabled())) {
-                       // Okay, include last online timestamp
-                       $whereStatement1 .= " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
-               } // END - if
+       if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
+               // Okay, include last online timestamp
+               $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
        } // END - if
 
        // SQL string to check for accounts
@@ -75,7 +72,7 @@ if ((getBegRanks() > 0) && (!isCssOutputMode())) {
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
-       `status`='CONFIRMED'" . $whereStatement1 . " AND
+       `status`='CONFIRMED'" . $whereStatement . " AND
        `beg_points` > 0
 ORDER BY
        `beg_points` DESC,
@@ -90,7 +87,7 @@ LIMIT {?beg_ranks?}", __FILE__, __LINE__);
 
                        // Load email template and email it away
                        $message = loadEmailTemplate('member_beg', $content, bigintval($content['userid']));
-                       sendEmail($content['email'], '{--BEG_MONTHLY_RALLYE--}', $message);
+                       sendEmail($content['userid'], '{--BEG_MONTHLY_RALLYE--}', $message);
                } // END - while
 
                // Reset accounts