]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-wernis.php
Rewrite from stelzi implemented, variable and function name renamed to match with...
[mailer.git] / inc / modules / member / what-wernis.php
index 750ef03e2f602df07aff51f9bf86e32668805f42..9e5768ee17a9bafe2b2e7f74601194584dff72aa 100644 (file)
@@ -42,9 +42,9 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // User is not logged in
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('wernis')) && (!IS_ADMIN())) {
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'wernis');
+       addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'wernis'));
        return;
 }
 
@@ -52,7 +52,7 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('member', __FILE__);
 
 // Check if the admin has entered the data
-if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) {
+if ((getConfig('wernis_api_id') == '') || (getConfig('wernis_api_md5') == '')) {
        // Something important is missing...
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_API_DATA_MISSING'));
        return;
@@ -94,8 +94,8 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
                while ($data = SQL_FETCHARRAY($result)) {
                        // Prepare data for output
                        $rowContent = array(
-                               'stamp'    => MAKE_DATETIME($data['wernis_timestamp'], "2"),
-                               'points'   => TRANSLATE_COMMA($data['wernis_amount']),
+                               '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']),
@@ -142,17 +142,17 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        // Is this enougth for a payout?
        if ($points < getConfig('wernis_min_payout')) {
                // No, then abort here
-               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MIN_PAYOUT'), TRANSLATE_COMMA(getConfig('wernis_min_payout'))));
+               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MIN_PAYOUT'), translateComma(getConfig('wernis_min_payout'))));
                return;
        } // END - if
 
        // No dots here...
-       $points = explode(".", $points);
+       $points = explode('.', $points);
        $points = bigintval($points[0]);
 
        // Add points to content array
-       $content['points']     = TRANSLATE_COMMA($points);
-       $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_payout'));
+       $content['points']     = translateComma($points);
+       $content['min_points'] = translateComma(getConfig('wernis_min_payout'));
 
        // Add fees to array
        WERNIS_ADD_FEES_TO_ARRAY($content);
@@ -175,8 +175,8 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        $points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
 
        // Prepare data for the template
-       $content['points']     = TRANSLATE_COMMA($points);
-       $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_withdraw'));
+       $content['points']     = translateComma($points);
+       $content['min_points'] = translateComma(getConfig('wernis_min_withdraw'));
        $content['wds66_id']   = '';
 
        // Add fees to array
@@ -231,7 +231,7 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET(('mode')))) {
                                        if ($success) {
                                                // Add it to this amount
                                                unset($GLOBALS['ref_level']);
-                                               ADD_POINTS_REFSYSTEM("wernis_withdraw", getUserId(), bigintval(REQUEST_POST('amount')), false, 0, false, "direct");
+                                               ADD_POINTS_REFSYSTEM_DIRECT('wernis_withdraw', getUserId(), bigintval(REQUEST_POST('amount')));
 
                                                // Update the user data as well..
                                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",