brsy
nah mang
- May 12, 2011
- 1,530
- 272
I have a template system that works perfectly. It's just that I wanted to be able to organize the files, so it would be much more neat. This code is throwing errors:
The original code is:
PHP:
public function getFile($file, $admin = 0) {
global $pelican;
if($admin = 1) {
if(file_exists('_templates/'.$pelican['Site']['skin'].'/admin' . $file . '.tpl')) {
ob_start();
include('_templates/'.$pelican['Site']['skin'].'/admin' . $file . '.tpl');
$this->tpl .= ob_get_contents();
ob_end_clean();
}
}
if(file_exists('_templates/'.$pelican['Site']['skin'].'/' . $file . '.tpl')) {
ob_start();
include('_templates/'.$pelican['Site']['skin'].'/' . $file . '.tpl');
$this->tpl .= ob_get_contents();
ob_end_clean();
}
else {
die("<br /><b>Templating Error:</b> Unable to get the file <b>'".$file."'</b> from the theme <b>".$pelican['Site']['skin']."</b>.");
}
}
The original code is:
PHP:
if(file_exists('_templates/'.$pelican['Site']['skin'].'/' . $file . '.tpl')) {
ob_start();
include('_templates/'.$pelican['Site']['skin'].'/' . $file . '.tpl');
$this->tpl .= ob_get_contents();
ob_end_clean();
}
else {
die("<b>Templating Error:</b> Unable to get the file <b>'".$file."'</b> from the theme <b>".$pelican['Site']['skin']."</b>.");
}
}