]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-wernis.php
New method generateExtensionInactiveMessage() introduced
[mailer.git] / inc / modules / member / what-wernis.php
index 654b1b26694a272b18191b48503998e8f7edc475..507209c992ed170d6245a05f4818645c53d0df8f 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__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'wernis'));
+       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('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;
@@ -69,7 +69,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
 
        // Get WDS66 id
        $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-               array(getUserId()), __FILE__, __LINE__);
+       array(getUserId()), __FILE__, __LINE__);
 
        // Are there some entries?
        if (SQL_NUMROWS($result) == 1) {
@@ -87,15 +87,15 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('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(getUserId()), __FILE__, __LINE__);
 
                // Load all rows
                $content['rows'] = ''; $SW = 2;
                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);
@@ -160,7 +160,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        // Get WDS66 id
        $content['wds66_id'] = '';
        $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-               array(getUserId()), __FILE__, __LINE__);
+       array(getUserId()), __FILE__, __LINE__);
 
        // Are there some entries?
        if (SQL_NUMROWS($result) == 1) {
@@ -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
@@ -184,7 +184,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
 
        // Get WDS66 id
        $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-               array(getUserId()), __FILE__, __LINE__);
+       array(getUserId()), __FILE__, __LINE__);
 
        // Are there some entries?
        if (SQL_NUMROWS($result) == 1) {
@@ -201,7 +201,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
 }
 
 // Is the formular sent?
-if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET(('mode')))) {
+if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
        // Is the user ID and password set?
        if (!REQUEST_ISSET_POST(('wds66_id'))) {
                // Nothing entered in WDS66 user ID
@@ -231,11 +231,11 @@ 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",
-                                                       array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
+                                               array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
 
                                                // All done!
                                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_WITHDRAW_DONE'));
@@ -266,7 +266,7 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET(('mode')))) {
 
                                                // Update WDS66 id
                                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
-                                                       array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
+                                               array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
 
                                                // All done!
                                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_PAYOUT_DONE'));