]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
Variable renamed, function refactured/moved:
[mailer.git] / inc / libs / user_functions.php
index 2a9dc34e84e4a148edb21b41243489bee3d41ffa..1e5bfa4d529be10ee504c66e164bd3ad8894e741 100644 (file)
@@ -123,7 +123,7 @@ function addSortLinks ($letter, $sortby, $colspan, $return=false) {
        } // END - foreach
 
        // Add list and colspan
-       $content['list'] = substr($OUT, 0, -13);
+       $content['list'] = substr($OUT, 0, -1);
        $content['colspan2'] = $colspan;
 
        // Load template
@@ -232,7 +232,7 @@ LIMIT 1",
 // @TODO Double-check configuration entry here
 function determineRandomReferalId () {
        // Default is zero refid
-       $refid = '0';
+       $refid = null;
 
        // Is the extension version fine?
        if (isExtensionInstalledAndNewer('user', '0.3.4')) {
@@ -253,8 +253,8 @@ function determineRandomReferalId () {
                                // Use that userid as new referal id
                                list($refid) = SQL_FETCHROW($result);
 
-                               // Reset this user's counter
-                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0 WHERE `userid`=%s LIMIT 1",
+                               // Reset all users, this makes this random referal id more challenging
+                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0",
                                        array($refid), __FUNCTION__, __LINE__);
                        } // END - if
 
@@ -339,7 +339,9 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                                $GLOBALS['bonus_payed'] = true;
 
                                // Subtract login bonus from userid's account or jackpot
-                               if ((isExtensionInstalledAndNewer('bonus', '0.3.5')) && (getConfig('bonus_mode') != 'ADD')) handleBonusPoints('login_bonus');
+                               if ((isExtensionInstalledAndNewer('bonus', '0.3.5')) && (getBonusMode() != 'ADD')) {
+                                       handleBonusPoints('login_bonus');
+                               } // END - if
                        } // END - if
 
                        // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
@@ -353,7 +355,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                                // Update database records
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `total_logins`=`total_logins`+1" . $add . " WHERE `userid`=%s LIMIT 1",
                                        array($userid), __FUNCTION__, __LINE__);
-                               if (SQL_AFFECTEDROWS() == 1) {
+                               if (!SQL_HASZEROAFFECTED()) {
                                        // Is a success URL set?
                                        if (empty($successUrl)) {
                                                // Procedure to checking for login data
@@ -581,7 +583,7 @@ LIMIT 1",
                        array($hash), __FILE__, __LINE__);
 
                // Was it updated?
-               if (SQL_AFFECTEDROWS() == 1) {
+               if (!SQL_HASZEROAFFECTED()) {
                        // Send email if updated
                        $message = loadEmailTemplate('confirm-member', $content, bigintval($userid));