PDA

View Full Version : Adding PHP to templates


clarke_kent
10-21-2007, 07:01 PM
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
10-22-2007, 05:36 AM
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
10-22-2007, 10:06 PM
Have a look here: http://www.vbulletin.com/docs/html/templates_externalfiles. I found this really helpful.

testebr
10-22-2007, 10:31 PM
Let PHP Live! (Allow PHP code in templates)

https://vborg.vbsupport.ru/showthread.php?t=124094

Dismounted
10-23-2007, 06:48 AM
That's not really a good idea.