First I have a table called templates right with: id, name, body.
in my global file which is the file included into the top of every page I run this code.
Code: Select all
$fetch_templates = $mysql->query("SELECT * FROM ".DBPREFIX."templates ORDER by id ASC");
while ($temp = mysql_fetch_array($fetch_templates,MYSQL_ASSOC)){
$template[$temp['name']] = $temp['body'];
}
Code: Select all
$core->display_template($template['test']);
Code: Select all
public function display_template($v){
global $SDK;
global $mysql;
global $error;
global $ipb;
eval('?'.'>'.$v.'<'.'?');
}
Code: Select all
<? echo $testvar; ?>
Code: Select all
$testvar = "mike";
$core->display_template($template['test']);