LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
  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



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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration