]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-primera.php
Most <em> tags replaced/removed
[mailer.git] / inc / modules / member / what-primera.php
index 929169226f3c0b86a857db705d505330cc9296e5..d4ac40f02ee19664449bd8db59d06776a51f592f 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -64,14 +64,14 @@ $content = array();
 $points = false;
 
 // Is the mode set (payout only)
-if (!isGetRequestParameterSet('mode')) {
+if (!isGetRequestElementSet('mode')) {
        // Is there an id?
-       if ((!empty($content['primera_nickname'])) && (!isGetRequestParameterSet('mode'))) {
+       if ((!empty($content['primera_nickname'])) && (!isGetRequestElementSet('mode'))) {
                // Then use an other "mode"
-               setGetRequestParameter('mode', 'list');
+               setGetRequestElement('mode', 'list');
 
                // 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",
+               $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(getMemberId()), __FILE__, __LINE__);
 
                // Load all rows
@@ -88,11 +88,11 @@ if (!isGetRequestParameterSet('mode')) {
                SQL_FREERESULT($result);
        } else {
                // Mode pay
-               setGetRequestParameter('mode', 'pay');
+               setGetRequestElement('mode', 'pay');
        }
 } // END - if
 
-if (getRequestParameter('mode') == 'pay') {
+if (getRequestElement('mode') == 'pay') {
        // Get total points and check if the user can request a payout
        $points = getTotalPoints(getMemberId());
 
@@ -114,53 +114,53 @@ if (getRequestParameter('mode') == 'pay') {
        $content['points'] = $points;
 } else {
        // Invalid mode!
-       displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestParameter('mode') . '%}');
+       displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestElement('mode') . '%}');
        return;
 }
 
 // Is the formular sent?
-if ((isFormSent()) && (isGetRequestParameterSet('mode'))) {
+if ((isFormSent()) && (isGetRequestElementSet('mode'))) {
        // Check input data depending on the mode and execute the requested mode
-       switch (getRequestParameter('mode')) {
+       switch (getRequestElement('mode')) {
                case 'pay': // Payout this exchange -> Primus
                        // Is the user id and password set?
-                       if (!isPostRequestParameterSet('primera_nickname')) {
+                       if (!isPostRequestElementSet('primera_nickname')) {
                                // Nothing entered in Primus nickname
                                displayMessage('{--MEMBER_PRIMERA_EMPTY_USERNAME--}');
-                       } elseif (!isPostRequestParameterSet('primera_password')) {
+                       } elseif (!isPostRequestElementSet('primera_password')) {
                                // Nothing entered in Primera password
                                displayMessage('{--MEMBER_PRIMERA_EMPTY_PASSWORD--}');
-                       } elseif (!isPostRequestParameterSet('amount')) {
+                       } elseif (!isPostRequestElementSet('amount')) {
                                // Nothing entered in amount
                                displayMessage('{--MEMBER_PRIMERA_EMPTY_AMOUNT--}');
-                       } elseif (postRequestParameter('amount') != bigintval(postRequestParameter('amount'))) {
+                       } elseif (postRequestElement('amount') != bigintval(postRequestElement('amount'))) {
                                // Only numbers in amount!
                                displayMessage('{--MEMBER_PRIMERA_INVALID_AMOUNT--}');
-                       } elseif (postRequestParameter('amount') < getConfig('primera_min_payout')) {
+                       } elseif (postRequestElement('amount') < getConfig('primera_min_payout')) {
                                // Not enougth entered!
                                displayMessage('{--MEMBER_PRIMERA_AMOUNT_SMALLER_MIN--}');
-                       } elseif (postRequestParameter('amount') > $points) {
+                       } elseif (postRequestElement('amount') > $points) {
                                // Not enougth points left!
-                               displayMessage(sprintf(getMessage('MEMBER_PRIMERA_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestParameter('amount')), bigintval($points)));
+                               displayMessage(sprintf(getMessage('MEMBER_PRIMERA_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestElement('amount')), bigintval($points)));
                        } else {
                                // All is fine here so do the payout
-                               $success = executePrimeraPayout(postRequestParameter('primera_nickname'), md5(postRequestParameter('primera_password')), postRequestParameter('amount'));
+                               $success = executePrimeraPayout(postRequestElement('primera_nickname'), md5(postRequestElement('primera_password')), postRequestElement('amount'));
                                if ($success) {
                                        // Default is locked!
                                        $locked = true;
 
-                                       // Shall I 'pay' the referal points imidiately?
+                                       // Shall I 'pay' the referral points imidiately?
                                        if (getConfig('ref_payout') == '0') {
                                                // Yes, 'pay' it now
                                                $locked = false;
                                        } // END - if
 
-                                       // Remove points from account
-                                       subtractPoints('primera_payout', getMemberId(), postRequestParameter('amount'));
+                                       // Subtract points from account and ignore return status
+                                       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(postRequestParameter('primera_nickname'), getMemberId()), __FILE__, __LINE__);
+                                               array(postRequestElement('primera_nickname'), getMemberId()), __FILE__, __LINE__);
 
                                        // All done!
                                        displayMessage('{--MEMBER_PRIMERA_PAYOUT_DONE--}');
@@ -176,14 +176,14 @@ if ((isFormSent()) && (isGetRequestParameterSet('mode'))) {
                        break;
 
                default: // Invalid mode!
-                       logDebugMessage(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", getRequestParameter('mode')));
-                       displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestParameter('mode') . '%}');
+                       logDebugMessage(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", getRequestElement('mode')));
+                       displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestElement('mode') . '%}');
                        return;
        }
 } // END - if
 
 // Prepare mode for template name
-$mode = sprintf("member_primera_mode_%s", getRequestParameter('mode'));
+$mode = sprintf("member_primera_mode_%s", getRequestElement('mode'));
 
 // Load the template
 loadTemplate($mode, false, $content);