$RECEIVERS = array($DATA['receivers']);
} else {
// No users left
- $RECEIVERS = array('0');
+ $RECEIVERS = array(0);
}
$dummy = $RECEIVERS;
// We can now send mails to them...
foreach ($RECEIVERS as $key => $userid) {
// Load personal data
- //* DEBUG: */ outputHtml("*L:".__LINE__.'/'.$userid."*<br />");
+ //* DEBUG: */ print("*L:".__LINE__.'/'.$userid."*<br />");
$result_user = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($userid)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_user) == 1) {
// The final receiver does exists so we can continue...
list($surname, $family, $email) = SQL_FETCHROW($result_user);
- //* DEBUG: */ outputHtml("OK!/L:".__LINE__."<br />");
+ //* DEBUG: */ print("OK!/L:".__LINE__."<br />");
// Mark this user as "spammed" ;-) And place a line for him...
if (removeReceiver($dummy, $key, $userid, $DATA['id'], $DATA['id'], true) == 'done') {
// Do we have send maximum mails?
if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == 0)) {
// Yes, we have
- //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__."<br />");
+ //* DEBUG: */ print("*EXIT/L:".__LINE__."<br />");
break;
} // END - if
} // END - if
// Update entry (or add missing
$P = $GLOBALS['pool_cnt'];
if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
- //* DEBUG: */ outputHtml("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
+ //* DEBUG: */ print("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
updateMediadataEntry(array("total_send", "bonus_send"), 'add', $P);
} // END - if
// Close sending system
- //* DEBUG: */ outputHtml("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
+ //* DEBUG: */ print("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
if (countSelection($dummy) == 0) {
// Queue reached!
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='SEND', `target_send`=0, `receivers`='' WHERE `id`=%s LIMIT 1",
array(bigintval($DATA['id'])), __FILE__, __LINE__);
- //* DEBUG: */ outputHtml("*L:".__LINE__."*<br />");
+ //* DEBUG: */ print("*L:".__LINE__."*<br />");
// Update mediadata if version is 0.0.4 or higher
if (getExtensionVersion('mediadata') >= '0.0.4') {
// Update entry (or add missing)
- //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
+ //* DEBUG: */ print("*MEDIA/L:".__LINE__."*<br />");
updateMediadataEntry(array("total_orders", "bonus_orders"), 'add', 1);
} // END - if
} elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
// Update bonus pool
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='NEW', `target_send`=%s, `receivers`='%s' WHERE `id`=%s LIMIT 1",
array(countSelection($dummy), implode(';', $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
- //* DEBUG: */ outputHtml("*L:".__LINE__."<pre>");
- //* DEBUG: */ outputHtml(print_r($dummy, true));
- //* DEBUG: */ outputHtml("</pre>\n!!!<br />");
+ //* DEBUG: */ print("*L:".__LINE__."<pre>");
+ //* DEBUG: */ print(print_r($dummy, true));
+ //* DEBUG: */ print("</pre>\n!!!<br />");
break;
}
}