]> git.mxchange.org Git - mailer.git/blobdiff - inc/doubler_send.php
query masking rewritten in more SQLs, several cleanups and fix on beg link
[mailer.git] / inc / doubler_send.php
index c3ccc8dcf3c07df1a54d5371544a8e251acc7c93..a6ee2d0a49d8679894a50ba10d74cade267933a0 100644 (file)
@@ -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
@@ -132,9 +132,8 @@ if (((SQL_NUMROWS($result_total) > 0) && ($CONFIG['doubler_sent_all'] == '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;