X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmails%2Fbonus_mails.php;h=82a7d25e5cfdc8e78ad50b14c0e3616789d75df0;hp=6c90799735d03d60dbf20ccbba98c869aeb95f97;hb=4001187f22197f55e5a1f211fc8defcc180f7c32;hpb=a47a9c49a7813304ac78deb3741bdd85e6d50912 diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 6c90799735..82a7d25e5c 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -78,7 +78,7 @@ if (!empty($sql)) { $sql .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC"; // Normal notification mails or bonus mails? - $MAIL_MODE = ((getConfig('bonus_notify_points') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); + $sentBonusMails = ((getConfig('bonus_notify_points') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); // Generate subject line $SUBJECT = constant('BONUS_RALLYE_'.strtoupper($MODE).'_NOTIFY'); @@ -91,27 +91,27 @@ if (!empty($sql)) { $result_main = SQL_QUERY($sql, __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // Okay lets notify all users! - while (list($uid, $email) = SQL_FETCHROW($result_main)) { + while ($content = SQL_FETCHARRAY($result_main)) { // Update account SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET bonus_ral_notify='%s', bonus_ral_%s_notify='%s' WHERE userid=%s LIMIT 1", - array(time(), $MODE, time(), $uid), __FILE__, __LINE__); + array(time(), $MODE, time(), $content['userid']), __FILE__, __LINE__); // Load email template and send it to the user! - if ($MAIL_MODE) { + if ($sentBonusMails === true) { // Add userid to queue - $UIDs[] = $uid; + $UIDs[] = $content['userid']; } else { // Send normal notification mail to the members - $MSG = LOAD_EMAIL_TEMPLATE("bonus_".$MODE."_notify", array(), $uid); - SEND_EMAIL($uid, $SUBJECT, $MSG); + $MSG = LOAD_EMAIL_TEMPLATE("bonus_".$MODE."_notify", array(), $content['userid']); + SEND_EMAIL($content['email'], $SUBJECT, $MSG); } } // END - while // Shall I send out bonus mails? - if ($MAIL_MODE) { + if ($sentBonusMails === true) { // Okay, make array to string $RECEIVER = implode(";", $UIDs);