);
// Load message template
- $msg = LOAD_EMAIL_TEMPLATE("normal-mail", $content, bigintval($uid));
+ $mailText = LOAD_EMAIL_TEMPLATE("normal-mail", $content, bigintval($uid));
// Send mail away
- SEND_EMAIL($email, $DATA[2], $msg, $HTML);
+ SEND_EMAIL($email, $DATA[2], $mailText, $HTML);
// Count sent mails...
$result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET emails_sent=emails_sent+1 WHERE userid=%s LIMIT 1",
} // END - if
// And count up the mail
- $cnt++;
- //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$cnt."*<br />";
+ $GLOBALS['pool_cnt']++;
+ //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$GLOBALS['pool_cnt']."*<br />";
break;
case "already":
// Entry already found, but we still count one up!
- $cnt++;
- //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$cnt."<br />";
+ $GLOBALS['pool_cnt']++;
+ //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$GLOBALS['pool_cnt']."<br />";
break;
}
}
- // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $cnt)
- //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".getConfig('max_send').">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*<br />";
- if ((($cnt >= $DATA[8])) && ($LAST_SENT_ID != $DATA[0])) {
+ // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
+ //* DEBUG: */ echo "*L:".__LINE__."/".$GLOBALS['pool_cnt'].">=".$DATA[8]."/".getConfig('max_send').">=".$GLOBALS['pool_cnt']."/".$LAST_SENT_ID."!=".$DATA[0]."*<br />";
+ if ((($GLOBALS['pool_cnt'] >= $DATA[8])) && ($LAST_SENT_ID != $DATA[0])) {
// Prepare content
$content = array(
'sender_uid' => $DATA[1],
list($sname, $fname, $email) = SQL_FETCHROW($result_sender);
// Load email template
- $msg = LOAD_EMAIL_TEMPLATE("done-member", $content, $DATA[1]);
+ $mailText = LOAD_EMAIL_TEMPLATE("done-member", $content, $DATA[1]);
// Send it also waway
- SEND_EMAIL($email, MEMBER_SUBJ_SEND_DONE, $msg);
+ SEND_EMAIL($email, MEMBER_SUBJ_SEND_DONE, $mailText);
} // END - if
// Free result
$result_user = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET timestamp_send=UNIX_TIMESTAMP() WHERE pool_id=%s LIMIT 1",
array(bigintval($DATA[0])), __FILE__, __LINE__);
- $LAST_SENT_ID = $DATA[0]; $cnt = 0;
- $cnt2 += $cnt;
+ $LAST_SENT_ID = $DATA[0]; $GLOBALS['pool_cnt'] = 0;
+ $cnt2 += $GLOBALS['pool_cnt'];
// Update mediadata if version is 0.0.4 or higher
if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
break;
}
// Do we have send maximum mails?
- elseif (($cnt >= getConfig('max_send')) || ($cnt2 >= getConfig('max_send'))) {
+ elseif (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || ($cnt2 >= getConfig('max_send'))) {
// There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
$ADD = "";
- if ($cnt <= $DATA[8]) $ADD = ", target_send=target_send-".$cnt;
+ if ($GLOBALS['pool_cnt'] <= $DATA[8]) $ADD = ", target_send=target_send-".$GLOBALS['pool_cnt'];
$result_queue = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='NEW', receivers='%s'".$ADD." WHERE id=%s LIMIT 1",
array(implode(";", $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
SQL_FREERESULT($result);
// User account does exists, so we can safely pay back!
- $msg = LOAD_EMAIL_TEMPLATE("back-member", $content, bigintval($uid));
+ $mailText = LOAD_EMAIL_TEMPLATE("back-member", $content, bigintval($uid));
// Send mail out to member
- SEND_EMAIL($email, MEMBER_BACK_JACKPOT." (".$uid.")", $msg);
+ SEND_EMAIL($email, MEMBER_BACK_JACKPOT." (".$uid.")", $mailText);
} else {
// Add to jackpot
ADD_JACKPOT($PB);
// Free memory
SQL_FREERESULT($result_main);
+// Remove variable
+unset($mailText);
+
//
?>