Jump to content


Photo

include function on .tpl file?


  • Please log in to reply
5 replies to this topic

#1 foreverhex

foreverhex
  • Members
  • PipPipPip
  • Advanced Member
  • 91 posts

Posted 17 July 2006 - 06:00 PM

I have a phpBB (who doesn't?) and I wanted to know if there was an equivalent of
<?php
include 'file.php'; 
?>
for a .tpl file? I tried
{include file="file.php"}
but that didn’t seem to work. Is there a certain spot I need to put the code?

P.S. I tryed asking ppl at phpBB and there hasn't been one reply in a day!!!

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 17 July 2006 - 06:05 PM

If you want to include a file within a phpBB Template file then this will require a mod for phpBB to beable to do what you are trying to do. The best possible way is to asking the MOD team over at phpBB.com for such a mod. Also I'm moving this thread to the third party PHP scripts forum.

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 July 2006 - 06:05 PM

try this ok
<?php

$file_name="file.php";

include '$file_name';
?>
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 foreverhex

foreverhex
  • Members
  • PipPipPip
  • Advanced Member
  • 91 posts

Posted 17 July 2006 - 06:10 PM

Fair enough. Also I dont think just normal php will work in the tpl file.

#5 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 17 July 2006 - 06:31 PM

I didnt think phpBB uses a Smarty like template system. You wont be able to do that in phpBB. How about adding another template "variable" such as {MY_NEW_PAGE} and then replace this with the connts of a page using file_get_contents() ?
OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application

#6 ndebellas

ndebellas
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 14 September 2006 - 11:39 PM

How about adding another template "variable" such as {MY_NEW_PAGE} and then replace this with the connts of a page using file_get_contents() ?


this worked for me.  Good call.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users