PDA

View Full Version : Include the output of an .php in an template?


12-12-2000, 05:44 PM
Hi,

I've just downloaded the active threads hack, that the latest 5 active threads are displayed...
It works when i call the php directly, but how can i let it show up on my index.php?
I tried to include it in the template but that doesn't work...

Thnx

12-13-2000, 02:46 PM
does nobody know an answer?
i've searched for it, but i haven't found it.. :(

12-13-2000, 05:40 PM
If you want to put it in the header template that's being parsed as PHP you can put:


ob_start();
include("phpfile.php");
$header .= ob_get_contents();
ob_end_clean();


(PHP4 only)

12-14-2000, 12:58 PM
yeah i know, i just want it to be in an regular vbulletin template, like forumhome or so.. how can i let that template be parsed then?

12-14-2000, 04:03 PM
You need to assign the parsed code to a variable and put that variable in your template...

If you look through the code you will understand how this is done. Each subtemplate is simply evaluated down to a variable of the same name (i.e. $postbit) and that is placed in another template.

12-15-2000, 06:49 PM
okay, thanks.. i hope i can make it work..