LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 12-21-2003, 08:10 PM   #1
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Rep: Reputation: 31
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.
 
Old 12-22-2003, 06:26 AM   #2
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
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 --
 
Old 12-22-2003, 01:56 PM   #3
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
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.

Last edited by Travis86; 12-22-2003 at 01:57 PM.
 
Old 12-22-2003, 07:53 PM   #4
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
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 --
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
phpbb won't work with mysql 4.x and php 4.x Gsee Linux - Software 2 07-27-2005 09:22 AM
PHP/phpBB Malware/Scanning tool Capt_Caveman Linux - Security 1 03-27-2005 12:28 PM
where to find some php templates? essoft478 Linux - General 1 11-24-2004 10:20 PM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM
PHP Parse error.....PHPBB bentman78 Linux - Software 0 07-09-2003 06:35 AM


All times are GMT -5. The time now is 06:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration