Deprecated variables for templates removed, mor EL-rewrites, getMessage() rewritten:
[mailer.git] / inc / modules / member / what-wernis.php
index a4bb4d0271a1ed3179c73c3ca13330c74025d47f..4729c81f1de3cd656f1efcb93709c5032ab9a716 100644 (file)
@@ -56,7 +56,7 @@ if ((!isExtensionActive('wernis')) && (!isAdmin())) {
 // Check if the admin has entered the data
 if ((getConfig('wernis_api_id') == '') || (getConfig('wernis_api_md5') == '')) {
        // Something important is missing...
-       loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_API_DATA_MISSING'));
+       loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_API_DATA_MISSING--}');
        return;
 } // END - if
 
@@ -75,7 +75,7 @@ if ((!isGetRequestParameterSet('mode')) || (getRequestParameter('mode') == 'choo
                setGetRequestParameter('mode', 'list');
 
                // 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",
+               $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(getMemberId()), __FILE__, __LINE__);
 
                // Load all rows
@@ -84,10 +84,9 @@ if ((!isGetRequestParameterSet('mode')) || (getRequestParameter('mode') == 'choo
                        // Prepare data for output
                        $rowContent = array(
                                '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']),
+                               'wernis_amount'    => $data['wernis_amount'],
+                               'wernis_account'   => $data['wernis_account'],
+                               'wernis_type'      => $data['wernis_type'],
                                'sw'               => $SW,
                        );
 
@@ -106,13 +105,13 @@ if ((!isGetRequestParameterSet('mode')) || (getRequestParameter('mode') == 'choo
                // Is the payout mode active?
                if (getConfig('wernis_payout_active') == 'Y') {
                        // Add link
-                       $content['payout_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"{%url=modules.php?module=login&amp;what=wernis&amp;mode=payout%}\"><div style=\"padding-top: 10px\">{--MEMBER_WERNIS_MODE_PAYOUT--}</div></a>";
+                       $content['payout_link'] = '<a class="menu_blur" style="height: 40px" href="{%url=modules.php?module=login&amp;what=wernis&amp;mode=payout%}"><div style="padding-top: 10px">{--MEMBER_WERNIS_MODE_PAYOUT--}</div></a>';
                } // END - if
 
                // Is the withdraw mode active?
                if (getConfig('wernis_withdraw_active') == 'Y') {
                        // Add link
-                       $content['withdraw_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"{%url=modules.php?module=login&amp;what=wernis&amp;mode=withdraw%}\"><div style=\"padding-top: 10px\">{--MEMBER_WERNIS_MODE_WITHDRAW--}</div></a>";
+                       $content['withdraw_link'] = '<a class="menu_blur" style="height: 40px" href="{%url=modules.php?module=login&amp;what=wernis&amp;mode=withdraw%}"><div style="padding-top: 10px">{--MEMBER_WERNIS_MODE_WITHDRAW--}</div></a>';
                } // END - if
 
                // Mode chooser! ;-)
@@ -172,26 +171,26 @@ if ((isFormSent()) && (isGetRequestParameterSet('mode'))) {
        // Is the user id and password set?
        if (!isPostRequestParameterSet(('wernis_userid'))) {
                // Nothing entered in WDS66 user id
-               loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_EMPTY_USERNAME'));
+               loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_EMPTY_USERNAME--}');
        } elseif (!isPostRequestParameterSet(('wds66_password'))) {
                // Nothing entered in WDS66 password
-               loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_EMPTY_PASSWORD'));
+               loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_EMPTY_PASSWORD--}');
        } elseif (!isPostRequestParameterSet(('amount'))) {
                // Nothing entered in amount
-               loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_EMPTY_AMOUNT'));
+               loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_EMPTY_AMOUNT--}');
        } elseif (postRequestParameter('wernis_userid') != bigintval(postRequestParameter('wernis_userid'))) {
                // Only numbers in account id!
-               loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_INVALID_USERNAME'));
+               loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_INVALID_USERNAME');
        } elseif (postRequestParameter('amount') != bigintval(postRequestParameter('amount'))) {
                // Only numbers in amount!
-               loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_INVALID_AMOUNT'));
+               loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_INVALID_AMOUNT--}');
        } else {
                // Check input data depending on the mode and execute the requested mode
                switch (getRequestParameter('mode')) {
                        case 'withdraw': // Widthdraws WDS66 -> This exchange
                                if (postRequestParameter('amount') < getConfig('wernis_min_withdraw')) {
                                        // Not enougth entered!
-                                       loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_WITHDRAW_AMOUNT_SMALLER_MIN'));
+                                       loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_WITHDRAW_AMOUNT_SMALLER_MIN--}');
                                } else {
                                        // All is fine here so do the withdraw
                                        $success = WERNIS_EXECUTE_WITHDRAW(postRequestParameter('wernis_userid'), md5(postRequestParameter('wds66_password')), postRequestParameter('amount'));
@@ -204,7 +203,7 @@ if ((isFormSent()) && (isGetRequestParameterSet('mode'))) {
                                                        array(bigintval(postRequestParameter('wernis_userid')), getMemberId()), __FILE__, __LINE__);
 
                                                // All done!
-                                               loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_WITHDRAW_DONE'));
+                                               loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_WITHDRAW_DONE--}');
                                                return;
                                        } elseif ((GET_WERNIS_ERROR_CODE() == 'user_failed') || (GET_WERNIS_ERROR_CODE() == 'own_failed') || (GET_WERNIS_ERROR_CODE() == 'amount_failed')) {
                                                // Wrong login data
@@ -219,7 +218,7 @@ if ((isFormSent()) && (isGetRequestParameterSet('mode'))) {
                        case 'payout': // Payout this exchange -> WDS66
                                if (postRequestParameter('amount') < getConfig('wernis_min_payout')) {
                                        // Not enougth entered!
-                                       loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_PAYOUT_AMOUNT_SMALLER_MIN'));
+                                       loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_PAYOUT_AMOUNT_SMALLER_MIN--}');
                                } elseif (postRequestParameter('amount') > $points) {
                                        // Not enougth points left!
                                        loadTemplate('admin_settings_saved', false, sprintf(getMessage('MEMBER_WERNIS_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestParameter('amount')), bigintval($points)));
@@ -235,7 +234,7 @@ if ((isFormSent()) && (isGetRequestParameterSet('mode'))) {
                                                        array(bigintval(postRequestParameter('wernis_userid')), getMemberId()), __FILE__, __LINE__);
 
                                                // All done!
-                                               loadTemplate('admin_settings_saved', false, getMessage('MEMBER_WERNIS_PAYOUT_DONE'));
+                                               loadTemplate('admin_settings_saved', false, '{--MEMBER_WERNIS_PAYOUT_DONE--}');
                                                return;
                                        } elseif ((GET_WERNIS_ERROR_CODE() == 'user_failed') || (GET_WERNIS_ERROR_CODE() == 'own_failed') || (GET_WERNIS_ERROR_CODE() == 'amount_failed') || (GET_WERNIS_ERROR_CODE() == 'api_amount_failed')) {
                                                // Wrong login data