X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fpool%2Fpool-bonus.php;h=139f1f5e7cfb21658dc6fcc888ea60cb4ea5e482;hp=6276de68290a22b048c95350d8d1a6663c92cd8a;hb=682edce003a1a91f66fb8e2212d7fdb591379843;hpb=e45e218c4f629ec63f0788cab231bfc88b3fa46e
diff --git a/inc/pool/pool-bonus.php b/inc/pool/pool-bonus.php
index 6276de6829..139f1f5e7c 100644
--- a/inc/pool/pool-bonus.php
+++ b/inc/pool/pool-bonus.php
@@ -14,8 +14,6 @@
* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009, 2010 by Mailer Developer Team *
@@ -65,7 +63,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
if (SQL_NUMROWS($result_bonus) > 0) {
// Send these mails away...
- $cnt2 = '';
+ $count2 = '';
while ($DATA = SQL_FETCHARRAY($result_bonus)) {
// Message is active in queue
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='QUEUE' WHERE `id`=%s LIMIT 1",
@@ -90,7 +88,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
// Load personal data
if (fetchUserData($userid)) {
// The final receiver does exists so we can continue...
- //* DEBUG: */ print("OK!/L:".__LINE__."
");
+ //* DEBUG: */ debugOutput('OK!/L:'.__LINE__);
// Mark this user as "spammed" ;-) And place a line for him...
if (removeReceiver($dummy, $key, $userid, $DATA['id'], $DATA['id'], true) == 'done') {
@@ -99,18 +97,8 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
if (isset($DATA[$key])) $DATA['text'] = str_replace($value, $DATA[$key], $DATA['text']);
} // END - foreach
- // Prepare content
- $content = array(
- 'id' => $DATA['id'],
- 'url' => $DATA['url'],
- 'time' => createFancyTime($DATA['time']),
- 'points' => translateComma($DATA['points']),
- 'category' => getCategory($DATA['cat_id']),
- 'text' => $DATA['text']
- );
-
// Prepare the mail
- $mailText = loadEmailTemplate('bonus-mail', $content, $userid);
+ $mailText = loadEmailTemplate('bonus-mail', $DATA, $userid);
// Send mail away
if (isset($DATA['html_msg'])) {
@@ -133,7 +121,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
// Do we have send maximum mails?
if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == 0)) {
// Yes, we have
- //* DEBUG: */ print("*EXIT/L:".__LINE__."
");
+ //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__);
break;
} // END - if
} // END - if
@@ -144,43 +132,61 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
// Update entry (or add missing
$P = $GLOBALS['pool_cnt'];
- if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
- //* DEBUG: */ print("+MEDIA/L:".__LINE__.'/'.$P."+
");
+ if (!empty($count2) && empty($GLOBALS['pool_cnt'])) $P = $count2;
+ //* DEBUG: */ debugOutput('+MEDIA/L:'.__LINE__.'/'.$P.'+');
updateMediadataEntry(array('total_send', 'bonus_send'), 'add', $P);
} // END - if
// Close sending system
- //* DEBUG: */ print("-L:".__LINE__.'/'.countSelection($dummy)."-
");
+ //* DEBUG: */ debugOutput('-L:'.__LINE__.'/'.countSelection($dummy).'-');
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: */ print("*L:".__LINE__."*
");
+ 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: */ debugOutput('*L:'.__LINE__.'*');
// Update mediadata if version is 0.0.4 or higher
if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
// Update entry (or add missing)
- //* DEBUG: */ print("*MEDIA/L:".__LINE__."*
");
+ //* DEBUG: */ debugOutput('*MEDIA/L:'.__LINE__.'*');
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: */ print("*L:".__LINE__."
"); - //* DEBUG: */ print(print_r($dummy, true)); - //* DEBUG: */ print("\n!!!
'.print_r($dummy, true).'!!!'); break; } - } - } + } // END - while + } // END - if // Free memory SQL_FREERESULT($result_bonus); // Remove variable unset($mailText); -} +} // END - if -// +// [EOF] ?>