From aaeab8d02fbf455df9b60ab0b85c999dd2da9069 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 12 Oct 2008 00:26:15 +0000 Subject: [PATCH] Referal overview completed, thanks to monakoianar for useful hints. :-) --- .gitattributes | 3 + inc/databases.php | 2 +- inc/functions.php | 7 +- inc/language/de.php | 15 +++++ inc/language/refback_de.php | 4 +- inc/modules/admin/what-list_yoomedia_tm.php | 5 +- inc/modules/guest/what-sponsor_infos.php | 8 +-- inc/modules/member/what-reflist.php | 33 +++------- inc/mysql-manager.php | 65 +++++++++++++++++++ templates/de/html/member/member_ref_list.tpl | 10 +++ .../de/html/member/member_ref_list_level.tpl | 38 +++++++++++ .../de/html/member/member_ref_list_row.tpl | 20 ++++++ .../html/member/member_refback_list_level.tpl | 2 +- 13 files changed, 171 insertions(+), 41 deletions(-) create mode 100644 templates/de/html/member/member_ref_list.tpl create mode 100644 templates/de/html/member/member_ref_list_level.tpl create mode 100644 templates/de/html/member/member_ref_list_row.tpl diff --git a/.gitattributes b/.gitattributes index 733707e782..601a343714 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1350,6 +1350,9 @@ templates/de/html/member/member_primera_mode_list.tpl -text templates/de/html/member/member_primera_mode_list_row.tpl -text templates/de/html/member/member_primera_mode_pay.tpl -text templates/de/html/member/member_receive_table.tpl -text +templates/de/html/member/member_ref_list.tpl -text +templates/de/html/member/member_ref_list_level.tpl -text +templates/de/html/member/member_ref_list_row.tpl -text templates/de/html/member/member_refback_edit.tpl -text templates/de/html/member/member_refback_list.tpl -text templates/de/html/member/member_refback_list_level.tpl -text diff --git a/inc/databases.php b/inc/databases.php index 95ca1709d2..54cff4d34b 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "492"); +define('CURR_SVN_REVISION', "493"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/functions.php b/inc/functions.php index e9eb668102..291d865adb 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -569,13 +569,18 @@ function MAKE_DATETIME ($time, $mode="0") } // Translates the american decimal dot into a german comma -function TRANSLATE_COMMA ($dotted, $cut=true) { +function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) { global $_CONFIG; // Default is 3 you can change this in admin area "Misc -> Misc Options" if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3"; + + // Use from config is default $maxComma = $_CONFIG['max_comma']; + // Use from parameter? + if ($max > 0) $maxComma = $max; + // Cut zeros off? if ($cut) { // Test for commata if in cut-mode diff --git a/inc/language/de.php b/inc/language/de.php index 447984526e..cab9bc3418 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1196,5 +1196,20 @@ define('EMAIL_STATUS_NEW', "Wartet auf Versand"); define('EMAIL_STATUS_QUEUE', "Wird versendet"); define('EMAIL_STATUS_TEMP', "Wird gerade gebucht"); +// Member activity +define('MEMBER_ACTIVITY_ACTIVE', "Aktiv"); +define('MEMBER_ACTIVITY_INACTIVE', "Inaktiv"); + +// Member reflist +define('MEMBER_REFLIST_LIST_TITLE_1', "Ihre Referals in Ebene "); +define('MEMBER_REFLIST_LIST_TITLE_2', " ("); +define('MEMBER_REFLIST_LIST_TITLE_3', "% Ref-Vergütung)"); +define('MEMBER_REFLIST_TITLE', "Referal-Übersicht"); +define('MEMBER_REFLIST_POINTS', "Verdienst des Mitgliedes"); +define('MEMBER_REFLIST_ACTIVITY', "Mitglied aktiv?"); +define('MEMBER_REFLIST_COUNTER_1', "In dieser Ebene haben Sie "); +define('MEMBER_REFLIST_COUNTER_2', " Mitglieder geworben."); + + // ?> diff --git a/inc/language/refback_de.php b/inc/language/refback_de.php index 35348a048e..fece0bb0ec 100644 --- a/inc/language/refback_de.php +++ b/inc/language/refback_de.php @@ -48,14 +48,12 @@ define('ADMIN_CONFIG_REFBACK_MAX_PERCENTS', "Maximum erlaubte Refback-Prozente:" // Member language strings define('MEMBER_REFBACK_LIST_TITLE_1', "Ref-Back Übersicht für Referal-Ebene "); define('MEMBER_REFBACK_LIST_TITLE_2', " ("); -define('MEMBER_REFBACK_LIST_TITLE_3', "% Ref-Vergütung)"); +define('MEMBER_REFBACK_LIST_TITLE_3', "% Ref-Vergütung)"); define('MEMBER_REFBACK_TITLE', "Ref-Back und Referal-Übersicht"); define('MEMBER_REFBACK_NOTE', "Hier können Sie in jeder Referal-Ebene jedem von Ihnen geworbenen Mitglied Ref-Back einstellen. Sollte Ihr Referal {!POINTS!} verdienen und diese ihm/ihr nicht direkt gutgeschrieben werden, so erhält Ihr Referal die eingestellten Prozente von Ihrem Referalverdienst aufgebuch. Ihnen wird dafür sein Anteil (=eingestellte Prozente) von dem Refverdienst abgezogen. Unter {--MEMBER_REFBACK_POINTS--} sind die {!POINTS!}-Gutschriften durch Ref-Back an das jeweilige Mitglied zu verstehen."); define('MEMBER_REFBACK_EXAMPLE', "Ein Rechenbeispiel: Ihr Ref X verdient 1000 {!POINTS!}, es sind 10% in Ref-Ebene 1 eingestellt. Sie erhalten somit 100 {!POINTS!} in Ref-Ebene 1 gutgeschrieben. Nun haben Sie einen Refback von 90% dem Ref gegeben. Ihrem Ref werden somit 90 und Ihnen die restlichen 10 {!POINTS!} gutgeschrieben."); define('MEMBER_REFBACK_NO_ENTRIES', "Es gibt technische Probleme mit der Refback-Tabelle. Bitte Support benachrichtigen."); define('MEMBER_REFBACK_EDIT_SUBMIT', "Refback einstellen"); -define('MEMBER_REFBACK_COUNTER_1', "In dieser Ebene haben Sie "); -define('MEMBER_REFBACK_COUNTER_2', " Mitglieder geworben."); define('MEMBER_REFBACK_REFID', "User-ID (Nickname)"); define('MEMBER_REFBACK_STATUS', "Referal-Status"); define('MEMBER_REFBACK_PERCENTS', "Ref-Back Prozente"); diff --git a/inc/modules/admin/what-list_yoomedia_tm.php b/inc/modules/admin/what-list_yoomedia_tm.php index 91150db8f6..252bd0d2f7 100644 --- a/inc/modules/admin/what-list_yoomedia_tm.php +++ b/inc/modules/admin/what-list_yoomedia_tm.php @@ -90,14 +90,11 @@ if ((!is_array($result)) || (count($result) == 0) || (!isset($result[0]['id']))) return false; } -// Temporary set max comma -$_CONFIG['max_comma'] = 5; - // Prepare all entries $OUT = ""; $SW = 2; foreach ($result as $entry) { // Translate some data - $entry['pay'] = TRANSLATE_COMMA($entry['pay']); + $entry['pay'] = TRANSLATE_COMMA($entry['pay'], true, 5); $entry['remain'] = TRANSLATE_COMMA($entry['remain']); $entry['sw'] = $SW; diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index 5096a76e34..886cbcc965 100644 --- a/inc/modules/guest/what-sponsor_infos.php +++ b/inc/modules/guest/what-sponsor_infos.php @@ -85,15 +85,9 @@ if ($num_act > 0) 'rate' => TRANSLATE_COMMA($rate), 'min' => $min, 'curr' => $curr, - 'price' => $min, + 'price' => TRANSLATE_COMMA($min), ); - if (!ereg(",", $content['price'])) - { - // Add missing zeros - $content['price'] .= ",".str_repeat("0", $_CONFIG['max_comma']); - } - // Load row template and switch color $OUT_PAY .= LOAD_TEMPLATE("guest_sponsor_pay_row", true, $content); $SW = 3 - $SW; diff --git a/inc/modules/member/what-reflist.php b/inc/modules/member/what-reflist.php index ee458bf6e1..e0d6552467 100644 --- a/inc/modules/member/what-reflist.php +++ b/inc/modules/member/what-reflist.php @@ -44,14 +44,6 @@ if (!defined('__SECURITY')) { return; } -// 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__); @@ -73,24 +65,17 @@ if (SQL_NUMROWS($result) > 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 (GET_USER_REF_POINTS($GLOBALS['userid'], $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']); + $refRow['sw'] = $SW; + $refRow['points'] = TRANSLATE_COMMA($refRow['points']); + $refRow['status'] = TRANSLATE_STATUS($refRow['status']); + $refRow['unconfirmed'] = TRANSLATE_COMMA($refRow['unconfirmed']); + $refRow['clickrate'] = TRANSLATE_COMMA($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 .= LOAD_TEMPLATE("member_ref_list_row", true, $refRow); // Count this ref and switch color $counter++; @@ -103,11 +88,11 @@ if (SQL_NUMROWS($result) > 0) { $content['rows'] = $rows; // Load level template - $OUT .= LOAD_TEMPLATE("member_reflist_list_level", true, $content); + $OUT .= LOAD_TEMPLATE("member_ref_list_level", true, $content); } // END - while // Load main template - LOAD_TEMPLATE("member_reflist_list", false, $OUT); + LOAD_TEMPLATE("member_ref_list", false, $OUT); } else { // No entries LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 2d187f0acd..15618193a4 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -2202,5 +2202,70 @@ function USER_STATS_INSERT_RECORD ($uid, $type, $data) { } } +// "Getter" for array for user refs and points in given level +function GET_USER_REF_POINTS ($uid, $level) { + global $_CONFIG; + + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; + return $refs; +} + // ?> diff --git a/templates/de/html/member/member_ref_list.tpl b/templates/de/html/member/member_ref_list.tpl new file mode 100644 index 0000000000..649daae926 --- /dev/null +++ b/templates/de/html/member/member_ref_list.tpl @@ -0,0 +1,10 @@ + + + + + +$content + +
+ {--MEMBER_REFLIST_TITLE--} +
 
 
diff --git a/templates/de/html/member/member_ref_list_level.tpl b/templates/de/html/member/member_ref_list_level.tpl new file mode 100644 index 0000000000..64b55ae401 --- /dev/null +++ b/templates/de/html/member/member_ref_list_level.tpl @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + +$content[rows] + + + +
+ {--MEMBER_REFLIST_LIST_TITLE_1--}$content[level]{--MEMBER_REFLIST_LIST_TITLE_2--}$content[percents]{--MEMBER_REFLIST_LIST_TITLE_3--} +
+ {--_UID--} + + {--ACCOUNT_STATUS--} + + {--MEMBER_REFLIST_POINTS--} + + {--UNCONFIRMED_LINKS--} + + {--EMAIL_PERCENT--} + + {--MEMBER_REFLIST_ACTIVITY--} +
+ + +  diff --git a/templates/de/html/member/member_ref_list_row.tpl b/templates/de/html/member/member_ref_list_row.tpl new file mode 100644 index 0000000000..f7b6bc7bbb --- /dev/null +++ b/templates/de/html/member/member_ref_list_row.tpl @@ -0,0 +1,20 @@ + + + $content[refid] ($content[nickname]) + + + $content[status] + + + $content[points] {!POINTS!} + + + $content[unconfirmed] + + + $content[clickrate]% + + + $content[activity] + + diff --git a/templates/de/html/member/member_refback_list_level.tpl b/templates/de/html/member/member_refback_list_level.tpl index 45e03f96fa..8251570c31 100644 --- a/templates/de/html/member/member_refback_list_level.tpl +++ b/templates/de/html/member/member_refback_list_level.tpl @@ -26,7 +26,7 @@ $content[rows] - {--MEMBER_REFBACK_COUNTER_1--}$content[counter]{--MEMBER_REFBACK_COUNTER_2--} + {--MEMBER_REFLIST_COUNTER_1--}$content[counter]{--MEMBER_REFLIST_COUNTER_2--} -- 2.39.5