Page 1 of 1

Running php in a tpl

Posted: Mon Jul 26, 2004 7:40 pm
by John Cartwright
I am trying to run any particular code in a .tpl file and wondering how this can be accomplished if anyones knows. I'm trying to modify phpbb2 forums .. and have tried their support forums but no one is answering me would be much appreciated if someone could help me :)

Posted: Mon Jul 26, 2004 7:54 pm
by feyd
phpbb2 "compiles" the tpl when it's requested.. So you may not be able to effectively add real code to it.. template.php in the includes folder has all their code for that particular thing..

Posted: Mon Jul 26, 2004 8:00 pm
by John Cartwright
hmm I'm just tyring to do an include at the moment... any other ideas?

Posted: Mon Jul 26, 2004 8:02 pm
by feyd
depending on what and how you want to include it, you could add a couple template data chunks or a different template file, and insert it into the queue where you want it to show.. or just edit the template file directly..

Posted: Mon Jul 26, 2004 8:05 pm
by John Cartwright
i just want to have the following run

include("../nav.php");

but I don't know what you mean aobut the queue and whatnot


btw all nav.php is is a bunch ofn links

Posted: Mon Jul 26, 2004 8:11 pm
by feyd
I'm guessing this would go in overall_header.tpl? the way I've done specialized code running in the phpbb I've modified, I added a few lines to one of the main php files phpbb uses. Adding a template variable, and calling my functions to set the proper one to control what content changed using the template variable naming system...

Posted: Mon Jul 26, 2004 8:17 pm
by John Cartwright
Feyd sorry I'm really noobish when it comes to how phpbb works...

if you got a few min think you could walk me through it?

Not in a particular rush but it would be much appreciated.


btw its in the index_body.tpl that i am modifying