ORDER BY d.timemark
LIMIT %s", array($DOUBLER_POINTS, $min, $CONFIG['doubler_max_sent']), __FILE__, __LINE__);
-if (((SQL_NUMROWS($result_total) > 0) && ($CONFIG['doubler_sent_all'] == "Y")) || ((SQL_NUMROWS($result_main) == $CONFIG['doubler_group_sent']) && ($CONFIG['doubler_sent_all'] == "N")))
+if (((SQL_NUMROWS($result_total) > 0) && ($CONFIG['doubler_sent_all'] == 'Y')) || ((SQL_NUMROWS($result_main) == $CONFIG['doubler_group_sent']) && ($CONFIG['doubler_sent_all'] == 'N')))
{
// Switch to matching SQL resource
$result_load = $result_main;
- if ((SQL_NUMROWS($result_total) > 0) && ($CONFIG['doubler_sent_all'] == "Y")) $result_load = $result_total;
+ if ((SQL_NUMROWS($result_total) > 0) && ($CONFIG['doubler_sent_all'] == 'Y')) $result_load = $result_total;
// At least one account was found
while(list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load))
if ($uid != $CONFIG['doubler_uid'])
{
// Add points
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s WHERE userid=%d AND ref_depth='0' LIMIT 1",
+ $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($uid)), __FILE__, __LINE__);
// Update mediadata as well
$OK = false;
// Check for jackpot inclusion in doubling process
- if (($jackpot > 0) && ($jackpot >= $points) && ($CONFIG['doubler_jackpot'] == "Y"))
+ if (($jackpot > 0) && ($jackpot >= $points) && ($CONFIG['doubler_jackpot'] == 'Y'))
{
// Subtract points from jackpot
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_jackpot SET points=points-%s WHERE ok='ok' LIMIT 1",
- array($points), __FILE__, __LINE__);
- $jackpot -= $jackpot;
+ SUB_JACKPOT($points);
+ $jackpot -= $points;
// Okay, done!
$OK = true;