Fixes and further rewrites to make use of EL
authorRoland Häder <roland@mxchange.org>
Tue, 29 Jun 2010 04:00:23 +0000 (04:00 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 29 Jun 2010 04:00:23 +0000 (04:00 +0000)
25 files changed:
inc/expression-functions.php
inc/functions.php
inc/js/js-surfbar_stopped.php
inc/language/de.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_refback.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-del_user.php
inc/modules/admin/what-list_user.php
inc/modules/member/what-mydata.php
inc/modules/member/what-unconfirmed.php
inc/mysql-manager.php
inc/template-functions.php
templates/de/emails/confirm-referral.tpl
templates/de/html/admin/admin_config_refback.tpl
templates/de/html/admin/admin_del_user.tpl
templates/de/html/js/js_surfbar_stopped.tpl
templates/de/html/login_failures.tpl
templates/de/html/member/member_mydata_edit.tpl
templates/de/html/member/member_mydata_overview.tpl
templates/de/html/member/member_unconfirmed_row.tpl
templates/de/html/member/member_unconfirmed_row_nopoints.tpl
templates/de/html/select/select_network_box.tpl
templates/de/html/select/select_network_type_box.tpl
templates/de/html/select/select_network_type_title_box.tpl

index d44b587..458dd17 100644 (file)
@@ -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}";
index 5f62c27..90dbe1d 100644 (file)
@@ -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}<br />");
                        $content = array(
-                               'login_failures' => getSession('mailer_' . $accessLevel . '_failures'),
+                               'login_failures' => 'mailer_' . $accessLevel . '_failures',
                                'last_failure'   => generateDateTime(getSession('mailer_' . $accessLevel . '_last_failure'), 2)
                        );
 
index ba2ef1e..91ac6e2 100644 (file)
@@ -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]
 ?>
index 99e10a3..3bbccbb 100644 (file)
@@ -1185,8 +1185,8 @@ addMessages(array(
        'ADMIN_STATUS_CHANGED' => "Es wurden <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Eintr&auml;gen ge&auml;ndert.",
 
 // Missing menu entries
-       'MENU_ACTION_404' => "Hauptmen&uuml; deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.",
-       'MENU_WHAT_404' => "Untermen&uuml; deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.",
+       'MENU_ACTION_404' => "Hauptmen&uuml; %s deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.",
+       'MENU_WHAT_404' => "Untermen&uuml; %s deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.",
 
 // Cache messages
        'CACHE_PROBLEMS_DETECTED' => "Probleme mit dem Cache-Subsystem erkannt.",
index 5adf74d..3096cd9 100644 (file)
@@ -289,7 +289,7 @@ ORDER BY
                                                $OUT .= '[<a href="{%url=modules.php?module=admin&amp;action=' . $menu . '%}">';
                                        }
                                } else {
-                                       $OUT .= '<em style="cursor:help" class="admin_note" title="{--MENU_ACTION_404--}">';
+                                       $OUT .= '<em style="cursor:help" class="admin_note" title="{%message,MENU_ACTION_404=' . $menu . '}">';
                                }
 
                                $OUT .= $title;
@@ -359,7 +359,7 @@ ORDER BY
                                                                        $OUT .= '[<a href="{%url=modules.php?module=admin&amp;what=' . $what_sub . '%}">';
                                                                }
                                                        } else {
-                                                               $OUT .= '<em style="cursor:help" class="admin_note" title="{--MENU_WHAT_404--}">';
+                                                               $OUT .= '<em style="cursor:help" class="admin_note" title="{%message,MENU_WHAT_404=' . $what_sub . '%}">';
                                                        }
 
                                                        $OUT .= $title_what;
index a8067b3..1f9d023 100644 (file)
 // 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);
index 9824686..5dc3e19 100644 (file)
@@ -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();
index 0bc3544..874dc11 100644 (file)
@@ -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
index 30943e3..f28d737 100644 (file)
@@ -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
index db81bda..4d55270 100644 (file)
@@ -53,9 +53,7 @@ if ((!isExtensionActive('mydata')) && (!isAdmin())) {
 } // END - if
 
 // Add userid
-$content = array(
-       'userid' => getMemberId()
-);
+$content = array();
 
 // Init variable to prevent notices
 $url = '';
index b0e26fb..48178e2 100644 (file)
@@ -204,7 +204,6 @@ LIMIT 1",
 
                        // Prepare data for template
                        $content = array(
-                               'userid'    => getMemberId(),
                                'data'      => bigintval($DATA),
                                'type'      => $type,
                                'subject'   => $subject,
index 76777e7..ac33024 100644 (file)
@@ -481,7 +481,7 @@ ORDER BY
                                                $OUT .= '<a name="menu" class="menu_blur" href="{%url=modules.php?module=' . getModule() . '&amp;what=' . $content['sub_what'] . '%}" target="_self">';
                                        } else {
                                                // Not found! - open
-                                               $OUT .= '<em style="cursor:help" class="admin_note" title="{--MENU_WHAT_404--}">';
+                                               $OUT .= '<em style="cursor:help" class="admin_note" title="{%message,MENU_WHAT_404=' . $content['sub_what'] . '%}">';
                                        }
 
                                        // 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
index 1733c35..cf0b136 100644 (file)
@@ -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
index f8d0791..8551481 100644 (file)
@@ -4,8 +4,8 @@ Sie haben heute ein neues Mitglied f&uuml;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%}
 -----------------
 
index a2babb9..24e7b65 100644 (file)
@@ -20,7 +20,7 @@
                        {--ADMIN_CONFIG_REFBACK_MIN_PERCENTS--}
                </td>
                <td>
-                       <input type="text" name="refback_min_perc" size="3" maxlength="3" value="$content[refback_min_perc]" />&#37;
+                       <input type="text" name="refback_min_perc" size="3" maxlength="3" value="{%config,translateComma=refback_min_perc%}" />&#37;
                </td>
        </tr>
        <tr>
@@ -28,7 +28,7 @@
                        {--ADMIN_CONFIG_REFBACK_MAX_PERCENTS--}
                </td>
                <td class="bottom">
-                       <input type="text" name="refback_max_perc" size="3" maxlength="3" value="$content[refback_max_perc]" />&#37;
+                       <input type="text" name="refback_max_perc" size="3" maxlength="3" value="{%config,translateComma=refback_max_perc%}" />&#37;
                </td>
        </tr>
        <tr>
index f8231c5..fde122a 100644 (file)
@@ -3,15 +3,15 @@
 
 <div class="admin_table dashed">
        <div align="center" class="admin_title bottom">
-               <strong>$content[header]</strong>
+               <strong>{%message,ADMIN_HEADER_DEL_ACCOUNT=$content[userid]%}</strong>
        </div>
 
        <div align="center">
-               $content[text]
+               {%message,ADMIN_TEXT_DEL_ACCOUNT=$content[userid]%}
        </div>
 
        <div align="center">
-               [&nbsp;<a href="$content[email]">$content[surname] $content[family]</a>&nbsp;]
+               [&nbsp;<a href="$content[email]">{%user,surname=$content[userid]%} {%user,family=$content[userid]%}</a>&nbsp;]
        </div>
 
        <div class="bottom" align="center">
index 003585d..5bd1175 100644 (file)
@@ -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();
index 7cce8b0..fb8d276 100644 (file)
@@ -3,7 +3,7 @@
        <div class="login_failure_header">
                Warnung!
        </div>
-       Letzten <strong>$content[login_failures]</strong> Loginversuche waren
+       Letzten <strong>{%pipe,getSession=$content[login_failures]%}</strong> Loginversuche waren
        fehlgeschlagen, der letzte war am <strong>$content[last_failure]</strong>
 </div>
 </div>
index 849ad87..3c68cfa 100644 (file)
@@ -3,7 +3,7 @@
 <table border="0" cellspacing="0" cellpadding="0" class="member_table dashed">
        <tr>
                <td class="header_column bottom" colspan="2">
-                       <strong>{--YOUR_LOGIN--}: $content[userid]</strong>
+                       <strong>{--YOUR_LOGIN--}: {%pipe,getMemberId%}</strong>
                </td>
        </tr>
        <tr>
index abb8ea0..5e2fbe2 100644 (file)
@@ -7,7 +7,7 @@
        </tr>
        <tr>
                <td align="right">{--YOUR_LOGIN--}:</td>
-               <td><strong>$content[userid]</strong></td>
+               <td><strong>{%pipe,getMemberId%}</strong></td>
        </tr>
        <tr>
                <td align="right">{--GENDER--}:</td>
index ca8899e..bc4b094 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
-               [<a href="{%url=mailid.php?userid=$content[userid]&amp;$content[type]=$content[data]%}" target="_blank" title="{--CONFIRM_LINK--}">$content[data]</a>]
+               [<a href="{%url=mailid.php?userid={%pipe,getMemberId%}&amp;$content[type]=$content[data]%}" target="_blank" title="{--CONFIRM_LINK--}">$content[data]</a>]
        </td>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
                $content[sender]
index d991787..699d0e6 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
-               [<a href="{%url=mailid.php?userid=$content[userid]&amp;$content[type]=$content[data]%}"
+               [<a href="{%url=mailid.php?userid={%pipe,getMemberId%}&amp;$content[type]=$content[data]%}"
                 target="_blank" title="{--CONFIRM_LINK--}">$content[data]</a>]
        </td>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
index 66f71e3..2f67a1a 100644 (file)
@@ -1,7 +1,7 @@
 <div align="center">
 <form accept-charset="utf-8" action="{?URL?}/modules.php" method="get">
-<input type="hidden" name="module" value="$content[module]" />
-<input type="hidden" name="what" value="$content[what]" />
+<input type="hidden" name="module" value="{%pipe,getModule%}" />
+<input type="hidden" name="what" value="{%pipe,getWhat%}" />
 <div class="admin_table dashed">
        <div class="admin_title bottom">
                <strong>{--ADMIN_NETWORK_SELECT_TITLE--}</strong>
index 21c5134..4a97598 100644 (file)
@@ -1,7 +1,7 @@
 <div align="center">
 <form accept-charset="utf-8" action="{?URL?}/modules.php" method="get">
-<input type="hidden" name="module" value="$content[module]" />
-<input type="hidden" name="what" value="$content[what]" />
+<input type="hidden" name="module" value="{%pipe,getModule%}" />
+<input type="hidden" name="what" value="{%pipe,getWhat%}" />
 <input type="hidden" name="network" value="{%network,getNetworkDataById,network_id=%network%%}" />
 <div class="admin_table dashed">
        <div class="admin_title bottom">
index f6fced3..67d84a3 100644 (file)
@@ -1,7 +1,7 @@
 <div align="center">
 <form accept-charset="utf-8" action="{?URL?}/modules.php" method="get">
-<input type="hidden" name="module" value="$content[module]" />
-<input type="hidden" name="what" value="$content[what]" />
+<input type="hidden" name="module" value="{%pipe,getModule%}" />
+<input type="hidden" name="what" value="{%pipe,getWhat%}" />
 <div class="admin_table dashed">
        <div class="admin_title bottom">
                <div>