How do I add custom php code to the header template? Thanks.
add php code to template?
Collapse
X
-
Please see these instructions for including PHP, TXT or HTML in a template:
Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
-
thanks.. but I don't necessarily want to include a php file, I just want to add some small piece of php code.
Anyways, i found that if i go to Plugins & Products -> Add New Plugin, it's the easiest way (for my purposes at least). There i can enter the php code directly. The only problem is that i'm not sure which hook to use. I'm now using the global_start hook to add some code to the header template. It works fine, but I'm not sure if it's the best way to go.Comment
-
Yes, I understand and you cannot do that. This is why I posted the links to help you figure out an alternate way.Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
-
Okay then.Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
-
Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 APIComment
-
ah yes.. that's true. But why not, actually? If you separate business code from presentation code, I don't see anything wrong with adding php code directly to a template. Maybe you guys should read this article to see what i mean.Comment
-
Security purposes actually. This restriction is to make templates more secure as they are currently run through eval() when the pages are built..Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 APIComment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment