]> git.mxchange.org Git - mailer.git/blobdiff - inc/pool/pool-bonus.php
Now total received mails are reduced if no entry in user_stats_data is found
[mailer.git] / inc / pool / pool-bonus.php
index 602820c88c6109769a1043b948ede3ed7bf77626..6baa5b7705d1b567bb09f23b13274ebc5eb00802 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 12/12/2008 *
- * ===============                              Last change: 12/12/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 12/12/2008 *
+ * ===================                          Last change: 12/12/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : pool-bonus.php                                   *
@@ -73,19 +73,19 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                        // "Explode" all receivers into an array
                        if (ereg(';', $DATA['receivers'])) {
                                // There's more than one receiver in the list...
-                               $RECEIVERS = explode(';', $DATA['receivers']);
+                               $receiverS = explode(';', $DATA['receivers']);
                        } elseif (!empty($DATA['points'])) {
                                // Only one user left
-                               $RECEIVERS = array($DATA['receivers']);
+                               $receiverS = array($DATA['receivers']);
                        } else {
                                // No users left
-                               $RECEIVERS = array(0);
+                               $receiverS = array(0);
                        }
-                       $dummy = $RECEIVERS;
+                       $dummy = $receiverS;
 
-                       // Now, if we are good little boys and girls Santa left us some user-ids.
+                       // Now, if we are good little boys and girls Santa Claus left us some user-ids.
                        // We can now send mails to them...
-                       foreach ($RECEIVERS as $key => $userid) {
+                       foreach ($receiverS as $key => $userid) {
                                // Load personal data
                                if (fetchUserData($userid)) {
                                        // The final receiver does exists so we can continue...
@@ -125,7 +125,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
 
                                                if (getExtensionVersion('user') >= '0.1.4') {
                                                        // Update mails received for receiver
-                                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET emails_received=emails_received+1 WHERE `userid`=%s LIMIT 1",
+                                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `emails_received`=`emails_received`+1 WHERE `userid`=%s LIMIT 1",
                                                        array(bigintval($userid)), __FILE__, __LINE__);
                                                } // END - if
 
@@ -145,7 +145,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                $P = $GLOBALS['pool_cnt'];
                                if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
                                //* DEBUG: */ print("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
-                               updateMediadataEntry(array("total_send", "bonus_send"), 'add', $P);
+                               updateMediadataEntry(array('total_send', 'bonus_send'), 'add', $P);
                        } // END - if
 
                        // Close sending system
@@ -160,7 +160,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                if (getExtensionVersion('mediadata') >= '0.0.4') {
                                        // Update entry (or add missing)
                                        //* DEBUG: */ print("*MEDIA/L:".__LINE__."*<br />");
-                                       updateMediadataEntry(array("total_orders", "bonus_orders"), 'add', 1);
+                                       updateMediadataEntry(array('total_orders', 'bonus_orders'), 'add', 1);
                                } // END - if
                        } elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
                                // Update bonus pool