Hi all im doing a template system and ive run into this error;
Warning: parsefile(admin): failed to open stream: No such file or directory in /home/fedrabb/public_html/forum/includes/templating.php on line 39
Warning: parsefile(): Failed opening 'admin' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fedrabb/public_html/forum/includes/templating.php on line 39
That comes up when i try and parse {user} with the word 'admin'
This is the code;
Any ideas? - can be seen at http://www.fedrabb.net/forum/members.php
Warning: parsefile(admin): failed to open stream: No such file or directory in /home/fedrabb/public_html/forum/includes/templating.php on line 39
Warning: parsefile(): Failed opening 'admin' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fedrabb/public_html/forum/includes/templating.php on line 39
That comes up when i try and parse {user} with the word 'admin'
This is the code;
PHP:
class templateParser
{
var $output;
function templateParser($templateFile)
{
(file_exists($templateFile))?$this->output=file_get_contents($templateFile):error($lang['title']['error'],$lang['text']['template_not_found']);
}
function parseTemplate($tags=array())
{
if(count($tags)>0)
{
foreach($tags as $tag=>$data)
{
$data=(file_exists($data))?$this->parseFile($data):$data;
$this->output=str_replace('{'.$tag.'}',$data,$this->output);
}
}
else
{
error($lang['title']['error'],$lang['text']['no_tags']);
}
}
function parseFile($file)
{
ob_start();
include($file);
$content=ob_get_contents();
ob_end_clean();
return $content;
}
// display the page
function display()
{
echo $this->output;
}
}
Any ideas? - can be seen at http://www.fedrabb.net/forum/members.php















