LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Getting PHP code to execute in phpBB templates (https://www.linuxquestions.org/questions/linux-software-2/getting-php-code-to-execute-in-phpbb-templates-127928/)

Travis86 12-21-2003 08:10 PM

Getting PHP code to execute in phpBB templates
 
I was wanting to put a "Welcome to my site" message at the top of a phpBB-powered forum. I figured I could put a simple
Code:

<?php
  echo file_get_contents('../message.txt');
?>

at the top of each index_body.php in each template.

Unfortunately, php code does not run if you put it in templates. The main problem is that I can't find a template how-to. I think I'm supposed to put it between "<!-- BEGIN <something> -->" and "<!-- END <something> -->" statements, but I'm not really sure.

Thanks.

hypexr 12-22-2003 06:26 AM

You should modify overall_header.tpl in each template change what appears at the top of evey page.
Why do you want to use php to load the text on to the page rather than just typeing the text into the file?

HypeXR
-- hypexr.homelinux.org --

Travis86 12-22-2003 01:56 PM

I want to have one file which will appear in every template, that way I can just modify that file and I don't have to modify every template.

I've also thought about making a program to edit every overall_header.tpl, but I figure there's probably a more elegant way.

hypexr 12-22-2003 07:53 PM

You can get server side includes (SSI) set up and have it parse the tpl files. Then you can use SSI to put the info from you text file into the tpl file.

HypeXR
-- http://hypexr.homelinux.org --


All times are GMT -5. The time now is 11:34 PM.