The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Plugin Question
How would I set up a plugin so that when I place a variable (Like $template) it'll call a template specified?
|
#2
|
|||
|
|||
You need to create two plugins, one in parse templates, and the other in cache templates.
eg hook location = cache templates Code:
$globaltemplates = array_merge($globaltemplates, array('[high]TEMPLATE NAME[/high]')); Code:
eval('$[high]TEMPLATE NAME[/high] = "' . fetch_template('[high]TEMPLATE NAME[/high]') . '";'); |
#3
|
||||
|
||||
Thanks!
|
#4
|
||||
|
||||
Interesting. Is placing the plugin in parse and cache better than global start?
|
#5
|
|||
|
|||
It depends on what you are doing, but if you want the template to be cached (which is a good idea) then cache and parse are the best places, or at least I use them all the time for calling additional templates globally. I guess you could do it other ways, but why fix something that isn't broken?
|
#6
|
||||
|
||||
I myself like to invent the wheel. JK.
Well, it was vB support that told me to use global start for common template calls. Maybe it's what you've said, that it's situational and I've mistakenly took their recommendation as a rule for all instances. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|