The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
What Are the Global Variable Scope Exceptions
I've been trying to get this code to work for quite a while and it's just not working. I've got a global variable defined that works in headerinclude and navbar but when I try to use it in SHOWTHREAD_SHOWPOST it's empty.
When a thread is loaded, this variable would essentially be used 3 different times throughout the page but it doesn't work when it's called from showthread_showpost. I've been searching for hours and haven't come up with anything. Is SHOWTHREAD_SHOWPOST one of those templates that isn't in the global scope? If so, how I can I bring it into scope? |
#2
|
||||
|
||||
How are you calling it? $GLOBALS[yourvariable]?
|
#3
|
||||
|
||||
In the PHP code ive used global $variable as well as $variable and in the template, when I use $globals[variable] it doesn't work...
At the moment I'm using $variable in 2 locations and it's working fine, in showthread_showpost I'm calling that variable in 3 different locations using both $globals[variable] and $variable but I'm not seeing it show up anywhere... To make sure there wasn't any other program modifying the display of that section I added it right below the body tag and right above the end body tag. yeah, I had thought of that and used both :-) |
#4
|
||||
|
||||
Quick FYI:
$GLOBALS is case sensitive; it must be capitalized. |
#5
|
||||
|
||||
Ughh... All 15 of the references are showing up... but my understanding of the templating system is wrong... showthread_showpost only works for showpost.php... I suppose I just need to find the correct location in another template
|
#6
|
||||
|
||||
To find the template you want to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. Sometimes the template is the one mentioned at the very top of the page source.
|
#7
|
||||
|
||||
Wow, that's extremely helpful. I had no idea that was there
Thank you I found where I needed to edit and all is well. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|