From a4f0c307d0543822d5c639e4a85cc5b4681b90ba Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 19 Mar 2005 00:58:35 +0000 Subject: [PATCH] Not working... just checking in. --- template.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/template.php b/template.php index fa168d8..96103db 100644 --- a/template.php +++ b/template.php @@ -424,10 +424,10 @@ class DB_Template // extract the condition $condition = substr($template, $i, $end - $i); - echo "||||||" . $_isso->sanitize($condition) . "||||||"; + //echo "||||||" . $_isso->sanitize($condition) . "||||||"; // complete the open - array_push($stack,/* array('pos' => $i, 'expr' => $condition) /**/$i); + array_push($stack,/* array('pos' => $i, 'expr' => $condition) */$i); //print_r($stack); } @@ -438,6 +438,10 @@ class DB_Template // calculate the end of the tag $end = $i + strlen($tag_end); + //echo ">>>>> $end <<<<<<"; + + //print_r($stack); + // find the most recently opened condition $last = array_pop($stack); @@ -459,16 +463,18 @@ class DB_Template // remove the tailing end tag $conditional = substr($conditional, 0, strlen($conditional) - strlen($tag_end)); + //echo ">>>>>>> " . $_isso->sanitize($conditional) . " >>>>>>>"; + // place it in iff() $parsed = '" . iff(' . stripslashes($expression) . ',"' . $conditional . '","") . "'; - //echo "<<<< $parsed >>>> "; + echo "<<<< " . $_isso->sanitize($parsed) . " >>>> "; // replace it back into the template - $template = substr_replace($template, $parsed, $i, $end); - - //echo ">>>>>>>>>>> $template <<<<<<<<<<"; + $template = substr_replace($template, $parsed, $i, $i - $end + strlen($tag_end)); + echo ">>>>>>>>>>> $template <<<<<<<<<<"; + exit; //echo "<<<<<<<<<<<<<<<<< $conditional >>>>>>>>>>>"; } } -- 2.43.5