The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have a variable in global.php
<?php ... $myvar = 'some stuff'; .. ?> What do I need to do to make this variable accessable from a template? |
#2
|
||||
|
||||
![]()
Nothing, just add it where you want.
|
#3
|
|||
|
|||
![]()
Well, I tried. But was unsuccessful.
What I did was.. First, add my variable ($myvar) to global.php. Second, edit the "header" template from the admin control panel by adding [$myvar] did not work. When I refresh the page I get [ ] instead of [some stuff] |
#4
|
||||
|
||||
![]()
Try using just: $myvar
|
#5
|
||||
|
||||
![]()
Where exactly in global.php did you put it ?
|
#6
|
|||
|
|||
![]() Quote:
I tried putting it at the beginning and it shows up in the template. I guess I'm not understanding in which order things are processed. |
#7
|
||||
|
||||
![]()
That's why I asked - the header is processed about 2/3rds of the way down global.php.
BTW, you shouldn't edit the file, but use a plugin - and the global_start hook. ![]() Edit - Actually, the parse_templates hook is called just before the header template is processed, so you probably could use that. |
#8
|
||||
|
||||
![]()
global_start would be the more correct plugin to use.
|
#9
|
|||
|
|||
![]()
Thanks Paul and everybody who replied. I will look into the plugin system.
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|