AusPhotography
04-04-2011, 10:08 PM
Based on this discussion... http://www.vbulletin.com/forum/showthread.php/376558-Might-fancy-another-upgrade?p=2138507&viewfull=1#post2138507
I've moved all our site template mods into a plugin hook@process_templates_complete which does this (proforma)
if (!empty($vbulletin->templatecache['TEMPLATE']))
{
$vbulletin->templatecache['TEMPLATE'] = str_replace($findtext,$replacetext,$vbulletin->templatecache['TEMPLATE]);
}
It works quite well and we don't have a lot of modifications.
Note: If it's a special template like $header you apply the same code directly to the parsed $header variable.
BUT! the problem is that the code is executed every page load (digitalpoint's post above).
Ideally I should modify the template one at compile time via the hook@template_compile.
The problem I have is how to force a re-compile of the templates in the site database
a) when the product is 1st installed
b) maybe when a product upgrade occurs
Any suggestions on how to force a template re-compile for an array of template names?
It would ideally run on product installation and upgrade!
Thanks!
I've moved all our site template mods into a plugin hook@process_templates_complete which does this (proforma)
if (!empty($vbulletin->templatecache['TEMPLATE']))
{
$vbulletin->templatecache['TEMPLATE'] = str_replace($findtext,$replacetext,$vbulletin->templatecache['TEMPLATE]);
}
It works quite well and we don't have a lot of modifications.
Note: If it's a special template like $header you apply the same code directly to the parsed $header variable.
BUT! the problem is that the code is executed every page load (digitalpoint's post above).
Ideally I should modify the template one at compile time via the hook@template_compile.
The problem I have is how to force a re-compile of the templates in the site database
a) when the product is 1st installed
b) maybe when a product upgrade occurs
Any suggestions on how to force a template re-compile for an array of template names?
It would ideally run on product installation and upgrade!
Thanks!