X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-reflist.php;h=b49e0bd75161b353b12da40c23480e374d981425;hb=e6d0294f587cab6b74f689ecdf2ebb3cf2b09e25;hp=ee458bf6e149d5de57d71e598f4954017d8b6481;hpb=91363bcf76271274fac784976e494bf04e6b4120;p=mailer.git diff --git a/inc/modules/member/what-reflist.php b/inc/modules/member/what-reflist.php index ee458bf6e1..b49e0bd751 100644 --- a/inc/modules/member/what-reflist.php +++ b/inc/modules/member/what-reflist.php @@ -10,9 +10,14 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Refback-Einstellungen * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $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 * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -33,64 +38,44 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; - require($INC); -} elseif (!IS_MEMBER()) { + die(); +} elseif (!isMember()) { // User is not logged in - LOAD_URL("modules.php?module=index"); -} elseif ((!EXT_IS_ACTIVE("reflist")) && (!IS_ADMIN())) { - // Extension "reflist" is not active - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "reflist"); - return; + redirectToIndexMemberOnlyModule(); } -// Is the reflist system enabled? -if ($_CONFIG['reflist_enabled'] == "N") { - // Output message - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED); - // Abort here - return false; -} // END - if - // Add description as navigation point -ADD_DESCR("member", __FILE__); +addMenuDescription('member', __FILE__); // 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) { // List all levels - $OUT = ""; + $OUT = ''; while ($content = SQL_FETCHARRAY($result)) { // Init variables - $rows = ""; + $rows = ''; $counter = 0; $SW = 2; // Check for users ref in this level - foreach (GET_USER_REFS($GLOBALS['userid'], $content['level']) as $refRow) { - // Not-deleted account is default - $deleted = false; - if (is_null($refRow['status'])) $deleted = true; - + foreach (getUserReferalPoints(getUserId(), $content['level']) as $refRow) { // Add/"translate" more content - $refRow['sw'] = $SW; - $refRow['points'] = TRANSLATE_COMMA($refRow['points']); - $refRow['reflist'] = TRANSLATE_COMMA($refRow['reflist']); - $refRow['status'] = TRANSLATE_STATUS($refRow['status']); - if (empty($refRow['nickname'])) $refRow['nickname'] = "---"; + $refRow['sw'] = $SW; + $refRow['points'] = translateComma($refRow['points']); + $refRow['status'] = translateUserStatus($refRow['status']); + $refRow['unconfirmed'] = translateComma($refRow['unconfirmed']); + $refRow['clickrate'] = translateComma($refRow['clickrate'], true, 1); + if (empty($refRow['nickname'])) $refRow['nickname'] = '---'; // Load row template - if ($deleted) { - $rows .= LOAD_TEMPLATE("member_reflist_list_row_deleted", true, $refRow); - } else { - $rows .= LOAD_TEMPLATE("member_reflist_list_row", true, $refRow); - } + $rows .= loadTemplate('member_ref_list_row', true, $refRow); // Count this ref and switch color $counter++; @@ -98,19 +83,19 @@ 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'], true, 1); $content['rows'] = $rows; // Load level template - $OUT .= LOAD_TEMPLATE("member_reflist_list_level", true, $content); + $OUT .= loadTemplate('member_ref_list_level', true, $content); } // END - while // Load main template - LOAD_TEMPLATE("member_reflist_list", false, $OUT); + loadTemplate('member_ref_list', false, $OUT); } else { // No entries - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES); + loadTemplate('admin_settings_saved', false, getMessage('MEMBER_REFBACK_NO_ENTRIES')); } // Free result