]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-refback.php
Several bugfixes, getMessage() introduced
[mailer.git] / inc / modules / member / what-refback.php
index 89929d74475605508a2448786e9b430abbfbd586..9563cf746ecef399bd91d81f9f14fff3b4e5ba1c 100644 (file)
@@ -38,14 +38,13 @@ if (!defined('__SECURITY')) {
 } elseif (!IS_MEMBER()) {
        // User is not logged in
        LOAD_URL("modules.php?module=index");
-} elseif (!EXT_IS_ACTIVE("refback")) {
-       // Extension "refback" is not active
+} elseif ((!EXT_IS_ACTIVE("refback")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "refback");
        return;
 }
 
 // Is the refback system enabled?
-if ($_CONFIG['refback_enabled'] == "N") {
+if (getConfig('refback_enabled') == "N") {
        // Output message
        LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED);
        // Abort here
@@ -63,7 +62,7 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
                $percents = REVERT_COMMA($_POST['percents']);
 
                // Validate percents
-               if ((($percents >= $_CONFIG['refback_min_perc']) || (round($percents) == 0)) && ($percents <= $_CONFIG['refback_max_perc'])) {
+               if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == 0)) && ($percents <= getConfig('refback_max_perc'))) {
                        // Change ref-back for this direct id
                        $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
 
@@ -80,7 +79,7 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
                        }
                } else {
                        // Percents out-of-bounds ;-)
-                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, $_CONFIG['refback_min_perc'], $_CONFIG['refback_max_perc']));
+                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, getConfig('refback_min_perc'), getConfig('refback_max_perc')));
                }
 
                // Insert line
@@ -91,8 +90,8 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
 
                // Translate comma
                $content['refback'] = TRANSLATE_COMMA($content['refback']);
-               $content['min']     = TRANSLATE_COMMA($_CONFIG['refback_min_perc'].".0", true, 1);
-               $content['max']     = TRANSLATE_COMMA($_CONFIG['refback_max_perc'].".0", true, 1);
+               $content['min']     = TRANSLATE_COMMA(getConfig('refback_min_perc').".0");
+               $content['max']     = TRANSLATE_COMMA(getConfig('refback_max_perc').".0");
 
                // Load form for editing
                LOAD_TEMPLATE("member_refback_edit", false, $content);
@@ -143,7 +142,7 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Remember the content
                $content['counter']  = TRANSLATE_COMMA($counter);
-               $content['percents'] = TRANSLATE_COMMA($content['percents'], true, 1);
+               $content['percents'] = TRANSLATE_COMMA($content['percents']);
                $content['rows']     = $rows;
 
                // Load level template