I am trying to use a function to return a template call into the main code.
Something along these lines but it does not seem to work ( doesnt seem to return anything )
This is the function
PHP Code:
function showarticle()
{
global $globaltemplates,$DB_site;
$query= $DB_site->query("
SELECT *
FROM " . TABLE_PREFIX . "article
ORDER BY date
");
while($art = $DB_site->fetch_array($query))
{
eval('$artbit .= "' . fetch_template('artbit') . '";');
}
return $artbit;
}
In the main code :
i have
PHP Code:
showarticle();
eval('print_output("' . fetch_template('main') . '");');
where in template main, $artbit is used.
But this does not display anything.
Seems simple enough but I am puzzled why it does not work ?