]> git.mxchange.org Git - mailer.git/blobdiff - inc/pool/pool-user.php
RevBomb patch applied (thanks to profi-concept)
[mailer.git] / inc / pool / pool-user.php
index 96b1280cbde6e427871b06109c6158ed358bfd0a..1d9f2d62cffc3343141270991417f77971956dcf 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Sendet freigegebene Mitglieder-Mails aus Pool    *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision:: 856                                                    $ *
+ * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009)              $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author:: stelzi                                                   $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
@@ -38,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Don't run on daily reset
-if (defined('__DAILY_RESET')) {
+if (isResetModeEnabled()) {
        // Skip here
        return false;
 } elseif (!EXT_IS_ACTIVE("user")) {
@@ -47,8 +52,6 @@ if (defined('__DAILY_RESET')) {
 }
 
 // Need this here
-global $REPLACER;
-
 // Check for freed mail orders to send out
 if (EXT_IS_ACTIVE("html_mail")) {
        //                                0     1        2      3       4          5            6      7        8          9       10
@@ -59,7 +62,7 @@ if (EXT_IS_ACTIVE("html_mail")) {
 }
 
 // Reset variables
-$cnt2 = 0; $LAST_SENT_ID = 0; $cnt_back = array("0"); $pointsBack = array("0");
+$cnt2 = 0; $lastSentId = 0; $cnt_back = array("0"); $pointsBack = array("0");
 if (SQL_NUMROWS($result_main) > 0) {
        // Parse all mails
        while ($DATA = SQL_FETCHROW($result_main)) {
@@ -137,7 +140,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                        $DATA[14] = TRANSLATE_GENDER($gender);
 
                                                        // Replace text variables
-                                                       foreach ($REPLACER as $key => $value) {
+                                                       foreach ($GLOBALS['replacer'] as $key => $value) {
                                                                if (isset($DATA[$key])) $DATA[3] = str_replace($value, $DATA[$key], $DATA[3]);
                                                        } // END - if
 
@@ -189,8 +192,8 @@ if (SQL_NUMROWS($result_main) > 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])) {
+                                       //* DEBUG: */ echo "*L:".__LINE__."/".$GLOBALS['pool_cnt'].">=".$DATA[8]."/".getConfig('max_send').">=".$GLOBALS['pool_cnt']."/".$lastSentId."!=".$DATA[0]."*<br />";
+                                       if ((($GLOBALS['pool_cnt'] >= $DATA[8])) && ($lastSentId != $DATA[0])) {
                                                // Prepare content
                                                $content = array(
                                                        'sender_uid' => $DATA[1],
@@ -230,7 +233,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                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]; $GLOBALS['pool_cnt'] = 0;
+                                               $lastSentId = $DATA[0]; $GLOBALS['pool_cnt'] = 0;
                                                $cnt2 += $GLOBALS['pool_cnt'];
 
                                                // Update mediadata if version is 0.0.4 or higher
@@ -290,7 +293,7 @@ if (SQL_NUMROWS($result_main) > 0) {
        }
 
        // Do we have points to "pay back"?
-       if ((sizeof($pointsBack) > 0) && (!empty($pointsBack[0]))) {
+       if ((count($pointsBack) > 0) && (!empty($pointsBack[0]))) {
                // Walk through all points
                foreach ($pointsBack as $uid => $PB) {
                        // Add points only when we have points left to add and a valid user ID