PDA

View Full Version : How to Add PHP Code within vB Templates System?


King Justice
09-16-2008, 02:36 AM
Hello.

I would like to add a few lines of PHP code into my templates/styles in vB, within the admin panel.

How can I do this? :confused:

Lynne
09-16-2008, 02:51 AM
You don't add php to the templates. You add php to a plugin which adds it to the page.

King Justice
09-16-2008, 03:22 AM
Why can I not add PHP to a page template? For example, I want to add PHP code to in the ad templates..

So I can make a plugin with PHP code in it? Then how would I put the plugin in the template?

Lynne
09-16-2008, 03:29 AM
Templates are for html, plugins are for php. However, if you really want to add php to a template, you may put it in a file and then include the external file in the template. See this - Including External Files (http://www.vbulletin.com/docs/html/templates_externalfiles)

King Justice
09-16-2008, 04:01 AM
Templates are for html, plugins are for php. However, if you really want to add php to a template, you may put it in a file and then include the external file in the template. See this - Including External Files (http://www.vbulletin.com/docs/html/templates_externalfiles)
Don't know what any of the content means.. I am no coder..
I just want to basically put PHP in a template..using different advertising system, please help..

soundboy
09-16-2008, 04:03 AM
If im right, you can just go to Plugins > Create New Plugin and enetr your php code.. then enter a title like custom_fld (or whatever you want) and then go to your templates and enter $custom_fld or whatever you put in. And it should be there. BUT be careful, it can cause errors if you dont know what your doing!

King Justice
10-01-2008, 02:00 AM
If im right, you can just go to Plugins > Create New Plugin and enetr your php code.. then enter a title like custom_fld (or whatever you want) and then go to your templates and enter $custom_fld or whatever you put in. And it should be there. BUT be careful, it can cause errors if you dont know what your doing!
Sweet, easy enough! :)