]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-wernis.php
Naming inconsistencies for userid fixed
[mailer.git] / inc / modules / member / what-wernis.php
index 8eec7984815a7ec1312332fe13a1b236b0111ba3..2006833362a2c715b87b0115b3b7459209c867dc 100644 (file)
@@ -69,7 +69,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose')
        $content['wernis_userid'] = 0;
 
        // Are there some entries?
-       if (fetchUserData(getUserId())) {
+       if (fetchUserData(getMemberId())) {
                // Fetch id
                $content['wernis_userid'] = getUserData('wernis_userid');
        } // END - if
@@ -81,7 +81,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose')
 
                // And load all rows!
                $result = SQL_QUERY_ESC("SELECT `id`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type` FROM `{?_MYSQL_PREFIX?}_user_wernis` WHERE `userid`=%s ORDER BY `wernis_timestamp` DESC",
-                       array(getUserId()), __FILE__, __LINE__);
+                       array(getMemberId()), __FILE__, __LINE__);
 
                // Load all rows
                $content['rows'] = ''; $SW = 2;
@@ -125,7 +125,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose')
        }
 } elseif ((getRequestElement('mode') == 'payout') && (getConfig('wernis_payout_active') == 'Y')) {
        // Get total points and check if the user can request a payout
-       $points = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points');
+       $points = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');
 
        // Remove the registration fee
        $points = $points - getConfig('points_register');
@@ -159,13 +159,13 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose')
        $content['wernis_userid'] = '';
 
        // Are there some entries?
-       if (fetchUserData(getUserId())) {
+       if (fetchUserData(getMemberId())) {
                // Fetch id
                $content['wernis_userid'] = getUserData('wernis_userid');
        } // END - if
 } elseif ((getRequestElement('mode') == 'withdraw') && (getConfig('wernis_withdraw_active') == 'Y')) {
        // Get total points for just displaying them
-       $points = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points');
+       $points = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');
 
        // Prepare data for the template
        $content['points']        = translateComma($points);
@@ -176,7 +176,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose')
        WERNIS_ADD_FEES_TO_ARRAY($content);
 
        // Get WDS66 id
-       if (fetchUserData(getUserId())) {
+       if (fetchUserData(getMemberId())) {
                // Fetch id
                $content['wernis_userid'] = getUserData('wernis_userid');
        } // END - if
@@ -216,11 +216,11 @@ if ((isFormSent()) && (isGetRequestElementSet('mode'))) {
                                        $success = WERNIS_EXECUTE_WITHDRAW(postRequestElement('wernis_userid'), md5(postRequestElement('wds66_password')), postRequestElement('amount'));
                                        if ($success === true) {
                                                // Add it to this amount
-                                               addPointsDirectly('wernis_withdraw', getUserId(), bigintval(postRequestElement('amount')));
+                                               addPointsDirectly('wernis_withdraw', getMemberId(), bigintval(postRequestElement('amount')));
 
                                                // Update the user data as well..
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `wernis_userid`=%s WHERE `userid`=%s LIMIT 1",
-                                                       array(bigintval(postRequestElement('wernis_userid')), getUserId()), __FILE__, __LINE__);
+                                                       array(bigintval(postRequestElement('wernis_userid')), getMemberId()), __FILE__, __LINE__);
 
                                                // All done!
                                                loadTemplate('admin_settings_saved', false, getMessage('WERNIS_MEMBER_WITHDRAW_DONE'));
@@ -247,11 +247,11 @@ if ((isFormSent()) && (isGetRequestElementSet('mode'))) {
                                        $success = WERNIS_EXECUTE_PAYOUT(postRequestElement('wernis_userid'), postRequestElement('amount'));
                                        if ($success === true) {
                                                // Sub points
-                                               subtractPoints('wernis_payout', getUserId(), postRequestElement('amount'));
+                                               subtractPoints('wernis_payout', getMemberId(), postRequestElement('amount'));
 
                                                // Update WDS66 id
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `wernis_userid`=%s WHERE `userid`=%s LIMIT 1",
-                                                       array(bigintval(postRequestElement('wernis_userid')), getUserId()), __FILE__, __LINE__);
+                                                       array(bigintval(postRequestElement('wernis_userid')), getMemberId()), __FILE__, __LINE__);
 
                                                // All done!
                                                loadTemplate('admin_settings_saved', false, getMessage('WERNIS_MEMBER_PAYOUT_DONE'));