The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
how does template caching work?
I'm looking at the following:
PHP Code:
|
#2
|
||||
|
||||
It puts these files into the datacache which means they can be called with out needing to run a query to do it
|
#3
|
|||
|
|||
So, I've got a new template, called modifywidget. How would I go about getting this new template cached? I'm guessing there's more to it than just $widgettemplates = array('modifywidget');, but I'm not sure where the rest of the behind-the-scenes templace caching action takes place.
|
#4
|
||||
|
||||
$globaltemplates = array('modifywidget');
|
#5
|
|||
|
|||
But where does it do its caching thing? I want to see its guts Logically, there should be a DB query someplace, or at least some functions behind this.
|
#6
|
||||
|
||||
Look in init.php
|
#7
|
|||
|
|||
Excellent. One last thing, what's the rule of thumb for using $globaltemplates vs. $actiontemplates? The comments say "pre-cache templates used by all actions" vs "pre-cache templates used by specific actions". I'm basically going to be calling this from a function, so I'm leaning towards $actiontemplates, but not sure about the usage guides :nervous: <- hah, that smiley's great.
Edit: wait, is it that the subarray must be named by the name of the function, and will only be accessible from that function, while global can be used anywhere in the file? |
#8
|
||||
|
||||
special templates is ONLY for calling things that have been stored in the datastore table as far as im aware. if your just using templates you have made in vBulletin's tempalte system you use globaltemplates
|
#9
|
|||
|
|||
There's three things as far as I can see, $globaltemplates, $actiontemplates and $specialtemplates. I'm staying away from that last one, but from looking over vB3 code, it seems they're very stingy with the $globaltemplates and prefer to use $actiontemplates.
|
#10
|
||||
|
||||
globaltemplates are for templates that are NOT used in actions, action templates are templates that are used in actions within the file, take at https://vborg.vbsupport.ru/showthread.php?t=59939
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|