From fa6e6333161ed3afc9ab1c487623a8d8b8ce7313 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 19 Mar 2005 01:07:03 +0000 Subject: [PATCH] Hackish way to do it by just replacing strings. Ugh. --- template.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/template.php b/template.php index 96103db..24f6f1f 100644 --- a/template.php +++ b/template.php @@ -401,7 +401,13 @@ class DB_Template $tag_else = ''; $tag_end = ''; - $stack = array(); + $data = preg_replace('##', '" . iff(\\1,"', $template); + $data = str_replace('', '","', $data); + $data = str_replace('', '") . "', $data); + + return $data; + + /*$stack = array(); for ($i = 0; $i < strlen($template); $i++) { @@ -416,7 +422,7 @@ class DB_Template { // where do we end the condition $end = strpos($template, $tag_start_end, $i); - $end += strlen($tag_start_end)/* - 1*/; + $end += strlen($tag_start_end); //echo $template[ $end - 2 ] . $template[ $end - 1 ] . $template[ $end ] . $template[ $end + 1 ] . $template[ $end + 2 ] . " (" . $template[ $end ] . ") "; //echo " { " . $template[ $end - 1 ] . " } "; //echo " >>>>>> " . $end . " >>>>>> "; @@ -427,7 +433,7 @@ class DB_Template //echo "||||||" . $_isso->sanitize($condition) . "||||||"; // complete the open - array_push($stack,/* array('pos' => $i, 'expr' => $condition) */$i); + array_push($stack, $i); //print_r($stack); } @@ -478,7 +484,7 @@ class DB_Template //echo "<<<<<<<<<<<<<<<<< $conditional >>>>>>>>>>>"; } } - } + }*/ return ''; //return $template; // ------------------------------ -- 2.22.5