}
// 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"); $pointsBack = array("0");
if (SQL_NUMROWS($result_main) > 0)
{
while ($DATA = SQL_FETCHROW($result_main))
{
if ($uid > 0)
{
- // User does not exists, pay points back
+ // User does exist so pay the points back
$points = GET_PAY_POINTS($DATA[5]);
$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s WHERE userid=%s AND ref_depth=0 LIMIT 1",
array($points, bigintval($DATA[1])), __FILE__, __LINE__);
}
// Add points together and remove user
- $points_BACK[$DATA[1]] += $points;
+ $pointsBack[$DATA[1]] += $points;
}
$cnt_back[$DATA[1]]++;
}
}
}
}
- if ((sizeof($points_BACK) > 0) && (!empty($points_BACK[0]))) {
- foreach ($points_BACK as $uid => $PB) {
+ if ((sizeof($pointsBack) > 0) && (!empty($pointsBack[0]))) {
+ foreach ($pointsBack as $uid => $PB) {
// Add points only when we have points left to add and a valid user ID
if (($PB > 0) && ($uid > 0)) {
// Prepare content