New naming convention applied to many functions, see #118 for details
[mailer.git] / inc / modules / member / what-primera.php
index e59bb5811bf00e3873f63bae448cb36edc0dd133..eb8b8136155cb2ca10371cdbaf68ca0b8b8f0910 100644 (file)
@@ -42,7 +42,7 @@ 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('primera')) && (!IS_ADMIN())) {
        // Extension 'primera' is not activated
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'primera'));
@@ -53,7 +53,7 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('member', __FILE__);
 
 // Check if the admin has entered the data
-if ((getConfig('primera_api_name') == "") || (getConfig('primera_api_md5') == "")) {
+if ((getConfig('primera_api_name') == '') || (getConfig('primera_api_md5') == '')) {
        // Something important is missing...
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_API_DATA_MISSING'));
        return;
@@ -94,8 +94,8 @@ if (!REQUEST_ISSET_GET(('mode'))) {
                while ($data = SQL_FETCHARRAY($result)) {
                        // Prepare data for output
                        $rowContent = array(
-                               'stamp'         => MAKE_DATETIME($data['primera_timestamp'], "2"),
-                               'points'                => TRANSLATE_COMMA($data['primera_amount']),
+                               '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']),
@@ -119,7 +119,7 @@ if (REQUEST_GET('mode') == "pay") {
        $points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
 
        // No dots here...
-       $points = explode(".", $points);
+       $points = explode('.', $points);
        $points = bigintval($points[0]);
 
        // Remove the registration fee
@@ -128,13 +128,13 @@ if (REQUEST_GET('mode') == "pay") {
        // Is this enougth for a payout?
        if ($points < getConfig('primera_min_payout')) {
                // No, then abort here
-               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT'), TRANSLATE_COMMA(getConfig('primera_min_payout'))));
+               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT'), translateComma(getConfig('primera_min_payout'))));
                return;
        }
 
        // Add points to content array
        $content['points']              = $points;
-       $content['min_points']  = TRANSLATE_COMMA(getConfig('primera_min_payout'));
+       $content['min_points']  = translateComma(getConfig('primera_min_payout'));
 
        // Get Primera id
        $content['primera_nickname'] = '';
@@ -187,7 +187,7 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET(('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