]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-wernis.php
Primera fixed, primera/wernis extensions now use SUB_POINTS()
[mailer.git] / inc / modules / member / what-wernis.php
index ca832333d9e8352bccfe8f406c741a5b85b5db6b..5edf6ac7a63150580d7e1a47c9bf60ce46649fce 100644 (file)
@@ -197,9 +197,12 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) {
                                                $locked = false;
                                        }
 
-                                       // Remove the points from the account
-                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `used_points` = `used_points` + %s, `wernis_userid`=%s WHERE userid=%s LIMIT 1",
-                                               array(bigintval($_POST['amount']), bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__);
+                                       // Sub points
+                                       SUB_POINTS($GLOBALS['userid'], $_POST['amount']);
+
+                                       // Update WDS66 id
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
+                                               array(bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__);
 
                                        // All done!
                                        LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_PAYOUT_DONE);