]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-wernis.php
Mailer used in many places, we still need a good 'selling' title
[mailer.git] / inc / modules / member / what-wernis.php
index 8eec7984815a7ec1312332fe13a1b236b0111ba3..8aa4a26c741d638e40af4b6a1eb44d09cb97426d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 04/12/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 04/12/2004 *
  * ================                             Last change: 11/16/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
@@ -66,10 +66,10 @@ $content = array(); $points = false;
 if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose')) {
        // Let the user choose what he wants to do
        $content['refid']    = getConfig(('wernis_refid'));
-       $content['wernis_userid'] = 0;
+       $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,19 +81,19 @@ 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;
                while ($data = SQL_FETCHARRAY($result)) {
                        // Prepare data for output
                        $rowContent = array(
-                               'stamp'    => generateDateTime($data['wernis_timestamp'], 2),
-                               'points'   => translateComma($data['wernis_amount']),
-                               'acc'      => bigintval($data['wernis_account']),
-                               'status'   => WERNIS_TRANSFER_STATUS($data['wernis_type']),
-                               'raw_type' => strtolower($data['wernis_type']),
-                               'sw'       => $SW,
+                               'wernis_timestamp' => generateDateTime($data['wernis_timestamp'], 2),
+                               'points'           => translateComma($data['wernis_amount']),
+                               'wernis_account'   => bigintval($data['wernis_account']),
+                               'status'           => WERNIS_TRANSFER_STATUS($data['wernis_type']),
+                               'raw_type'         => strtolower($data['wernis_type']),
+                               'sw'               => $SW,
                        );
 
                        // Load row template
@@ -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'));