View Full Version : Plugin Question
King Kovifor
04-14-2006, 12:29 PM
How would I set up a plugin so that when I place a variable (Like $template) it'll call a template specified?
peterska2
04-14-2006, 01:48 PM
You need to create two plugins, one in parse templates, and the other in cache templates.
eg
hook location = cache templates
$globaltemplates = array_merge($globaltemplates, array('TEMPLATE NAME'));
hook location = parse templates
eval('$TEMPLATE NAME = "' . fetch_template('TEMPLATE NAME') . '";');
King Kovifor
04-14-2006, 03:31 PM
Thanks!
Freesteyelz
04-14-2006, 09:32 PM
Interesting. Is placing the plugin in parse and cache better than global start?
peterska2
04-14-2006, 10:53 PM
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?
Freesteyelz
04-14-2006, 11:23 PM
I myself like to invent the wheel. JK. :D
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. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.