fix 'is even by' and 'is odd by' logic

This commit is contained in:
mohrt
2003-12-11 19:39:02 +00:00
parent e58c2c94cf
commit aa8f02c429
2 changed files with 3 additions and 2 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- fix 'is even by' and 'is odd by' logic (Monte)
- add day_empty, month_empty, year_empty and all_empty attributes to
html_select_date (messju)
- add table of explanation for {if} qualifiers in docs (boots)

View File

@@ -1385,7 +1385,7 @@ class Smarty_Compiler extends Smarty {
if (@$tokens[$expr_end] == 'by') {
$expr_end++;
$expr_arg = $tokens[$expr_end++];
$expr = "!(($is_arg / $expr_arg) % " . $this->_parse_var_props($expr_arg) . ")";
$expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
} else
$expr = "!($is_arg % 2)";
break;
@@ -1394,7 +1394,7 @@ class Smarty_Compiler extends Smarty {
if (@$tokens[$expr_end] == 'by') {
$expr_end++;
$expr_arg = $tokens[$expr_end++];
$expr = "(($is_arg / $expr_arg) % ". $this->_parse_var_props($expr_arg) . ")";
$expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
} else
$expr = "($is_arg % 2)";
break;