}
// 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))
}
}
- // 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!
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 = "";
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]]++;
}
}
}
}
- 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))
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)
}
// 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 />";
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",