PDA

View Full Version : Adding PHP to templates


clarke_kent
21 Oct 2007, 21:01
I would like to add my own custom php code to the vbulletin templates.

I have modified the templates to give me a column on the left hand side. I would like to place my own code in here to display information from a DB not associated with Vbulletin.
This code will display for example a list of links stored in a DB, images stored in a DB etc....

In terms of php coding I am fine, but am unsure where to even start to add it to the templates.

Could anyone point me to a tutorial or provide some insight where to start? I have searched for several hours and come up with nothing useful.

Cheers

Marco van Herwaarden
22 Oct 2007, 07:36
You can not use PHP in templates, they are HTML only.

You will need to create a plugin and assign the output of your PHP code to a variable. The variable can be used in the template.

Marc.F
23 Oct 2007, 00:06
Have a look here: http://www.vbulletin.com/docs/html/templates_externalfiles. I found this really helpful.

testebr
23 Oct 2007, 00:31
Let PHP Live! (Allow PHP code in templates)

http://www.vbulletin.org/forum/showthread.php?t=124094

Dismounted
23 Oct 2007, 08:48
That's not really a good idea.