View Full Version : Include script into vbulletin header
Wizardjv
06-04-2009, 07:41 AM
I was wondering if anyone could point me in the direction of the easiest and cleanest way to include a php script site wide into the header of vbulletin. I have tried a couple ways, but it doesnt seem to work. Any suggestions?
cono1717
06-04-2009, 01:21 PM
Try this. http://www.vbulletin.com/forum/showthread.php?t=173937
MrEyes
06-04-2009, 01:27 PM
It isn't possible to "embed" a PHP script into your sites header template
However you can get VB to call your script, which then puts some output into a php variable that you can then reference in your header template
To do this you would create a plugin via ACP, if you want this on all pages the hook point would be "global_start", in the plugin code you then call your script, or if you prefer you can put the entire PHP code into the plugin.
So lets say you wanted your display header to show an image, your plugin code would look something like this:
$a_variable_name = '<img src="myimage.jpg" alt="image" />';
You would then edit your header template to include:
<p>Check out this great image</p>
<div>$a_variable_name</div>
<p>It is fantastic is it not!</p>
Remember to try and keep your variable name unique, as you might accidently overwrite and existing variable which will most likely break something.
I cant restore real header code on my vbulletin! Can any one please to post me real code here ?!
ozzy47
07-15-2014, 07:45 PM
I cant restore real header code on my vbulletin! Can any one please to post me real code here ?!
First off you are replying to a thread that is five years old, you really should have started your own thread.
Either revert you template to get it back to original, or create a new style with no parent, and grab the code from there.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.