From 8da353fa4bb729bb3299d247803c23833a52a327 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 10 Jan 2013 06:29:49 +0000 Subject: [PATCH] Used EL code {%template,LoadTemplate=foo%} instead of loadTemplate('foo', TRUE); --- DOCS/TODOs.txt | 7 ++++--- beg.php | 2 -- birthday_confirm.php | 6 ------ inc/modules/admin/admin-inc.php | 4 ++-- inc/modules/admin/what-list_country.php | 3 --- inc/modules/admin/what-list_sponsor_pay.php | 9 +++------ inc/modules/guest/what-rallyes.php | 8 +------- inc/modules/guest/what-register.php | 3 --- inc/modules/member/what-mydata.php | 8 +++----- inc/modules/member/what-rallyes.php | 6 +----- inc/modules/member/what-reflinks.php | 2 +- inc/modules/sponsor.php | 6 ------ show_bonus.php | 6 ------ templates/de/emails/admin/admin_rallye_expired.tpl | 4 ++-- .../de/emails/member/member_rallye_expired_bronce.tpl | 4 ++-- .../de/emails/member/member_rallye_expired_gold.tpl | 4 ++-- .../de/emails/member/member_rallye_expired_other.tpl | 4 ++-- .../de/emails/member/member_rallye_expired_silver.tpl | 4 ++-- templates/de/html/admin/admin_list_country.tpl | 2 +- templates/de/html/admin/admin_list_rallyes_row.tpl | 4 ++-- templates/de/html/admin/admin_sponsor_paytypes.tpl | 2 +- templates/de/html/beg/beg_link.tpl | 4 ++-- templates/de/html/birthday/birthday_confirm.tpl | 4 ++-- templates/de/html/guest/guest_register.tpl | 2 +- templates/de/html/show_bonus.tpl | 4 ++-- templates/de/html/sponsor/sponsor_main.tpl | 4 ++-- 26 files changed, 38 insertions(+), 78 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index a42f5ff7aa..7a821d6514 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -2,7 +2,7 @@ ### DO NOT EDIT THIS FILE. ### ./api.php:68:// @TODO Do stuff here ./autoreg.php:62:// @TODO Add processing of request here -./beg.php:175: // @TODO Opps, what is missing here??? +./beg.php:173: // @TODO Opps, what is missing here??? ./cron.php:62:// @TODO Do stuff here ./inc/classes/cachesystem.class.php:516: // @TODO Add support for more types which break in last else-block ./inc/config-functions.php:150: // @TODO Make this all better... :-/ @@ -82,9 +82,9 @@ ./inc/libs/doubler_functions.php:44:// @TODO Lame description ./inc/libs/doubler_functions.php:96: // @TODO Can't this be moved into EL? ./inc/libs/forced_functions.php:457:// @TODO Can't we use our new expression language instead of this ugly code? -./inc/libs/mailid_functions.php:126: // @TODO Rewrite these blocks to filter +./inc/libs/mailid_functions.php:123: // @TODO Rewrite these blocks to filter ./inc/libs/mailid_functions.php:47: // @TODO Rewrite this to a dynamic include or so -./inc/libs/mailid_functions.php:96: // @TODO Rewrite this to a filter +./inc/libs/mailid_functions.php:93: // @TODO Rewrite this to a filter ./inc/libs/network_functions.php:1182: // @TODO Implement this function, don't forget to set HTTP status back to '200 OK' if everything went fine ./inc/libs/order_functions.php:46: // @TODO Move this array into a filter ./inc/libs/rallye_functions.php:771:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId() @@ -173,6 +173,7 @@ ./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout())); ./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter * ./inc/modules/member/what-logout.php:52: // @TODO Move this in a filter, e.g. member_logout +./inc/modules/member/what-mydata.php:82: // @TODO Move this to a function (for better EL code) ./inc/modules/member/what-order.php:463: // @TODO Rewrite this to a filter ./inc/modules/member/what-payout.php:208: // @TODO Rewrite this to a filter ./inc/modules/member/what-points.php:61:// @TODO Should we rewrite this to a filter? diff --git a/beg.php b/beg.php index 58d12841ea..6bc039e62e 100644 --- a/beg.php +++ b/beg.php @@ -90,8 +90,6 @@ if (isGetRequestElementSet('userid')) { // Set nickname / userid for template $content['userid'] = getRequestElement('userid'); $content['clicks'] = (getUserData('beg_clicks') + 1); - $content['header_banner'] = loadTemplate('beg_header_banner', TRUE); - $content['footer_banner'] = loadTemplate('beg_footer_banner', TRUE); $content['points'] = $points; } // END - if diff --git a/birthday_confirm.php b/birthday_confirm.php index 607dd32c9e..51c7c93629 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -123,12 +123,6 @@ $GLOBALS['__module'] = 'birthday_confirm'; // Include header loadIncludeOnce('inc/header.php'); -// Load birthday header template (for your banners, e.g.?) -$content['header'] = loadTemplate('birthday_header', TRUE); - -// Load birthday footer template (for your banners, e.g.?) -$content['footer'] = loadTemplate('birthday_footer', TRUE); - // Load final template and output it loadTemplate('birthday_confirm', FALSE, $content); diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 209319c84d..5d655b2f74 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -1722,10 +1722,10 @@ function registerFirstAdmin () { } // END - if // Output error messages - $content['login_message'] = loadTemplate('admin_login_msg', TRUE, $loginMessage); + $content['login_message'] = loadTemplate('admin_login_msg', TRUE, $loginMessage); $content['password1_message'] = loadTemplate('admin_login_msg', TRUE, $password1Message); $content['password2_message'] = loadTemplate('admin_login_msg', TRUE, $password2Message); - $content['error_message'] = loadTemplate('admin_login_msg', TRUE, $errorMessage); + $content['error_message'] = loadTemplate('admin_login_msg', TRUE, $errorMessage); } // END - if // Output message in seperate template diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index 8373690f78..6d86d0bd1a 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -195,9 +195,6 @@ LIMIT 1"); // Add list to constant for the template $content['rows'] = $OUT; - // Include add template - $content['add_form'] = loadTemplate('admin_add_country', TRUE); - // Load main template loadTemplate('admin_list_country', FALSE, $content); } diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index 16276c4da5..cd3178fc98 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -95,7 +95,7 @@ LIMIT 1", // Remove entries here... foreach (postRequestElement('id') as $id => $sel) { // Remove entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1", + SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1', array(bigintval($id)), __FILE__, __LINE__); } @@ -172,7 +172,7 @@ if (isFormSent('add')) { } } else { // Load all payment types - $result = SQL_QUERY("SELECT + $result = SQL_QUERY('SELECT `id`, `pay_name`, `pay_rate`, @@ -181,7 +181,7 @@ if (isFormSent('add')) { FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` ORDER BY - `pay_name` ASC", + `pay_name` ASC', __FILE__, __LINE__); // Are there some payment types setup? @@ -205,9 +205,6 @@ ORDER BY // Free memory SQL_FREERESULT($result); - // Add new payment types here - $content['add_out'] = loadTemplate('admin_add_sponsor_paytype', TRUE); - // Load final template loadTemplate('admin_sponsor_paytypes', FALSE, $content); } diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php index 43afabe64d..bb0448e6ba 100644 --- a/inc/modules/guest/what-rallyes.php +++ b/inc/modules/guest/what-rallyes.php @@ -101,19 +101,13 @@ if (SQL_NUMROWS($result) == 1) { // Handle description... if ((empty($content['descr'])) && (!empty($content['template']))) { // Use description from template - $content['descr'] = loadTemplate('rallye_' . $content['template'], TRUE); + $content['descr'] = '{%template,LoadTemplate=rallye_' . $content['template'] . '%}'; } // END - if // Set start and end time $content['start_time'] = generateDateTime($content['start_time'], 1); $content['end_time'] = generateDateTime($content['end_time'] , 1); - // Determine min_users - $content['min_users'] = determineReferralRallyeMinimumUsers($content['min_users']); - - // Determine min prices (now in function) - $content['min_prices'] = determineReferralRallyeMinimumPrices($content['min_prices']); - if ($expired === TRUE) { $content['prices'] = addReferralRallyeWinners('guest', $content['id']); $content['top_users'] = '
' . $content['extras'] . '
'; diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 2036b9f7e1..4b30681ebc 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -125,9 +125,6 @@ if ((isFormSent()) && (isRegistrationDataComplete())) { $content['refid_content'] = loadTemplate('guest_register_refid', TRUE); } - // You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-) - $content['header_content'] = loadTemplate('register_header', TRUE); - // ZIP codes are numerical values $content['zip'] = ''; if ((isPostRequestElementSet('zip')) && (postRequestElement('zip') > 0)) { diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index d2644c773c..6f61788d35 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -79,12 +79,10 @@ switch ($mode) { $content['change'] = loadTemplate('member_mydata_button', TRUE); } - $content['birth_day'] = padLeftZero($content['birth_day']); - $content['birth_month'] = padLeftZero($content['birth_month']); - + // @TODO Move this to a function (for better EL code) switch (getLanguage()) { - case 'de': $content['dob'] = $content['birth_day'] . '.' . $content['birth_month'] . '.' . $content['birth_year']; break; - default : $content['dob'] = $content['birth_month'] . '-' . $content['birth_day'] . '-' . $content['birth_year']; break; + case 'de': $content['dob'] = '{%pipe,padLeftZero=' . $content['birth_day'] . '%}.{%pipe,padLeftZero=' . $content['birth_month'] . '%}.' . $content['birth_year']; break; + default : $content['dob'] = '{%pipe,padLeftZero=' . $content['birth_month'] . '%}-{%pipe,padLeftZero=' . $content['birth_day'] . '%}-' . $content['birth_year']; break; } // END - switch if (isExtensionActive('country')) { diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php index 26292af156..62c02fd53a 100644 --- a/inc/modules/member/what-rallyes.php +++ b/inc/modules/member/what-rallyes.php @@ -101,13 +101,9 @@ if (SQL_NUMROWS($result) == 1) { // Handle description... if ((empty($content['descr'])) && (!empty($content['template']))) { // Use description from template - $content['descr'] = loadTemplate('rallye_' . $content['template'], TRUE); + $content['descr'] = '{%template,LoadTemplate=rallye_' . $content['template'] . '%}'; } // END - if - // Determine min_users/prices - $content['min_users'] = determineReferralRallyeMinimumUsers($content['min_users']); - $content['min_prices'] = determineReferralRallyeMinimumPrices($content['min_prices']); - // Set start and end time $content['start_time'] = generateDateTime($content['start_time'], 1); $content['end_time'] = generateDateTime($content['end_time'] , 1); diff --git a/inc/modules/member/what-reflinks.php b/inc/modules/member/what-reflinks.php index 81d8c78803..b3499985c3 100644 --- a/inc/modules/member/what-reflinks.php +++ b/inc/modules/member/what-reflinks.php @@ -59,7 +59,7 @@ if (isExtensionActive('nickname')) { $content['nickname_content'] = loadTemplate('member_reflink_nickname', TRUE, $nick); } else { // Display link to nickname form - $content['nickname_content'] = loadTemplate('member_reflink_no_nickname', TRUE); + $content['nickname_content'] = '{%template,LoadTemplate=member_reflink_no_nickname%}'; } } // END - if diff --git a/inc/modules/sponsor.php b/inc/modules/sponsor.php index 6299d72674..17e5a57475 100644 --- a/inc/modules/sponsor.php +++ b/inc/modules/sponsor.php @@ -59,12 +59,6 @@ $content['menu'] = addSponsorMenu(getWhat()); // Generate right-side output $content['content'] = addSponsorContent(getWhat()); -// Load header template -$content['header'] = loadTemplate('sponsor_header', TRUE); - -// Load footer template -$content['footer'] = loadTemplate('sponsor_footer', TRUE); - // 'You are here' navigation $content['you_are_here'] = addYouAreHereLink('sponsor', getWhat(), TRUE); diff --git a/show_bonus.php b/show_bonus.php index ff3545d61b..5144df314e 100644 --- a/show_bonus.php +++ b/show_bonus.php @@ -128,12 +128,6 @@ LIMIT 1", $content['message'] = '{--BONUS_SHOW_WRONG_CALL--}'; } -// Load send_bonus header template (for your banners, e.g.?) -$content['header'] = loadTemplate('show_bonus_header', TRUE); - -// Load show_bonus footer template (for your banners, e.g.?) -$content['footer'] = loadTemplate('show_bonus_footer', TRUE); - // Load final template loadTemplate('show_bonus', FALSE, $content); diff --git a/templates/de/emails/admin/admin_rallye_expired.tpl b/templates/de/emails/admin/admin_rallye_expired.tpl index ae62686978..cd353d50aa 100644 --- a/templates/de/emails/admin/admin_rallye_expired.tpl +++ b/templates/de/emails/admin/admin_rallye_expired.tpl @@ -15,8 +15,8 @@ Es wurden bereits alle {%pipe,translateComma=$content[count]%} Gewinner informie Wichtige Hinweise: ----------------------------- -- $content[min_users] -- $content[min_prices] +- {%pipe,determineReferralRallyeMinimumUsers=$content[min_users]%} +- {%pipe,determineReferralRallyeMinimumPrices=$content[min_prices]%} ----------------------------- Mit freundlichen Grüßen, diff --git a/templates/de/emails/member/member_rallye_expired_bronce.tpl b/templates/de/emails/member/member_rallye_expired_bronce.tpl index 5a71e7036c..c820c85c27 100644 --- a/templates/de/emails/member/member_rallye_expired_bronce.tpl +++ b/templates/de/emails/member/member_rallye_expired_bronce.tpl @@ -24,8 +24,8 @@ Wir bedanken uns für Ihre Bemühungen und Interesse an unserer Rallye u Wichtige Hinweise: ----------------------------- - Es werden nur aktive User gewertet. Der Rechtsweg ist ausgeschlossen. -- $content[min_users] -- $content[min_prices] +- {%pipe,determineReferralRallyeMinimumUsers=$content[min_users]%} +- {%pipe,determineReferralRallyeMinimumPrices=$content[min_prices]%} ----------------------------- Mit freundlichen Grüßen, diff --git a/templates/de/emails/member/member_rallye_expired_gold.tpl b/templates/de/emails/member/member_rallye_expired_gold.tpl index cd9e0532a1..3064bf82a0 100644 --- a/templates/de/emails/member/member_rallye_expired_gold.tpl +++ b/templates/de/emails/member/member_rallye_expired_gold.tpl @@ -24,8 +24,8 @@ Wir bedanken uns für Ihre Bemühungen und Interesse an unserer Rallye u Wichtige Hinweise: ----------------------------- - Es werden nur aktive User gewertet. Der Rechtsweg ist ausgeschlossen. -- $content[min_users] -- $content[min_prices] +- {%pipe,determineReferralRallyeMinimumUsers=$content[min_users]%} +- {%pipe,determineReferralRallyeMinimumPrices=$content[min_prices]%} ----------------------------- Mit freundlichen Grüßen, diff --git a/templates/de/emails/member/member_rallye_expired_other.tpl b/templates/de/emails/member/member_rallye_expired_other.tpl index 0c04110389..da65390a52 100644 --- a/templates/de/emails/member/member_rallye_expired_other.tpl +++ b/templates/de/emails/member/member_rallye_expired_other.tpl @@ -24,8 +24,8 @@ Wir bedanken uns für Ihre Bemühungen und Interesse an unserer Rallye u Wichtige Hinweise: -------------------------------- - Es werden nur aktive User gewertet. Der Rechtsweg ist ausgeschlossen. -- $content[min_users] -- $content[min_prices] +- {%pipe,determineReferralRallyeMinimumUsers=$content[min_users]%} +- {%pipe,determineReferralRallyeMinimumPrices=$content[min_prices]%} -------------------------------- Mit freundlichen Grüßen, diff --git a/templates/de/emails/member/member_rallye_expired_silver.tpl b/templates/de/emails/member/member_rallye_expired_silver.tpl index 0b137e657d..aca5f2d902 100644 --- a/templates/de/emails/member/member_rallye_expired_silver.tpl +++ b/templates/de/emails/member/member_rallye_expired_silver.tpl @@ -24,8 +24,8 @@ Wir bedanken uns für Ihre Bemühungen und Interesse an unserer Rallye u Wichtige Hinweise: ----------------------------- - Es werden nur aktive User gewertet. Der Rechtsweg ist ausgeschlossen. -- $content[min_users] -- $content[min_prices] +- {%pipe,determineReferralRallyeMinimumUsers=$content[min_users]%} +- {%pipe,determineReferralRallyeMinimumPrices=$content[min_prices]%} ----------------------------- Mit freundlichen Grüßen, diff --git a/templates/de/html/admin/admin_list_country.tpl b/templates/de/html/admin/admin_list_country.tpl index 06bfca9803..cdce09fa3a 100644 --- a/templates/de/html/admin/admin_list_country.tpl +++ b/templates/de/html/admin/admin_list_country.tpl @@ -29,5 +29,5 @@ $content[rows]
- $content[add_form] + {%template,LoadTemplate=admin_add_country%}
diff --git a/templates/de/html/admin/admin_list_rallyes_row.tpl b/templates/de/html/admin/admin_list_rallyes_row.tpl index d54281012c..dd4f4076e4 100644 --- a/templates/de/html/admin/admin_list_rallyes_row.tpl +++ b/templates/de/html/admin/admin_list_rallyes_row.tpl @@ -61,10 +61,10 @@ {--ADMIN_RALLYE_MIN_USERS_MINI--}:
- $content[min_users] + {%pipe,determineReferralRallyeMinimumUsers=$content[min_users]%} {--ADMIN_RALLYE_MIN_PRICES_MINI--}:
- $content[min_prices] + {%pipe,determineReferralRallyeMinimumPrices=$content[min_prices]%} diff --git a/templates/de/html/admin/admin_sponsor_paytypes.tpl b/templates/de/html/admin/admin_sponsor_paytypes.tpl index b4e0e59874..fbfc6331cd 100644 --- a/templates/de/html/admin/admin_sponsor_paytypes.tpl +++ b/templates/de/html/admin/admin_sponsor_paytypes.tpl @@ -3,6 +3,6 @@ $content[list_out]
- $content[add_out] + {%template,LoadTemplate=admin_add_sponsor_paytype%}
diff --git a/templates/de/html/beg/beg_link.tpl b/templates/de/html/beg/beg_link.tpl index e3f8caae2d..cc215f5ad9 100644 --- a/templates/de/html/beg/beg_link.tpl +++ b/templates/de/html/beg/beg_link.tpl @@ -2,7 +2,7 @@ @@ -28,7 +28,7 @@
-
$content[header_banner]
+
{%template,LoadTemplate=beg_header_banner%}
-
$content[footer_banner]
+
{%template,LoadTemplate=beg_footer_banner%}
diff --git a/templates/de/html/birthday/birthday_confirm.tpl b/templates/de/html/birthday/birthday_confirm.tpl index eba8d27d63..8d0be0c8c8 100644 --- a/templates/de/html/birthday/birthday_confirm.tpl +++ b/templates/de/html/birthday/birthday_confirm.tpl @@ -1,7 +1,7 @@ @@ -11,7 +11,7 @@
- $content[header] + {%template,LoadTemplate=birthday_header%}
- $content[footer] + {%template,LoadTemplate=birthday_footer%}
diff --git a/templates/de/html/guest/guest_register.tpl b/templates/de/html/guest/guest_register.tpl index e23df8a14b..f4416deac2 100644 --- a/templates/de/html/guest/guest_register.tpl +++ b/templates/de/html/guest/guest_register.tpl @@ -3,7 +3,7 @@ diff --git a/templates/de/html/show_bonus.tpl b/templates/de/html/show_bonus.tpl index eba8d27d63..db8ce2b2ab 100644 --- a/templates/de/html/show_bonus.tpl +++ b/templates/de/html/show_bonus.tpl @@ -1,7 +1,7 @@
- $content[header_content] + {%template,LoadTemplate=register_header%}
@@ -11,7 +11,7 @@
- $content[header] + {%template,LoadTemplate=show_bonus_header%}
- $content[footer] + {%template,LoadTemplate=show_bonus_footer%}
diff --git a/templates/de/html/sponsor/sponsor_main.tpl b/templates/de/html/sponsor/sponsor_main.tpl index 5712bde4bc..72dfd97067 100644 --- a/templates/de/html/sponsor/sponsor_main.tpl +++ b/templates/de/html/sponsor/sponsor_main.tpl @@ -2,7 +2,7 @@ @@ -16,7 +16,7 @@ -- 2.39.5