]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-transfer.php
Fixes for rallye extension, refs are now no longer removed from rallye if ref was...
[mailer.git] / inc / modules / member / what-transfer.php
index b546599246076dd3a274b2fe2d1b28b080a6c0c3..7e00b7a188e522c376bf255df98fb7bc5d90ce65 100644 (file)
@@ -63,19 +63,10 @@ switch ($MODE)
 {
 case "new": // Start new transfer
        // Get total points and subtract the balance amount from it = maximum transferable points
-       $result = SQL_QUERY_ESC("SELECT SUM(points) FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND points > 0",
-        array($GLOBALS['userid']), __FILE__, __LINE__);
-       list($total) = SQL_FETCHROW($result);
-       SQL_FREERESULT($result);
-
-       // Get totally used points and password
-       $result = SQL_QUERY_ESC("SELECT used_points, password FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
-        array($GLOBALS['userid']), __FILE__, __LINE__);
-       list($used, $pass) = SQL_FETCHROW($result);
-       SQL_FREERESULT($result);
+       $total = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points")  - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
 
        // Remember maximum value for template
-       define('__TRANSFER_MAX_VALUE', round($total - $used - $_CONFIG['transfer_balance'] - 0.5));
+       define('__TRANSFER_MAX_VALUE', round($total - $_CONFIG['transfer_balance'] - 0.5));
 
        if (isset($_POST['ok']))
        {