]> git.mxchange.org Git - mailer.git/commitdiff
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 d44b587edd383f13af1092c55121bfb839e7940b..458dd1792c3a244f790bc723f3aca25b71d662a4 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 5f62c273416bde14d01b56aa74fa8dd90ab813cf..90dbe1d5e69a801bdd4c84ff4d95f7f4b2ba407a 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 ba2ef1eeac94f67c8544901bd67568f3845278a7..91ac6e25f816c014086a64d1d6c8814756d734e5 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 99e10a302ce19ccd3e57f521bb8e9a728ea8f62b..3bbccbb6858f490cf637242ad62a581063ab3275 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 5adf74d855828a3b247f18ddd211ec1eaf9d6bbf..3096cd930e2108f56d2813f79f761ab533971c86 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 a8067b36ad7da8a2a67d4dcdffbc3e3b8e875f6d..1f9d0230725b085996ec0166ce965bb0f7e910e4 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 9824686b1b1a8cfa0ad82196413c575041bff7e6..5dc3e197b3569c7e8533ed5a42e987521fd6b419 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 0bc3544533c7ca1a3fc2bdcc29f6dc1c3625fcca..874dc11c6e281ec1dec5de208197141f497ac446 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 30943e37a68e34bb4ee8d7ab16edc6cea0a80bd8..f28d7376d336279cc8f9534d5249d2c826795d7c 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 db81bda1d978499ef228e7bf6a029c82875c68cb..4d55270d0eb26c2c1215020c482b14c5ac5d622b 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 b0e26fb04e5e041dd86eaeeac555f1fb2125af2a..48178e2cfe4c32670163ab66bbc227bc6c359e81 100644 (file)
@@ -204,7 +204,6 @@ LIMIT 1",
 
                        // Prepare data for template
                        $content = array(
-                               'userid'    => getMemberId(),
                                'data'      => bigintval($DATA),
                                'type'      => $type,
                                'subject'   => $subject,
index 76777e7f007512cb7df91fb3faf5e9eeed9b5de0..ac33024157fe66bd8571ab9c771c204517f1512e 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 1733c35b7ee11aba60a59a3f32e8259b806f6cae..cf0b136f4d0d2d75ee90ccd32fb72c70da1a8aca 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 f8d0791afacac74aad928a6fd9dc4dac1535e373..855148178f1ed341961b35399095ce2719307b5b 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 a2babb91319917f826266e24febd132e7fc6a41b..24e7b658b4fe52d13ca16a4e442c6009ac657c1a 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 f8231c5ee48b8a3aa7e556510a1dc99ffbef420a..fde122af559bd501b92102b1526d81f7f649251d 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 003585d4a61f5de5314e42001588c727ba5fceac..5bd1175d84c0fdac904ec6d006ee093abd008616 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 7cce8b08c9729de362cc1518778fd0f14b13879d..fb8d2762abf9fef211a0ea4dbda3e876c14355e9 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 849ad87694290a56dbecdc0b7a2c98610c5cdbb9..3c68cfa704c870d407669d3476caf7a2bc30684b 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 abb8ea0cb70de94f1e82a34b32323b06ae2fee23..5e2fbe25e7e63293792ae5c227654350c8bb966c 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 ca8899ec41ac0762e383da2a7d5e3aeba289f0f3..bc4b09422f54e8f9247cc352a7bd82723596a69b 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 d99178748b015fa88cc64852769b0cd8b4a45fb8..699d0e6b877ccd9b04363fce9c5ab7e075b866d7 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 66f71e3f78e475e630fba75be77e03f9f72ec4f3..2f67a1a5a3132e22a892347d878507d119b3ff80 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 21c51343bf3b6ac7e54a6c97b51bda5612601318..4a975983ccf1408849865d67cb6042df05568903 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 f6fced34e936342353f09f71b26b7e8b55cf0edb..67d84a3fd24ad4900e0c6aaac7333fa11d35ac95 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>