]> git.mxchange.org Git - mailer.git/commitdiff
Fix/rewrites for if 'value' is '0' (not empty)
authorRoland Häder <roland@mxchange.org>
Mon, 27 Sep 2010 03:33:07 +0000 (03:33 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 27 Sep 2010 03:33:07 +0000 (03:33 +0000)
inc/expression-functions.php
inc/filters.php
inc/language-functions.php
inc/language/de.php
inc/modules/member/what-bonus.php
templates/de/html/member/member_ref_list_level.tpl
templates/de/html/member/member_refback_list_level.tpl

index c923b069b9c381d994253f820ce72471fe772eee..dd533a27a7cbcbc53ec6874c9eb99b024ae8c3d9 100644 (file)
@@ -188,7 +188,8 @@ function doExpressionPipe ($data) {
        if (!empty($data['callback'])) {
                //if ($data['callback'] == 'getMemberId') die('<pre>'.encodeEntities(print_r($data, true)).'</pre>');
                // If the value is empty, we don't add it
-               if (empty($data['value'])) {
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value[' . gettype($data['value']) . ']=' . $data['value']);
+               if ((empty($data['value'])) && ($data['value'] != '0')) {
                        // No value is set
                        $replacer = '{DQUOTE} . ' . $data['extra_func2'] . '(' . $data['extra_func'] . '(' . $data['callback'] . '())) . {DQUOTE}';
                } else {
index aece47961aae64b77d8563e3f4fe531bb8f7a88a..d05ec3d5e1999ef350b71dff38c53adbfc6ec4c0 100644 (file)
@@ -469,7 +469,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                        $callback       = '';
                        $extraFunction  = '';
                        $extraFunction2 = '';
-                       $value          = '';
+                       $value          = null;
 
                        // Extract command and call-back
                        $cmdArray = explode(',', $cmd);
index 58a308f09b656dd20f9fa5c8dc7859cb993954f7..ce44f5849d69f3af7bc454936d8ec38eb4567ab9 100644 (file)
@@ -61,7 +61,11 @@ function getMessage ($messageId) {
 
 // Getter for message string as a mask
 function getMaskedMessage ($messageId, $data) {
-       return sprintf(getMessage($messageId), $data);
+       // Construct message
+       $message = sprintf(getMessage($messageId), $data);
+
+       // Return it
+       return $message;
 }
 
 // Init messages
@@ -71,17 +75,22 @@ function initMessages () {
 
 // Add messages
 function addMessages ($messages) {
+       // Cache current language
+       $currentLanguage = getCurrentLanguage();
+
        // Merge both
-       $GLOBALS['messages'][getCurrentLanguage()] = merge_array($GLOBALS['messages'][getCurrentLanguage()], $messages);
+       $GLOBALS['messages'][$currentLanguage] = merge_array($GLOBALS['messages'][$currentLanguage], $messages);
 
        // Don't count them if we don't want it
-       if (isset($GLOBALS['count'])) return;
+       if (isset($GLOBALS['count'])) {
+               return;
+       } // END - if
 
        // And count them
-       if (isset($GLOBALS['msg_count'][getCurrentLanguage()])) {
-               $GLOBALS['msg_count'][getCurrentLanguage()] += count($messages);
+       if (isset($GLOBALS['msg_count'][$currentLanguage])) {
+               $GLOBALS['msg_count'][$currentLanguage] += count($messages);
        } else {
-               $GLOBALS['msg_count'][getCurrentLanguage()] = count($messages);
+               $GLOBALS['msg_count'][$currentLanguage] = count($messages);
        }
 }
 
index da72a748240608d8e9c8e93fc4d27b2dcc2ad026..6c32c022721ec990e17c9ac05f36ef22c5bc6511 100644 (file)
@@ -1105,7 +1105,7 @@ addMessages(array(
        'MEMBER_REFLIST_LIST_TITLE_1' => "Ihre Referals in Ebene <u>",
        'MEMBER_REFLIST_LIST_TITLE_2' => "</u> (<u>",
        'MEMBER_REFLIST_LIST_TITLE_3' => "&#37;</u>)",
-       'MEMBER_REFLIST_COUNTER' => "In dieser Ebene haben Sie <span class=\"data\">%s</span> Mitglieder geworben.",
+       'MEMBER_REFLIST_COUNTER' => "In dieser Ebene haben Sie <span class=\"data\">{%%pipe,translateComma=%s%%}</span> Mitglieder geworben.",
        'MEMBER_REFLIST_TITLE' => "Referal-&Uuml;bersicht",
        'MEMBER_REFLIST_POINTS' => "Verdienst des Mitgliedes",
        'MEMBER_REFLIST_ACTIVITY' => "Mitglied aktiv?",
index f14026eb67e7a9f5e9f3a54b2c7cd2b8d99dfebf..7d878dc980dc56eb764db84f49ab90b452734a8b 100644 (file)
@@ -97,12 +97,8 @@ if (!SQL_HASZERONUMS($result)) {
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the template
-               $content = array(
-                       'cnt'         => $cnt,
-                       'userid'      => $content['userid'],
-                       'points'      => $content['points'],
-                       'last_online' => generateDateTime($content['last_online'], 2)
-               );
+               $content['cnt']         = $cnt;
+               $content['last_online'] = generateDateTime($content['last_online'], 2);
 
                // Load row template
                $OUT .= loadTemplate('member_bonus_row', true, $content);
index 11d4c67d294aeec687892a5314fc89c3794da024..efc01c0ef8fee4fe60928b772c41785f350a1a69 100644 (file)
@@ -29,7 +29,7 @@
 $content[rows]
 <tr>
        <td align="center" class="table_footer" colspan="6">
-               <span class="notice">{%message,MEMBER_REFLIST_COUNTER={%pipe,translateComma=$content[counter]%}%}</span>
+               <span class="notice">{%message,MEMBER_REFLIST_COUNTER=$content[counter]%}</span>
        </td>
 </tr>
 </table>
index cd7abfd7cb85e7a6bc499291c5c9c24a2393c8f1..604e7181cab35292a34b40988d2f2063e2f62893 100644 (file)
@@ -28,7 +28,7 @@
 $content[rows]
 <tr>
        <td align="center" class="table_footer" colspan="6">
-               <span class="notice">{%message,MEMBER_REFLIST_COUNTER={%pipe,translateComma=$content[counter]%}%}</span>
+               <span class="notice">{%message,MEMBER_REFLIST_COUNTER=$content[counter]%}</span>
        </td>
 </tr>
 </table>