PDA

View Full Version : Running PHP in Templates


sidauhee
05-25-2005, 07:28 AM
Hi All,

I was thinking of having a template where i will run a PHP code to grab the contents of a html (eg. SomeDir/sample.html which contains a html table) and display it out by placing the template name into the ShowThread template.

Is is possible to run PHP functions like file() inside the custom templates?
Or are there any ways?

Thanks!

Xenon
05-25-2005, 09:46 AM
you can use phpinclude_start to get the filecontent into a variable and then use the variable within the showthread template

sidauhee
05-26-2005, 08:42 AM
Thanks Xenon.

But i was thinking if I can run PHP codes to get the contents of the HTML from within the SHOWTHREAD template; as I will want to display a specific HTML file for some of the threads.

For eg, thread no. 3 (from $threadid, I will show 3.html) is this possible?
Thanks.

Xenon
05-26-2005, 09:35 PM
parsing php is just possible in phpinclude template.

you can use the condition system to show the correct variable in showthread then :)

also in phpinclude you should already have access to the threadid, so this will work :)

sidauhee
05-27-2005, 09:41 AM
Thanks mate!
I've got it working.

Xenon
05-27-2005, 12:56 PM
glad to read :)

you're welcome