From 55c394034c676bf5815d5fbc38555258ba6a59d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 29 Jun 2010 04:00:23 +0000 Subject: [PATCH] Fixes and further rewrites to make use of EL --- inc/expression-functions.php | 6 ++++++ inc/functions.php | 5 ++++- inc/js/js-surfbar_stopped.php | 8 +------- inc/language/de.php | 4 ++-- inc/modules/admin/admin-inc.php | 4 ++-- inc/modules/admin/what-config_refback.php | 15 ++++++++------- inc/modules/admin/what-config_surfbar.php | 6 +++--- inc/modules/admin/what-del_user.php | 8 ++------ inc/modules/admin/what-list_user.php | 2 +- inc/modules/member/what-mydata.php | 4 +--- inc/modules/member/what-unconfirmed.php | 1 - inc/mysql-manager.php | 3 +-- inc/template-functions.php | 2 -- templates/de/emails/confirm-referral.tpl | 4 ++-- templates/de/html/admin/admin_config_refback.tpl | 4 ++-- templates/de/html/admin/admin_del_user.tpl | 6 +++--- templates/de/html/js/js_surfbar_stopped.tpl | 4 ++-- templates/de/html/login_failures.tpl | 2 +- templates/de/html/member/member_mydata_edit.tpl | 2 +- .../de/html/member/member_mydata_overview.tpl | 2 +- .../de/html/member/member_unconfirmed_row.tpl | 2 +- .../member/member_unconfirmed_row_nopoints.tpl | 2 +- templates/de/html/select/select_network_box.tpl | 4 ++-- .../de/html/select/select_network_type_box.tpl | 4 ++-- .../html/select/select_network_type_title_box.tpl | 4 ++-- 25 files changed, 51 insertions(+), 57 deletions(-) diff --git a/inc/expression-functions.php b/inc/expression-functions.php index d44b587edd..458dd1792c 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -220,10 +220,16 @@ function doExpressionValidatorLinks ($data) { // Expression call-back for dynamic messages function doExpressionMessage ($data) { + // Debug message + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callback=' . $data['callback'] . ',extra_func=' . $data['extra_func'] . ',value=' . $data['value']); + // Message string replacement depends on if message is masked if ((isMessageMasked($data['callback'])) && ((!empty($data['extra_func'])) || ($data['extra_func'] == '0'))) { // Message should be masked $replacer = "{DQUOTE} . getMaskedMessage('" . $data['callback'] . "', '" . $data['extra_func'] . "') . {DQUOTE}"; + } elseif (!empty($data['value'])) { + // value is set, so it is masked message + $replacer = "{DQUOTE} . getMaskedMessage('" . $data['callback'] . "', '" . $data['value'] . "') . {DQUOTE}"; } else { // Regular message $replacer = "{DQUOTE} . getMessage('" . $data['callback'] . "') . {DQUOTE}"; diff --git a/inc/functions.php b/inc/functions.php index 5f62c27341..90dbe1d5e6 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -515,6 +515,9 @@ function makeTime ($hours, $minutes, $seconds, $stamp) { // Redirects to an URL and if neccessarry extends it with own base URL function redirectToUrl ($URL, $allowSpider = true) { + // Remove {%url= + if (substr($URL, 0, 6) == '{%url=') $URL = substr($URL, 6, -2); + // Compile out codes eval('$URL = "' . compileRawCode(encodeUrl($URL)) . '";'); @@ -1768,7 +1771,7 @@ function handleLoginFailures ($accessLevel) { // Non-guest has login failures found, get both data and prepare it for template //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "accessLevel={$accessLevel}
"); $content = array( - 'login_failures' => getSession('mailer_' . $accessLevel . '_failures'), + 'login_failures' => 'mailer_' . $accessLevel . '_failures', 'last_failure' => generateDateTime(getSession('mailer_' . $accessLevel . '_last_failure'), 2) ); diff --git a/inc/js/js-surfbar_stopped.php b/inc/js/js-surfbar_stopped.php index ba2ef1eeac..91ac6e25f8 100644 --- a/inc/js/js-surfbar_stopped.php +++ b/inc/js/js-surfbar_stopped.php @@ -44,14 +44,8 @@ if (!defined('__SECURITY')) { return; } -// Prepare content -$content = array( - 'restart' => bigintval(getRequestParameter('restart')), - 'autostart' => getRequestParameter('autostart') -); - // Load template -loadTemplate('js_surfbar_stopped', false, $content); +loadTemplate('js_surfbar_stopped'); // [EOF] ?> diff --git a/inc/language/de.php b/inc/language/de.php index 99e10a302c..3bbccbb685 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1185,8 +1185,8 @@ addMessages(array( 'ADMIN_STATUS_CHANGED' => "Es wurden %s von %s Einträgen geändert.", // Missing menu entries - 'MENU_ACTION_404' => "Hauptmenü deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.", - 'MENU_WHAT_404' => "Untermenü deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.", + 'MENU_ACTION_404' => "Hauptmenü %s deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.", + 'MENU_WHAT_404' => "Untermenü %s deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.", // Cache messages 'CACHE_PROBLEMS_DETECTED' => "Probleme mit dem Cache-Subsystem erkannt.", diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 5adf74d855..3096cd930e 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -289,7 +289,7 @@ ORDER BY $OUT .= '['; } } else { - $OUT .= ''; + $OUT .= ''; } $OUT .= $title; @@ -359,7 +359,7 @@ ORDER BY $OUT .= '['; } } else { - $OUT .= ''; + $OUT .= ''; } $OUT .= $title_what; diff --git a/inc/modules/admin/what-config_refback.php b/inc/modules/admin/what-config_refback.php index a8067b36ad..1f9d023072 100644 --- a/inc/modules/admin/what-config_refback.php +++ b/inc/modules/admin/what-config_refback.php @@ -40,22 +40,23 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!isAdmin())) { die(); -} +} // END - if // Add description as navigation point addMenuDescription('admin', __FILE__); if (isFormSent()) { + // Replace german decimal comma with computer decimal dot + if (isPostRequestParameterSet('refback_min_perc')) setPostRequestParameter('refback_min_perc', convertCommaToDot(postRequestParameter('refback_min_perc'))); + if (isPostRequestParameterSet('refback_max_perc')) setPostRequestParameter('refback_max_perc', convertCommaToDot(postRequestParameter('refback_max_perc'))); + // Save configuration adminSaveSettingsFromPostData(); } else { // Prepare content - $content = array( - 'refback_min_perc' => getConfig(('refback_min_perc')), - 'refback_max_perc' => getConfig(('refback_max_perc')) - ); + $content = array(); - // Add more content + // Translate Y/N switches switch (getConfig('refback_enabled')) { case 'Y': // Refback enabled $content['refback_enabled_y'] = ' checked="checked"'; @@ -66,7 +67,7 @@ if (isFormSent()) { $content['refback_enabled_y'] = ''; $content['refback_enabled_n'] = ' checked="checked"'; break; - } + } // END - switch // Load template loadTemplate('admin_config_refback', false, $content); diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index 9824686b1b..5dc3e197b3 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -48,9 +48,9 @@ addMenuDescription('admin', __FILE__); // Was the form submitted? if (isFormSent()) { // Replace german decimal comma with computer decimal dot - if (isPostRequestParameterSet(('surfbar_static_reward'))) setPostRequestParameter('surfbar_static_reward' , convertCommaToDot(postRequestParameter('surfbar_static_reward'))); - if (isPostRequestParameterSet(('surfbar_static_costs'))) setPostRequestParameter('surfbar_static_costs' , convertCommaToDot(postRequestParameter('surfbar_static_costs'))); - if (isPostRequestParameterSet(('surfbar_dynamic_percent'))) setPostRequestParameter('surfbar_dynamic_percent', convertCommaToDot(postRequestParameter('surfbar_dynamic_percent'))); + if (isPostRequestParameterSet('surfbar_static_reward')) setPostRequestParameter('surfbar_static_reward' , convertCommaToDot(postRequestParameter('surfbar_static_reward'))); + if (isPostRequestParameterSet('surfbar_static_costs')) setPostRequestParameter('surfbar_static_costs' , convertCommaToDot(postRequestParameter('surfbar_static_costs'))); + if (isPostRequestParameterSet('surfbar_dynamic_percent')) setPostRequestParameter('surfbar_dynamic_percent', convertCommaToDot(postRequestParameter('surfbar_dynamic_percent'))); // Save settings adminSaveSettingsFromPostData(); diff --git a/inc/modules/admin/what-del_user.php b/inc/modules/admin/what-del_user.php index 0bc3544533..874dc11c6e 100644 --- a/inc/modules/admin/what-del_user.php +++ b/inc/modules/admin/what-del_user.php @@ -69,12 +69,8 @@ if ((isFormSent()) || ((isFormSent('del')) && (isPostRequestParameterSet(('reaso if (fetchUserData(getRequestParameter('userid'))) { // Prepare content $content = array( - 'email' => generateEmailLink(getUserData('email'), 'user_data'), - 'surname' => getUserData('surname'), - 'family' => getUserData('family'), - 'header' => getMaskedMessage('ADMIN_HEADER_DEL_ACCOUNT', bigintval(getRequestParameter('userid'))), - 'text' => getMaskedMessage('ADMIN_TEXT_DEL_ACCOUNT', bigintval(getRequestParameter('userid'))), - 'userid' => bigintval(getRequestParameter('userid')) + 'email' => generateEmailLink(getUserData('email'), 'user_data'), + 'userid' => bigintval(getRequestParameter('userid')) ); // Display form diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 30943e37a6..f28d7376d3 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -99,7 +99,7 @@ if (isGetRequestParameterSet('userid')) { // Does the account exists? $result_user = SQL_QUERY_ESC("SELECT - `gender`, `surname`, `family`, `street_nr`, `zip`, `city`, `country`, `email`, `birth_day`, `birth_month`, `birth_year`, `max_mails`, `receive_mails`, `refid`, `status`, `REMOTE_ADDR`, `last_online`, `last_module`, `ref_clicks`, `total_logins`, `used_points`, `emails_sent`, `joined`, `last_update`, `last_profile_sent`, `notified`, `ref_payout`, `emails_received`, `mails_confirmed`".$MORE." + `userid`, `gender`, `surname`, `family`, `street_nr`, `zip`, `city`, `country`, `email`, `birth_day`, `birth_month`, `birth_year`, `max_mails`, `receive_mails`, `refid`, `status`, `REMOTE_ADDR`, `last_online`, `last_module`, `ref_clicks`, `total_logins`, `used_points`, `emails_sent`, `joined`, `last_update`, `last_profile_sent`, `notified`, `ref_payout`, `emails_received`, `mails_confirmed`".$MORE." FROM `{?_MYSQL_PREFIX?}_user_data` WHERE diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index db81bda1d9..4d55270d0e 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -53,9 +53,7 @@ if ((!isExtensionActive('mydata')) && (!isAdmin())) { } // END - if // Add userid -$content = array( - 'userid' => getMemberId() -); +$content = array(); // Init variable to prevent notices $url = ''; diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index b0e26fb04e..48178e2cfe 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -204,7 +204,6 @@ LIMIT 1", // Prepare data for template $content = array( - 'userid' => getMemberId(), 'data' => bigintval($DATA), 'type' => $type, 'subject' => $subject, diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 76777e7f00..ac33024157 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -481,7 +481,7 @@ ORDER BY $OUT .= ''; } else { // Not found! - open - $OUT .= ''; + $OUT .= ''; } // Menu title @@ -1300,7 +1300,6 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify 'percents' => $per, 'level' => bigintval($GLOBALS['ref_level']), 'points' => $ref_points, - 'refid' => getUserData('refid') ); // Load email template diff --git a/inc/template-functions.php b/inc/template-functions.php index 1733c35b7e..cf0b136f4d 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -1600,8 +1600,6 @@ function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionCo // Prepare output $content = array( 'selection_box' => $OUT, - 'module' => getModule(), - 'what' => getWhat() ); // Load template and return it diff --git a/templates/de/emails/confirm-referral.tpl b/templates/de/emails/confirm-referral.tpl index f8d0791afa..855148178f 100644 --- a/templates/de/emails/confirm-referral.tpl +++ b/templates/de/emails/confirm-referral.tpl @@ -4,8 +4,8 @@ Sie haben heute ein neues Mitglied für {?MAIN_TITLE?} geworben! Hier sehen Sie genau, in welcher Ebene Sie ihn geworben haben: ----------------- -Referal-Ebene ($content[percents]%): $content[level] -{?POINTS?}: $content[points] +Referal-Ebene (translateComma=$content[percents]%}%): $content[level] +{?POINTS?}: {%pipe,translateComma=$content[points]%} ID des Mitgliedes: {%user,refid,bigintval=$userid%} ----------------- diff --git a/templates/de/html/admin/admin_config_refback.tpl b/templates/de/html/admin/admin_config_refback.tpl index a2babb9131..24e7b658b4 100644 --- a/templates/de/html/admin/admin_config_refback.tpl +++ b/templates/de/html/admin/admin_config_refback.tpl @@ -20,7 +20,7 @@ {--ADMIN_CONFIG_REFBACK_MIN_PERCENTS--} - % + % @@ -28,7 +28,7 @@ {--ADMIN_CONFIG_REFBACK_MAX_PERCENTS--} - % + % diff --git a/templates/de/html/admin/admin_del_user.tpl b/templates/de/html/admin/admin_del_user.tpl index f8231c5ee4..fde122af55 100644 --- a/templates/de/html/admin/admin_del_user.tpl +++ b/templates/de/html/admin/admin_del_user.tpl @@ -3,15 +3,15 @@
- $content[header] + {%message,ADMIN_HEADER_DEL_ACCOUNT=$content[userid]%}
- $content[text] + {%message,ADMIN_TEXT_DEL_ACCOUNT=$content[userid]%}
diff --git a/templates/de/html/js/js_surfbar_stopped.tpl b/templates/de/html/js/js_surfbar_stopped.tpl index 003585d4a6..5bd1175d84 100644 --- a/templates/de/html/js/js_surfbar_stopped.tpl +++ b/templates/de/html/js/js_surfbar_stopped.tpl @@ -1,5 +1,5 @@ var interval = null; -var countDown = "$content[restart]"; +var countDown = "{%pipe,getRequestParameter,bigintval=restart%}"; var timer = document.getElementById("surfbar_counter"); var buttonDiv = document.getElementById("surfbar_button"); @@ -13,7 +13,7 @@ function showButton () { function counter () { if (countDown == 0) { - if ($content[autostart] == true) { + if ({%pipe,getRequestParameter=autostart%} == true) { restart(); } else { showButton(); diff --git a/templates/de/html/login_failures.tpl b/templates/de/html/login_failures.tpl index 7cce8b08c9..fb8d2762ab 100644 --- a/templates/de/html/login_failures.tpl +++ b/templates/de/html/login_failures.tpl @@ -3,7 +3,7 @@ - Letzten $content[login_failures] Loginversuche waren + Letzten {%pipe,getSession=$content[login_failures]%} Loginversuche waren fehlgeschlagen, der letzte war am $content[last_failure]
diff --git a/templates/de/html/member/member_mydata_edit.tpl b/templates/de/html/member/member_mydata_edit.tpl index 849ad87694..3c68cfa704 100644 --- a/templates/de/html/member/member_mydata_edit.tpl +++ b/templates/de/html/member/member_mydata_edit.tpl @@ -3,7 +3,7 @@ diff --git a/templates/de/html/member/member_mydata_overview.tpl b/templates/de/html/member/member_mydata_overview.tpl index abb8ea0cb7..5e2fbe25e7 100644 --- a/templates/de/html/member/member_mydata_overview.tpl +++ b/templates/de/html/member/member_mydata_overview.tpl @@ -7,7 +7,7 @@ - + diff --git a/templates/de/html/member/member_unconfirmed_row.tpl b/templates/de/html/member/member_unconfirmed_row.tpl index ca8899ec41..bc4b09422f 100644 --- a/templates/de/html/member/member_unconfirmed_row.tpl +++ b/templates/de/html/member/member_unconfirmed_row.tpl @@ -1,6 +1,6 @@
- {--YOUR_LOGIN--}: $content[userid] + {--YOUR_LOGIN--}: {%pipe,getMemberId%}
{--YOUR_LOGIN--}:$content[userid]{%pipe,getMemberId%}
{--GENDER--}:
- [$content[data]] + [$content[data]] $content[sender] diff --git a/templates/de/html/member/member_unconfirmed_row_nopoints.tpl b/templates/de/html/member/member_unconfirmed_row_nopoints.tpl index d99178748b..699d0e6b87 100644 --- a/templates/de/html/member/member_unconfirmed_row_nopoints.tpl +++ b/templates/de/html/member/member_unconfirmed_row_nopoints.tpl @@ -1,6 +1,6 @@
- [$content[data]] diff --git a/templates/de/html/select/select_network_box.tpl b/templates/de/html/select/select_network_box.tpl index 66f71e3f78..2f67a1a5a3 100644 --- a/templates/de/html/select/select_network_box.tpl +++ b/templates/de/html/select/select_network_box.tpl @@ -1,7 +1,7 @@
- - + +
{--ADMIN_NETWORK_SELECT_TITLE--} diff --git a/templates/de/html/select/select_network_type_box.tpl b/templates/de/html/select/select_network_type_box.tpl index 21c51343bf..4a975983cc 100644 --- a/templates/de/html/select/select_network_type_box.tpl +++ b/templates/de/html/select/select_network_type_box.tpl @@ -1,7 +1,7 @@
- - + +
diff --git a/templates/de/html/select/select_network_type_title_box.tpl b/templates/de/html/select/select_network_type_title_box.tpl index f6fced34e9..67d84a3fd2 100644 --- a/templates/de/html/select/select_network_type_title_box.tpl +++ b/templates/de/html/select/select_network_type_title_box.tpl @@ -1,7 +1,7 @@
- - + +
-- 2.39.5