From d4dd489111b2da4cbf37d1584c591d1bdbc1c518 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 28 Jul 2011 23:32:06 +0000 Subject: [PATCH] More EL code, some templates renamed: - Templates renamed to conform with naming convention - Some PHP code converted in EL code - TODOs.txt updated --- .gitattributes | 3 ++ DOCS/TODOs.txt | 7 +++- inc/modules/member/what-order.php | 7 +--- inc/modules/member/what-reflist.php | 8 ++-- inc/referal-functions.php | 6 --- .../de/html/member/member_list_referal.tpl | 10 +++++ .../html/member/member_list_referal_level.tpl | 37 ++++++++++++++++++ .../html/member/member_list_referal_row.tpl | 20 ++++++++++ templates/de/html/member/member_ref_list.tpl | 9 +---- .../de/html/member/member_ref_list_level.tpl | 38 +------------------ .../de/html/member/member_ref_list_row.tpl | 21 +--------- 11 files changed, 84 insertions(+), 82 deletions(-) create mode 100644 templates/de/html/member/member_list_referal.tpl create mode 100644 templates/de/html/member/member_list_referal_level.tpl create mode 100644 templates/de/html/member/member_list_referal_row.tpl diff --git a/.gitattributes b/.gitattributes index e161a0089b..40a522f9cf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1709,6 +1709,9 @@ templates/de/html/member/member_list_refback.tpl svneol=native#text/plain templates/de/html/member/member_list_refback_deleted_row.tpl svneol=native#text/plain templates/de/html/member/member_list_refback_level.tpl svneol=native#text/plain templates/de/html/member/member_list_refback_row.tpl svneol=native#text/plain +templates/de/html/member/member_list_referal.tpl svneol=native#text/plain +templates/de/html/member/member_list_referal_level.tpl svneol=native#text/plain +templates/de/html/member/member_list_referal_row.tpl svneol=native#text/plain templates/de/html/member/member_list_reflinks.tpl svneol=native#text/plain templates/de/html/member/member_list_reflinks_row.tpl svneol=native#text/plain templates/de/html/member/member_list_surfbar.tpl svneol=native#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index ee7c8bee0b..689c4ab723 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -157,8 +157,8 @@ ./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout())); ./inc/modules/member/what-categories.php:131: // @TODO Rewrite this to use $OUT .= ... ./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter * -./inc/modules/member/what-order.php:488: // @TODO Rewrite this to a filter -./inc/modules/member/what-order.php:85: // @TODO Rewrite this to SQL_FETCHARRAY() +./inc/modules/member/what-order.php:485: // @TODO Rewrite this to a filter +./inc/modules/member/what-order.php:82: // @TODO Rewrite this to SQL_FETCHARRAY() ./inc/modules/member/what-payout.php:194: // @TODO Rewrite this to a filter ./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter? ./inc/modules/member/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = '' . $content['login'] . ''; @@ -330,6 +330,9 @@ ./templates/de/html/member/member_refback_list.tpl:1: ./templates/de/html/member/member_reflinks_row.tpl:1: ./templates/de/html/member/member_reflinks_table.tpl:1: +./templates/de/html/member/member_ref_list_level.tpl:1: +./templates/de/html/member/member_ref_list_row.tpl:1: +./templates/de/html/member/member_ref_list.tpl:1: ./templates/de/html/member/member_surfbar_book_dynamic.tpl:1: ./templates/de/html/member/member_surfbar_book_static.tpl:1: ./templates/de/html/member/member_surfbar_list_form.tpl:1: diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 4189b7d78f..e1587709af 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -50,9 +50,6 @@ if ((!isExtensionActive('order')) && (!isAdmin())) { $url = ''; $id = '0'; -// Count unconfirmed mails -$links = getTotalUnconfirmedMails(getMemberId()); - $ALLOWED = getUserData('receive_mails') - getUserData('mail_orders'); if (getConfig('order_max_full') == 'MAX') $ALLOWED = getUserData('receive_mails'); @@ -460,7 +457,7 @@ LIMIT 1", } elseif (($ALLOWED == '0') && (getConfig('order_max_full') == 'ORDER')) { // No more mail orders allowed displayMessage('{--MEMBER_ORDER_ALLOWED_EXHAUSTED--}'); -} elseif ($links < getConfig('unconfirmed')) { +} elseif (getTotalUnconfirmedMails(getMemberId()) < getConfig('unconfirmed')) { // Show only enabled categories to the user ... $whereStatement = " WHERE `visible`='Y'"; @@ -735,7 +732,7 @@ LIMIT 1", } } else { // Please confirm some mails first - displayMessage('{%message,MEMBER_ORDER_LINKS_LEFT=' . $links . '%}', $links); + displayMessage('{%message,MEMBER_ORDER_LINKS_LEFT=' . getTotalUnconfirmedMails(getMemberId()) . '%}'); } if (!empty($url)) { diff --git a/inc/modules/member/what-reflist.php b/inc/modules/member/what-reflist.php index 94339e44f0..7542489428 100644 --- a/inc/modules/member/what-reflist.php +++ b/inc/modules/member/what-reflist.php @@ -68,10 +68,10 @@ if (!SQL_HASZERONUMS($result)) { // Check for users ref in this level foreach (getUserReferalPoints(getMemberId(), $content['level']) as $refRow) { // Add/"translate" more content - $refRow['click_rate'] = translateComma($refRow['click_rate'], true, 1); + $refRow['click_rate'] = translateComma($refRow['click_rate'], true, 1); // Load row template - $rows .= loadTemplate('member_ref_list_row', true, $refRow); + $rows .= loadTemplate('member_list_referal_row', true, $refRow); // Count this ref and switch color $counter++; @@ -83,11 +83,11 @@ if (!SQL_HASZERONUMS($result)) { $content['rows'] = $rows; // Load level template - $OUT .= loadTemplate('member_ref_list_level', true, $content); + $OUT .= loadTemplate('member_list_referal_level', true, $content); } // END - while // Load main template - loadTemplate('member_ref_list', false, $OUT); + loadTemplate('member_list_referal', false, $OUT); } else { // No entries displayMessage('{--MEMBER_REFBACK_NO_ENTRIES--}'); diff --git a/inc/referal-functions.php b/inc/referal-functions.php index 636d88aacb..001b7724cd 100644 --- a/inc/referal-functions.php +++ b/inc/referal-functions.php @@ -373,12 +373,6 @@ ORDER BY if (!SQL_HASZERONUMS($result)) { // Fetch all entries while ($row = SQL_FETCHARRAY($result)) { - // Get total points of this user - $row['points'] = getTotalPoints($row['refid']); - - // Get unconfirmed mails - $row['unconfirmed'] = getTotalUnconfirmedMails($row['refid']); - // Init click rate with zero $row['click_rate'] = '0'; diff --git a/templates/de/html/member/member_list_referal.tpl b/templates/de/html/member/member_list_referal.tpl new file mode 100644 index 0000000000..3df765c2a7 --- /dev/null +++ b/templates/de/html/member/member_list_referal.tpl @@ -0,0 +1,10 @@ +
+ + + + +$content +
+ {--MEMBER_REFLIST_TITLE--} +
+
diff --git a/templates/de/html/member/member_list_referal_level.tpl b/templates/de/html/member/member_list_referal_level.tpl new file mode 100644 index 0000000000..00d94b74e8 --- /dev/null +++ b/templates/de/html/member/member_list_referal_level.tpl @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + +$content[rows] + + + +
+ {--MEMBER_REFLIST_LIST_TITLE_1--}$content[level]{--MEMBER_REFLIST_LIST_TITLE_2--}$content[percents]{--MEMBER_REFLIST_LIST_TITLE_3--} +
+ {--_USERID--} + + {--ACCOUNT_STATUS--} + + {--MEMBER_REFLIST_POINTS--} + + {--UNCONFIRMED_LINKS--} + + {--MEMBER_CLICK_RATE--} + + {--MEMBER_REFLIST_ACTIVITY--} +
+ + diff --git a/templates/de/html/member/member_list_referal_row.tpl b/templates/de/html/member/member_list_referal_row.tpl new file mode 100644 index 0000000000..ca2ba88be8 --- /dev/null +++ b/templates/de/html/member/member_list_referal_row.tpl @@ -0,0 +1,20 @@ + + + $content[refid] ({%user,nickname,fixEmptyContentToDashes=$content[refid]%}) + + + {%pipe,translateUserStatus=$content[status]%} + + + {%pipe,getTotalPoints,translateComma=$content[refid]%} {?POINTS?} + + + {%pipe,getTotalUnconfirmedMails,translateComma=$content[refid]%} + + + $content[click_rate]% + + + $content[activity] + + diff --git a/templates/de/html/member/member_ref_list.tpl b/templates/de/html/member/member_ref_list.tpl index b17b537301..11f5d85d80 100644 --- a/templates/de/html/member/member_ref_list.tpl +++ b/templates/de/html/member/member_ref_list.tpl @@ -1,8 +1 @@ - - - - -$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 index 00d94b74e8..11f5d85d80 100644 --- a/templates/de/html/member/member_ref_list_level.tpl +++ b/templates/de/html/member/member_ref_list_level.tpl @@ -1,37 +1 @@ - - - - - - - - - - - - - - -$content[rows] - - - -
- {--MEMBER_REFLIST_LIST_TITLE_1--}$content[level]{--MEMBER_REFLIST_LIST_TITLE_2--}$content[percents]{--MEMBER_REFLIST_LIST_TITLE_3--} -
- {--_USERID--} - - {--ACCOUNT_STATUS--} - - {--MEMBER_REFLIST_POINTS--} - - {--UNCONFIRMED_LINKS--} - - {--MEMBER_CLICK_RATE--} - - {--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 index 15a722a3cc..11f5d85d80 100644 --- a/templates/de/html/member/member_ref_list_row.tpl +++ b/templates/de/html/member/member_ref_list_row.tpl @@ -1,20 +1 @@ - - - $content[refid] ({%user,nickname,fixEmptyContentToDashes=$content[refid]%}) - - - {%pipe,translateUserStatus=$content[status]%} - - - {%pipe,translateComma=$content[points]%} {?POINTS?} - - - {%pipe,translateComma=$content[unconfirmed]%} - - - $content[click_rate]% - - - $content[activity] - - + -- 2.39.5