From: Roland Häder Date: Mon, 27 Sep 2010 03:33:07 +0000 (+0000) Subject: Fix/rewrites for if 'value' is '0' (not empty) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=21f7b63f7fa3e92ef44510a080ec05709fd41417;p=mailer.git Fix/rewrites for if 'value' is '0' (not empty) --- diff --git a/inc/expression-functions.php b/inc/expression-functions.php index c923b069b9..dd533a27a7 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -188,7 +188,8 @@ function doExpressionPipe ($data) { if (!empty($data['callback'])) { //if ($data['callback'] == 'getMemberId') die('
'.encodeEntities(print_r($data, true)).'
'); // 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 { diff --git a/inc/filters.php b/inc/filters.php index aece47961a..d05ec3d5e1 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -469,7 +469,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) { $callback = ''; $extraFunction = ''; $extraFunction2 = ''; - $value = ''; + $value = null; // Extract command and call-back $cmdArray = explode(',', $cmd); diff --git a/inc/language-functions.php b/inc/language-functions.php index 58a308f09b..ce44f5849d 100644 --- a/inc/language-functions.php +++ b/inc/language-functions.php @@ -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); } } diff --git a/inc/language/de.php b/inc/language/de.php index da72a74824..6c32c02272 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1105,7 +1105,7 @@ addMessages(array( 'MEMBER_REFLIST_LIST_TITLE_1' => "Ihre Referals in Ebene ", 'MEMBER_REFLIST_LIST_TITLE_2' => " (", 'MEMBER_REFLIST_LIST_TITLE_3' => "%)", - 'MEMBER_REFLIST_COUNTER' => "In dieser Ebene haben Sie %s Mitglieder geworben.", + 'MEMBER_REFLIST_COUNTER' => "In dieser Ebene haben Sie {%%pipe,translateComma=%s%%} Mitglieder geworben.", 'MEMBER_REFLIST_TITLE' => "Referal-Übersicht", 'MEMBER_REFLIST_POINTS' => "Verdienst des Mitgliedes", 'MEMBER_REFLIST_ACTIVITY' => "Mitglied aktiv?", diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index f14026eb67..7d878dc980 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -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); diff --git a/templates/de/html/member/member_ref_list_level.tpl b/templates/de/html/member/member_ref_list_level.tpl index 11d4c67d29..efc01c0ef8 100644 --- a/templates/de/html/member/member_ref_list_level.tpl +++ b/templates/de/html/member/member_ref_list_level.tpl @@ -29,7 +29,7 @@ $content[rows] - {%message,MEMBER_REFLIST_COUNTER={%pipe,translateComma=$content[counter]%}%} + {%message,MEMBER_REFLIST_COUNTER=$content[counter]%} diff --git a/templates/de/html/member/member_refback_list_level.tpl b/templates/de/html/member/member_refback_list_level.tpl index cd7abfd7cb..604e7181ca 100644 --- a/templates/de/html/member/member_refback_list_level.tpl +++ b/templates/de/html/member/member_refback_list_level.tpl @@ -28,7 +28,7 @@ $content[rows] - {%message,MEMBER_REFLIST_COUNTER={%pipe,translateComma=$content[counter]%}%} + {%message,MEMBER_REFLIST_COUNTER=$content[counter]%}