]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
Referal system refactured (and some parts fixed), wrapper function introduced:
[mailer.git] / inc / libs / user_functions.php
index 18b0cd64c4c4682440ed318348a88aedaa7fbed9..827ee9c2c6c6218ae71f8479e59016be4eeb36c8 100644 (file)
@@ -43,8 +43,8 @@ if (!defined('__SECURITY')) {
 // Add links for selecting some users
 function alpha ($sortby, $colspan, $return=false) {
        if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', 0);
-       $add = '&page='.getRequestParameter('page').'&offset='.getRequestParameter('offset');
-       if (isGetRequestParameterSet('mode')) $add .= '&mode='.getRequestParameter('mode');
+       $add = '&page=' . getRequestParameter('page').'&offset=' . getRequestParameter('offset');
+       if (isGetRequestParameterSet('mode')) $add .= '&mode=' . getRequestParameter('mode');
 
        /* Creates the list of letters and makes them a link. */
        $alphabet = explode(',', 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,');
@@ -544,7 +544,7 @@ function insertUserStatsRecord ($userid, $statsType, $statsData) {
        // Does it exist?
        if ((!getEpocheTimeFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) {
                // Then insert it!
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats_data` (`userid`, `stats_type`, `stats_data`) VALUES (%s,'%s','%s')",
                        array(
                                bigintval($userid),
                                $statsType,
@@ -588,7 +588,6 @@ function doConfirmUserAccount ($hash) {
        `{?_MYSQL_PREFIX?}_user_data`
 SET
        `status`='CONFIRMED',
-       `ref_payout`={?ref_payout?},
        `user_hash`=NULL
 WHERE
        `user_hash`='%s' AND
@@ -622,9 +621,8 @@ LIMIT 1",
                                        } // END - if
 
                                        // Add one-time referal bonus over referal system or directly
-                                       // @TODO Try to rewrite the following unset()
-                                       unset($GLOBALS['ref_level']);
-                                       addPointsThroughReferalSystem('referal_bonus', $refid, getPointsRef(), true, bigintval($userid), getConfig('reg_points_mode'));
+                                       initReferalSystem();
+                                       addPointsThroughReferalSystem('referal_bonus', $refid, getPointsRef(), bigintval($userid));
                                } // END - if
                        } // END - if