]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-primera.php
Comments fixed, ext-network continued, fix for mod stats:
[mailer.git] / inc / modules / member / what-primera.php
index b602530b3bace7210e1108e8a79229f734af06da..2a1322dbee11f5106ae0d3a870aa66bec457b8d9 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 09/09/2008 *
- * ================                             Last change: 09/09/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 09/09/2008 *
+ * ===================                          Last change: 09/09/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-primera.php                                 *
@@ -70,7 +70,7 @@ if (!isGetRequestElementSet('mode')) {
        $content['refid'] = getConfig(('primera_refid'));
 
        // Are there some entries?
-       if (fetchUserData(getUserId())) {
+       if (fetchUserData(getMemberId())) {
                // Fetch id
                $content['primera_nickname'] = getUserData('primera_nickname');
        } // END - if
@@ -82,19 +82,19 @@ if (!isGetRequestElementSet('mode')) {
 
                // And load all rows!
                $result = SQL_QUERY_ESC("SELECT `id`,`primera_account`,`primera_amount`,`primera_timestamp`,`primera_type` FROM `{?_MYSQL_PREFIX?}_user_primera` WHERE `userid`=%s ORDER BY `primera_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['primera_timestamp'], 2),
-                               'points'                => translateComma($data['primera_amount']),
-                               'acc'           => SQL_ESCAPE($data['primera_account']),
-                               'status'                => PRIMERA_TRANSFER_STATUS($data['primera_type']),
-                               'raw_type'      => strtolower($data['primera_type']),
-                               'sw'                    => $SW,
+                               'primera_timestamp' => generateDateTime($data['primera_timestamp'], 2),
+                               'points'            => translateComma($data['primera_amount']),
+                               'primera_account'   => SQL_ESCAPE($data['primera_account']),
+                               'status'            => PRIMERA_TRANSFER_STATUS($data['primera_type']),
+                               'raw_type'          => strtolower($data['primera_type']),
+                               'sw'                => $SW,
                        );
 
                        // Load row template
@@ -112,7 +112,7 @@ if (!isGetRequestElementSet('mode')) {
 
 if (getRequestElement('mode') == 'pay') {
        // 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');
 
        // No dots here...
        $points = explode('.', $points);
@@ -136,7 +136,7 @@ if (getRequestElement('mode') == 'pay') {
        $content['primera_nickname'] = '';
 
        // Do we have a user account? (should be!)
-       if (fetchUserData(getUserId())) {
+       if (fetchUserData(getMemberId())) {
                // Fetch id
                $content['primera_nickname'] = getUserData('primera_nickname');
        } // END - if
@@ -178,17 +178,17 @@ if ((isFormSent()) && (isGetRequestElementSet('mode'))) {
                                        $locked = true;
 
                                        // Shall I 'pay' the referal points imidiately?
-                                       if (getConfig('ref_payout') == 0) {
+                                       if (getConfig('ref_payout') == '0') {
                                                // Yes, 'pay' it now
                                                $locked = false;
                                        } // END - if
 
                                        // Remove points from account
-                                       subtractPoints('primera_payout', getUserId(), postRequestElement('amount'));
+                                       subtractPoints('primera_payout', getMemberId(), postRequestElement('amount'));
 
                                        // Update primera nickname
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `primera_nickname`=%s WHERE `userid`=%s LIMIT 1",
-                                               array(postRequestElement('primera_nickname'), getUserId()), __FILE__, __LINE__);
+                                               array(postRequestElement('primera_nickname'), getMemberId()), __FILE__, __LINE__);
 
                                        // All done!
                                        loadTemplate('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_PAYOUT_DONE'));