]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-refback.php
New method generateExtensionInactiveMessage() introduced
[mailer.git] / inc / modules / member / what-refback.php
index ce46dfb130cc0cd04c84048f08c6ef428d68077e..7916265d40222305349ff680c28341b63d793f29 100644 (file)
@@ -42,14 +42,14 @@ 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('refback')) && (!IS_ADMIN())) {
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'refback');
+       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('refback'));
        return;
 }
 
 // Is the refback system enabled?
-if (getConfig('refback_enabled') != "Y") {
+if (getConfig('refback_enabled') != 'Y') {
        // Output message
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_REFBACK_DISABLED'));
        // Abort here
@@ -60,11 +60,11 @@ if (getConfig('refback_enabled') != "Y") {
 ADD_DESCR('member', __FILE__);
 
 // Was the form submitted?
-if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST(('id')))) {
+if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('id'))) {
        // Okay, has the user entered some values?
        if (REQUEST_ISSET_POST(('percents'))) {
                // Revert german commta for testing
-               $percents = REVERT_COMMA(REQUEST_POST('percents'));
+               $percents = convertCommaToDot(REQUEST_POST('percents'));
 
                // Validate percents
                if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == 0)) && ($percents <= getConfig('refback_max_perc'))) {
@@ -93,9 +93,9 @@ if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST(('id')))) {
                $content = GET_USER_REF_ENTRY(REQUEST_POST('id'));
 
                // Translate comma
-               $content['refback'] = TRANSLATE_COMMA($content['refback']);
-               $content['min']     = TRANSLATE_COMMA(getConfig('refback_min_perc').".0");
-               $content['max']     = TRANSLATE_COMMA(getConfig('refback_max_perc').".0");
+               $content['refback'] = translateComma($content['refback']);
+               $content['min']     = translateComma(getConfig('refback_min_perc').".0");
+               $content['max']     = translateComma(getConfig('refback_max_perc').".0");
 
                // Load form for editing
                LOAD_TEMPLATE("member_refback_edit", false, $content);
@@ -107,7 +107,7 @@ $result = SQL_QUERY_ESC("SELECT r.level, r.percents
 FROM `{!_MYSQL_PREFIX!}_refdepths` AS r
 WHERE r.level > 0
 ORDER BY r.level ASC",
-       array(getUserId()), __FILE__, __LINE__);
+array(getUserId()), __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
 if (SQL_NUMROWS($result) > 0) {
@@ -127,10 +127,10 @@ if (SQL_NUMROWS($result) > 0) {
 
                        // Add/"translate" more content
                        $refRow['sw']      = $SW;
-                       $refRow['points']  = TRANSLATE_COMMA($refRow['points']);
-                       $refRow['refback'] = TRANSLATE_COMMA($refRow['refback']);
-                       $refRow['status']  = TRANSLATE_STATUS($refRow['status']);
-                       if (empty($refRow['nickname'])) $refRow['nickname'] = "---";
+                       $refRow['points']  = translateComma($refRow['points']);
+                       $refRow['refback'] = translateComma($refRow['refback']);
+                       $refRow['status']  = translateUserStatus($refRow['status']);
+                       if (empty($refRow['nickname'])) $refRow['nickname'] = '---';
 
                        // Load row template
                        if ($deleted) {
@@ -145,8 +145,8 @@ if (SQL_NUMROWS($result) > 0) {
                } // END - foreach
 
                // Remember the content
-               $content['counter']  = TRANSLATE_COMMA($counter);
-               $content['percents'] = TRANSLATE_COMMA($content['percents']);
+               $content['counter']  = translateComma($counter);
+               $content['percents'] = translateComma($content['percents']);
                $content['rows']     = $rows;
 
                // Load level template