The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to know what template was loaded?
Hi all!
I want write a plugin (admincp ->Plugins & Products -> Add New Plugin) to manage some variables that I'll print it in template, my code will prepare the variables only for the templates that will be loaded in current page, like, if the template "ad_showthread_firstpost_start" will be loaded in current page, my code will prepare the variables for that template, if the template "pm_messagelistbit" will be loaded, my code will prepare the variables for "ad_navbar_below" and not for "ad_showthread_firstpost_start" etc... But to do that, I need to know what template will be loaded in current page... There is an array or something with current templates names? (not whole templates, only the group that will be loaded in current page) |
#2
|
|||
|
|||
There's a setting in the vbulletin options to show template names in the html source.
vBulletin Options > General Settings > Add Template Name in HTML Comments = Yes You can then look at the html source and see the template names in html comments for whatever page. |
#3
|
||||
|
||||
If you go into debug mode, then the list of templates used on each page it printed at the bottom of the page.
|
#4
|
||||
|
||||
I need in php not in HTML or debug and I need it to use to check if i must run a a code or another.
Like: if ad_xyz is loaded then $variable = "123445df"; else if ad_bass is loaded then $variable "ambbma"; else $variable = "qwerqqwer"; end if |
#5
|
|||
|
|||
If you know which templates are used in which php files, you could test the value of THIS_SCRIPT.
|
#6
|
||||
|
||||
there isn't an array or similar to know the template?
|
#7
|
|||
|
|||
I think there are arrays which tell you what templates are cached, but that doesn't necessarily equal the templates that are actually used. There seems to be a number of arrays and I'm kind of fuzzy on that whole area. Probably Lynne knows the answer.
|
#8
|
||||
|
||||
Nope. I've never looked into this before so I don't know the answer.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|