Okay i got this issue were i can use php in the .tpl file like <?php if blah bla ?> but when it comes to doing my {if:logged} it does not work it show nothing like {if:logged} was not in the tpl ???
heres my code.
Code:class Page {
var $page;
function page ( $file )
{
$fd = fopen($file, 'rw');
$buffer = fread($fd, filesize($file));
fclose($fd);
$this->page = $buffer;
}
function replace_tags ( $tags = array ( ) )
{
if ( sizeof( $tags ) > 0 )
{
foreach ( $tags as $tag => $data )
{
$this->page = str_replace ( "{" . $tag . "}", $data, $this->page );
}
$this->page = str_replace("{if:logged}", "<?php if ($hello == 'yes') { ?>", $this->page);
$this->page = str_replace("{/if}", "<?php } ?>", $this->page);
}
else
{
die("No tags designated for replacement.");
}
}
function output ( )
{
echo $this->page;
}
}

