X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fdoubler_send.php;h=a6ee2d0a49d8679894a50ba10d74cade267933a0;hp=374a8b19e4cc50097ddfe0f10991d6b8cad3a39d;hb=4d6226782aa4ba157dca8c3891412ba50159481f;hpb=75ad748a68473ace540251427a74fb781b1145e9 diff --git a/inc/doubler_send.php b/inc/doubler_send.php index 374a8b19e4..a6ee2d0a49 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -73,11 +73,11 @@ WHERE u.status='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed 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)) @@ -112,7 +112,7 @@ if (((SQL_NUMROWS($result_total) > 0) && ($CONFIG['doubler_sent_all'] == "Y")) | 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 @@ -129,12 +129,11 @@ if (((SQL_NUMROWS($result_total) > 0) && ($CONFIG['doubler_sent_all'] == "Y")) | $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;