1 (edited by jewofcanada 2008-09-12 09:18)

Topic: Using PHP in Template...

I know this topic has been posted a million times, but all the searching I've done doesn't seem to help my specific situation. I know that to include a PHP file you use the <pun_include "whatever.php">... but it doesn't seem to be working for me.

What I'm doing is integrating the forum into my websites template. I've taken a rather simple approach and just built a table around the content in the main.tpl. Right above the forum content, I've used <pun_include "boxes.php">. Boxes.php is a php file that echos out php based features of my site, such as a schedule, calendar, and recent posts. Each feature is placed within one of three boxes atop the page. All of this is done in the boxes.php file, which is uploaded to the forum/includes/user/ directory.

When I load the forum, nothing appears. It's as if the file wasn't even included. There's no error, no html structure of the boxes, nothing. I'm not sure what I'm doing wrong, but was wondering if perhaps it's not even possible to do what I'm trying to do.

It's 5:15 in the morning so if I've left out any information, just post and I'll be more than happy to provide you with what you need.

Re: Using PHP in Template...

To include a PHP file in templates use <!-- forum_include "<MY_FILE.php>" -->. <pun_include "*"> was used in PunBB 1.2.

3 (edited by jewofcanada 2008-09-15 23:38)

Re: Using PHP in Template...

Still no luck... I've even just created a real simple test.php file, all it does is echo out the word "Hello." Using that syntax I've added it into the main.tpl and still get no results.

<!-- forum_include "<test.php>" -->


EDIT: Ahh I see... it's <!-- pun_include "test.php" -->

Thanks for putting me on the right path! :]

Re: Using PHP in Template...

You were misinformed i belive...

1.2.* uses <pun_include "*">
1.3.* uses <!-- forum_include "<MY_FILE.php>" -->

If your using 1.2 then you use the one from 1.2

Sorry. Unactive due to personal life.

5 (edited by banglalibrary 2009-11-03 12:10)

Re: Using PHP in Template...

Slavok wrote:

To include a PHP file in templates use <!-- forum_include "<MY_FILE.php>" -->. <pun_include "*"> was used in PunBB 1.2.


I want to include banner on the right side of the forum head which is blank. How can I do it?
I'm new in punbb. My forum address is http://forum.banglalibrary.org
It would be kind enough if you help me.

BENGALI E LIBRARY
http://forum.banglalibrary.org, www.banglalibrary.org
Jyoti Tower, P-313, Nabapally, Salt Lake, Sector-IV, Kolkata-700105
E. M BYPASS, BUS STOP : CHINGRIHATA
PH : 033-23353176, +919831193298, +919836422308

Re: Using PHP in Template...

It seems that problem was solved. I can see the banner at the header.

Re: Using PHP in Template...

hello .
I'm also trying to manipulate the template and I need to include an outside file ...
I have the forum located in /www/website/forum/
and the file i need to include is in /www/website/includes/test.php
and this does not work :<!-- forum_include "<../includes/test.php>" -->

anybody has any ideea on how to do it ?

Re: Using PHP in Template...

voxberry wrote:

I have the forum located in /www/website/forum/
and the file i need to include is in /www/website/includes/test.php
and this does not work :<!-- forum_include "<../includes/test.php>" -->

It is not /includes it is /include. smile

The line in main.tpl should read
<div <!-- forum_include "test.html" --></div>
and test.html should be in  /forum/include/user/.

9

Re: Using PHP in Template...

Is there a way to include a script in main.tpl which is outside the user directory?

I've got the forum at http://forum.domain.tld and the site on http://www.domain.tld. I also have a php script on http://www.domain.tld/scripts/myscript1.php which I am  trying to include with

<!-- forum_include "http://www.domain.tld/scripts/myscript1.php" -->

but it does not work. Can anyone offer any advise?

10

Re: Using PHP in Template...

anyone?