]> git.mxchange.org Git - mailer.git/blobdiff - inc/pool/pool-bonus.php
Introduced new wrapper functions to make the code more readable, new extension ext...
[mailer.git] / inc / pool / pool-bonus.php
index 66c350fdf146f561849b0d10a445da6b50d3522f..d904d52758b135fc7c2b0b800601fac29dea639c 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                                   *
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -71,21 +72,21 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                array(bigintval($DATA['id'])), __FILE__, __LINE__);
 
                        // "Explode" all receivers into an array
-                       if (ereg(';', $DATA['receivers'])) {
+                       if (isInString(';', $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 +126,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 +146,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 +161,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