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 c923b06..dd533a2 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 aece479..d05ec3d 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 58a308f..ce44f58 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 da72a74..6c32c02 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 f14026e..7d878dc 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 11d4c67..efc01c0 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 cd7abfd..604e718 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>