- $UIDs = "";
- while(list($uid, $email, $points) = SQL_FETCHROW($result_main))
- {
- // Add userids in a row
- $UIDs .= ",'".$uid."'";
-
- // Add points to user's account directly
- ADD_POINTS_REFSYSTEM($uid, $points, false, "0", false, "direct");
-
- // Load email template and email it away
- $msg = LOAD_EMAIL_TEMPLATE("member_bonus", $points, bigintval($uid));
- SEND_EMAIL($email, BONUS_MONTHLY_ONLINE_BONUS, $msg);
- }
+ while ($content = SQL_FETCHARRAY($result_main)) {
+ // Make sure zero points are not mailed
+ if ($content['points'] > 0) {
+ // Add points to user's account directly
+ ADD_POINTS_REFSYSTEM($content['uid'], $content['points'], false, "0", false, "direct");