PDA

View Full Version : Include header template


Davey-UK
01-13-2004, 02:06 AM
What i want is a little direction on how to include the forum header template in all my external php pages(Not in the forum folder).
I know this will be a really simple task, but i have used some code found elsewhere on this forum and it is putting the file up with the header at the top of the page as i want, but any other content i have added under it is gone.

Can someone guide me into what i am doing wrong?

This is the code i was using, or something like

<?php

chdir("./forum");

error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array('main');

require_once("./global.php");

eval('print_output("' . fetch_template('header') . '");');
?>

Sorry i couldn't put the script in code tags, but there seems to be a problem when i try to use any of the code options bbcode options, it just sends me to the top of the page and inserts nothing!!

Thanks
Dave

Zachery
01-13-2004, 02:26 AM
What i want is a little direction on how to include the forum header template in all my external php pages(Not in the forum folder).
I know this will be a really simple task, but i have used some code found elsewhere on this forum and it is putting the file up with the header at the top of the page as i want, but any other content i have added under it is gone.

Can someone guide me into what i am doing wrong?

This is the code i was using, or something like

<?php

chdir("./forum");

error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array('main');


require_once("./global.php");

eval('print_output("' . fetch_template('header') . '");');
?>

Sorry i couldn't put the script in code tags, but there seems to be a problem when i try to use any of the code options bbcode options, it just sends me to the top of the page and inserts nothing!!

Thanks
Dave
that will make the whole template print out and nothing else, youd need to eval it as a varaible.

Davey-UK
01-13-2004, 10:09 AM
Thanks Faranth.
Is there any chance you could jot me down an example of how i would do this.

PM or here, although here would be nice to give others the knowledge.

Thanks :)

Davey-UK
01-14-2004, 02:03 AM
Done it.....

Zachery
01-14-2004, 02:59 PM
sorry. i do have a tutorial in my sig Some Basics of vB3

kyouens
04-28-2005, 02:12 AM
What i want is a little direction on how to include the forum header template in all my external php pages(Not in the forum folder).
I know this will be a really simple task, but i have used some code found elsewhere on this forum and it is putting the file up with the header at the top of the page as i want, but any other content i have added under it is gone.

Can someone guide me into what i am doing wrong?


Can you tell me how you managed to do this? I am interested in the same thing.