PDA

View Full Version : Template help


pein87
08-11-2010, 05:19 PM
I was wondering how do I get a template to show in a custom page repeatedly?

I've been hard coding everything into the file but its been causing some skin issues when the skins are changed.

I was wondering how I could get a template to show for ever instance of the fetched mysql rows?

Do I add the eval code in the while loop in the page instead of hard coding the design in the file?

kh99
08-11-2010, 06:05 PM
Do I add the eval code in the while loop in the page instead of hard coding the design in the file?

Yeah, something like:

while ($row = $db->fetch_array($rows))
{
// use $row to set up vars used by "bit" template, if necessary, then...
eval('$bits .= "' . fetch_template('bit') . '";');
}

// Now use $bits in a "top-level" template

For an example, look at the "threadbit" template and at the code in forumdisplay.php (search for "fetch_template('threadbit')" ).

pein87
08-12-2010, 08:19 PM
Thanks I'll give it a try.