wernis extension is now alpha code (only listing in admin area is missing), naming...
[mailer.git] / inc / pool-update.php
index fc71a8ae81f281e9cf156b54fde61c7421895554..9949cc9e16542aff62f515d3ad6e6bcd6b650411 100644 (file)
@@ -54,7 +54,7 @@ if ($HTML_EXT)
 }
 
 // Reset variables
-$cnt = "0"; $cnt2 = "0"; $LAST_SENT_ID = "0"; $cnt_back = array("0"); $POINTS_BACK = array("0");
+$cnt = "0"; $cnt2 = "0"; $LAST_SENT_ID = "0"; $cnt_back = array("0"); $points_BACK = array("0");
 if (SQL_NUMROWS($result_main) > 0)
 {
        while ($DATA = SQL_FETCHROW($result_main))
@@ -179,8 +179,8 @@ if (SQL_NUMROWS($result_main) > 0)
                                                }
                                        }
 
-                                       // Do we have reached the maximum to send mails? || ($CONFIG['max_send'] >= $cnt)
-                                       //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".$CONFIG['max_send'].">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*<br />";
+                                       // Do we have reached the maximum to send mails? || ($_CONFIG['max_send'] >= $cnt)
+                                       //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".$_CONFIG['max_send'].">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*<br />";
                                        if ((($cnt >= $DATA[8])) && ($LAST_SENT_ID != $DATA[0]))
                                        {
                                                // Yes we do, so we notify admin and sender about fully sent mail!
@@ -232,7 +232,7 @@ if (SQL_NUMROWS($result_main) > 0)
                                                break;
                                        }
                                        // Do we have send maximum mails?
-                                        elseif (($cnt >= $CONFIG['max_send']) || ($cnt2 >= $CONFIG['max_send']))
+                                        elseif (($cnt >= $_CONFIG['max_send']) || ($cnt2 >= $_CONFIG['max_send']))
                                        {
                                                // There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
                                                $ADD = "";
@@ -258,20 +258,20 @@ if (SQL_NUMROWS($result_main) > 0)
                                                if ($uid > 0)
                                                {
                                                        // User does not exists, pay points back
-                                                       $POINTS = GET_PAY_POINTS($DATA[5]);
+                                                       $points = GET_PAY_POINTS($DATA[5]);
                                                        $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s WHERE userid=%d AND ref_depth=0 LIMIT 1",
-                                                        array($POINTS, bigintval($DATA[1])), __FILE__, __LINE__);
+                                                        array($points, bigintval($DATA[1])), __FILE__, __LINE__);
 
                                                        // Update mediadata as well
                                                        if (GET_EXT_VERSION("mediadata") >= "0.0.4")
                                                        {
                                                                // Update database
-                                                               //* DEBUG: */ echo "*MEDIA/L:".__LINE__."/".$POINTS."*<br />";
-                                                               MEDIA_UPDATE_ENTRY(array("total_points"), "add", $POINTS);
+                                                               //* DEBUG: */ echo "*MEDIA/L:".__LINE__."/".$points."*<br />";
+                                                               MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points);
                                                        }
 
                                                        // Add points together and remove user
-                                                       $POINTS_BACK[$DATA[1]] += $POINTS;
+                                                       $points_BACK[$DATA[1]] += $points;
                                                }
                                                $cnt_back[$DATA[1]]++;
                                        }
@@ -285,9 +285,9 @@ if (SQL_NUMROWS($result_main) > 0)
                        }
                }
        }
-       if ((sizeof($POINTS_BACK) > 0) && (!empty($POINTS_BACK[0])))
+       if ((sizeof($points_BACK) > 0) && (!empty($points_BACK[0])))
        {
-               foreach ($POINTS_BACK as $uid=>$PB)
+               foreach ($points_BACK as $uid=>$PB)
                {
                        // Add points only when we have points left to add and a valid user ID
                        if (($PB > 0) && ($uid > 0))
@@ -331,7 +331,7 @@ if (SQL_NUMROWS($result_main) > 0)
 SQL_FREERESULT($result_main);
 
 // Only send bonus mail when bonus extension is active and maximum send-mails is not reached
-if ((EXT_IS_ACTIVE("bonus") && ($cnt < $CONFIG['max_send'])))
+if ((EXT_IS_ACTIVE("bonus") && ($cnt < $_CONFIG['max_send'])))
 {
        // Do we need to send out bonus mails?
        if ($HTML_EXT)
@@ -412,7 +412,7 @@ if ((EXT_IS_ACTIVE("bonus") && ($cnt < $CONFIG['max_send'])))
                                                }
 
                                                // Do we have send maximum mails?
-                                               if (($cnt >= $CONFIG['max_send']) || (SELECTION_COUNT($DUMMY) == 0))
+                                               if (($cnt >= $_CONFIG['max_send']) || (SELECTION_COUNT($DUMMY) == 0))
                                                {
                                                        // Yes, we have
                                                        //* DEBUG: */ echo "*EXIT/L:".__LINE__."<br />";
@@ -452,7 +452,7 @@ if ((EXT_IS_ACTIVE("bonus") && ($cnt < $CONFIG['max_send'])))
                                        MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders"), "add", 1);
                                }
                        }
-                        elseif ($cnt >= $CONFIG['max_send'])
+                        elseif ($cnt >= $_CONFIG['max_send'])
                        {
                                // Update bonus pool
                                $result_done = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='NEW', target_send=%d, receivers='%s' WHERE id=%d LIMIT 1",