]> git.mxchange.org Git - mailer.git/blobdiff - inc/pool-update.php
Another column fix
[mailer.git] / inc / pool-update.php
index 509e04b75461a3cbf8ac9de61426bbc8cf865d36..6f1fc8f9f90a89988d918316f2dd3c3d0c574254 100644 (file)
@@ -117,7 +117,7 @@ if (SQL_NUMROWS($result_main) > 0)
                                        if (SQL_NUMROWS($result_stats) == 0)
                                        {
                                                // No entry was found, so we add him!
-                                               $result_stats = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_stats (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' , UNIX_TIMESTAMP())",
+                                               $result_stats = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_stats (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
                                                 array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[9]), bigintval($DATA[5]), $DATA[2], $DATA[7], $DATA[8], bigintval($DATA[6])), __FILE__, __LINE__);
 
                                                // Receive it's ID for the links table
@@ -275,16 +275,7 @@ if (SQL_NUMROWS($result_main) > 0)
                                                {
                                                        // User does not exists, pay 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__);
-
-                                                       // Update mediadata as well
-                                                       if (GET_EXT_VERSION("mediadata") >= "0.0.4")
-                                                       {
-                                                               // Update database
-                                                               //* DEBUG: */ echo "*MEDIA/L:".__LINE__."/".$points."*<br />";
-                                                               MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points);
-                                                       }
+                                                       ADD_POINTS_REFSYSTEM($DATA[1], $points, false, "0", false, "direct");
 
                                                        // Add points together and remove user
                                                        $points_BACK[$DATA[1]] += $points;