X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmails%2Fbonus_mails.php;h=da5d22c5128459193a825a404d9aa822ae3437dc;hb=a12bb20268fe0d586c434eea2c1fdf9c65a45bbb;hp=baddc4ad7a4340aeab1a56cb22151d1455bc7fa0;hpb=aa63aed07428a99ea09002c8d072990677700080;p=mailer.git diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index baddc4ad7a..da5d22c512 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -45,37 +45,37 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode -if ($GLOBALS['output_mode'] == 1) return; +if (getOutputMode() == 1) return; // Create timemark from saved month -$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time())); +$mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', time())); $sql = ''; $mode = ''; // Shall I sent activation or deactivation mail? $sql = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (bonus_ral_notify "; switch (getConfig('bonus_active')) { -case 'Y': // Active rallye is activated - if (getConfig('bonus_en_notify') == 'Y') { - // Okay, let's check for member accounts - $sql .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)"; - $mode = "en"; - } else { - // Do not notify! - $sql = ''; - } - break; - -case 'N': // Active rallye is deactivated - if (getConfig('bonus_di_notify') == 'Y') { - // Okay, let's check for member accounts - $sql .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify"; - $mode = "di"; - } else { - // Do not notify! - $sql = ''; - } - break; + case 'Y': // Active rallye is activated + if (getConfig('bonus_en_notify') == 'Y') { + // Okay, let's check for member accounts + $sql .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)"; + $mode = "en"; + } else { + // Do not notify! + $sql = ''; + } + break; + + case 'N': // Active rallye is deactivated + if (getConfig('bonus_di_notify') == 'Y') { + // Okay, let's check for member accounts + $sql .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify"; + $mode = "di"; + } else { + // Do not notify! + $sql = ''; + } + break; } if (!empty($sql)) { @@ -102,7 +102,7 @@ if (!empty($sql)) { SET bonus_ral_notify='%s', bonus_ral_%s_notify='%s' WHERE userid=%s LIMIT 1", - array(time(), $mode, time(), $content['userid']), __FILE__, __LINE__); + array(time(), $mode, time(), $content['userid']), __FILE__, __LINE__); // Load email template and send it to the user! if ($sentBonusMails === true) { @@ -111,7 +111,7 @@ LIMIT 1", } else { // Send normal notification mail to the members $message = LOAD_EMAIL_TEMPLATE('bonus_' . $mode . '_notify', array(), $content['userid']); - SEND_EMAIL($content['email'], $subject, $message); + sendEmail($content['email'], $subject, $message); } } // END - while @@ -124,7 +124,7 @@ LIMIT 1", $URL = 'modules.php?module=index&what=login'; // Insert mail - ADD_BONUS_MAIL_TO_QUEUE($subject, $message, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main)); + addBonusMailToQueue($subject, $message, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main)); } // END - if } // END - if