X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fpool%2Fpool-user.php;h=51f76561207ac25654a6c0b17d91703012864982;hb=fd2b5907cc4a2f246b701d6acdbd3983d37c0a3f;hp=99e50f68452af90ff99e01cee3ab282f571615e6;hpb=7c9cf221f2f7ef99d45fc233bf346c9f9168ef3e;p=mailer.git diff --git a/inc/pool/pool-user.php b/inc/pool/pool-user.php index 99e50f6845..51f7656120 100644 --- a/inc/pool/pool-user.php +++ b/inc/pool/pool-user.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Sendet freigegebene Mitglieder-Mails aus Pool * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $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 - 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]."*
"; - 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]."*
"; + 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 @@ -301,7 +304,7 @@ if (SQL_NUMROWS($result_main) > 0) { ); // We have to pay back some points to the sender (we add them directly :-P) - $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); $DATA[10] = $PB; $DATA[11] = $cnt_back[$uid];