X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-refback.php;h=248b985bf74ef3aa52652e432ee0e6893205a621;hp=efc0964132c02932df9aaf8e4c94d7b8fe76457f;hb=508228c85fba8448d00865b1639cb8cd7a69e457;hpb=b1672dc1cd8c423637e3803c151862331c41bd66 diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php index efc0964132..248b985bf7 100644 --- a/inc/modules/member/what-refback.php +++ b/inc/modules/member/what-refback.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Refback-Einstellungen * * -------------------------------------------------------------------- * - * * + * $Revision:: 856 $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -38,16 +43,15 @@ 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 - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "refback"); +} elseif ((!EXT_IS_ACTIVE("refback")) && (!IS_ADMIN())) { + addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "refback"); return; } // Is the refback system enabled? -if ($_CONFIG['refback_enabled'] == "N") { +if (getConfig('refback_enabled') != "Y") { // Output message - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_DISABLED')); // Abort here return false; } // END - if @@ -56,43 +60,42 @@ if ($_CONFIG['refback_enabled'] == "N") { ADD_DESCR("member", __FILE__); // Was the form submitted? -if ((isset($_POST['edit'])) && (isset($_POST['id']))) { +if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST(('id')))) { // Okay, has the user entered some values? - if (isset($_POST['percents'])) { + if (REQUEST_ISSET_POST(('percents'))) { // Revert german commta for testing - $percents = REVERT_COMMA($_POST['percents']); + $percents = REVERT_COMMA(REQUEST_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']); + $status = REFBACK_CHANGE_MEMBER_PERCENTS(REQUEST_POST('id'), REQUEST_POST('percents')); // Check status if (isset($status['ok'])) { // No message found - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_DONE')); } elseif (isset($status['message'])) { // Something went wrong with error message - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_MESSAGE, $status['message'])); + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('MEMBER_REFBACK_ERROR_MESSAGE'), $status['message'])); } else { // No message found - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_ERROR_EMPTY_MESSAGE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_ERROR_EMPTY_MESSAGE')); } } 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(getMessage('MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS'), getConfig('refback_min_perc'), getConfig('refback_max_perc'))); } // Insert line - OUTPUT_HTML("
"); } else { // Read data from refback table - $content = GET_USER_REF_ENTRY($_POST['id']); + $content = GET_USER_REF_ENTRY(REQUEST_POST('id')); // Translate comma $content['refback'] = TRANSLATE_COMMA($content['refback']); - $content['min'] = TRANSLATE_COMMA($_CONFIG['refback_min_perc'].".0"); - $content['max'] = TRANSLATE_COMMA($_CONFIG['refback_max_perc'].".0"); + $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); @@ -101,10 +104,10 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) { // Load all referal levels $result = SQL_QUERY_ESC("SELECT r.level, r.percents -FROM "._MYSQL_PREFIX."_refdepths AS r +FROM `{!_MYSQL_PREFIX!}_refdepths` AS r WHERE r.level > 0 ORDER BY r.level ASC", - array($GLOBALS['userid']), __FILE__, __LINE__); + array(getUserId()), __FILE__, __LINE__); // Are there some entries? (Shall be!) if (SQL_NUMROWS($result) > 0) { @@ -117,7 +120,7 @@ if (SQL_NUMROWS($result) > 0) { $SW = 2; // Check for users ref in this level - foreach (GET_USER_REFS($GLOBALS['userid'], $content['level']) as $refRow) { + foreach (GET_USER_REFS(getUserId(), $content['level']) as $refRow) { // Not-deleted account is default $deleted = false; if (is_null($refRow['status'])) $deleted = true; @@ -154,7 +157,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("member_refback_list", false, $OUT); } else { // No entries - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_NO_ENTRIES')); } // Free result