vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Include script into vbulletin header (https://vborg.vbsupport.ru/showthread.php?t=215318)

Wizardjv 06-04-2009 07:41 AM

Include script into vbulletin header
 
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:

Code:

$a_variable_name = '<img src="myimage.jpg" alt="image" />';
You would then edit your header template to include:

Code:

<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.

WxP 07-15-2014 04:39 PM

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

Quote:

Originally Posted by WxP (Post 2506927)
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.


All times are GMT. The time now is 01:10 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00974 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete