The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Manage Templates
Want to cache templates or group custom templates in the Admin CP without editing the source code? Of course you do! Want to know how to achieve this? Read on.. Caching Templates This is probably NOT the best way of achieving this, however if you're wanting to effectively cache a template in an existing file (for example, the v3arcade award bits in showthread.php), this how to achieve this with a simple plugin. Add a plugin to the following hook location: vBulletin : General -> cache_templates With the following code: Code:
$globaltemplates = array_merge($globaltemplates, array('xxxx')); It's as simple as that! Also, if you're wanting to cache multiple templates, simply add a comma after the last [high]'[/high] and wrap a second template name with [high]'[/high]s. You should have something like this: Code:
$globaltemplates = array_merge($globaltemplates, array('xxxx', 'yyyy')); Grouping Custom Templates in the Admin CP Add a plugin to the following location: vBulletin : General Administration -> template_groups With the following code: Code:
$only['xxxx'] = 'Group Name'; Once again, this is very easy to do. If you're wanting to do add multiple groups, add a second line below this one and do the same again. If you wish to use a phrase, use: Code:
$only['xxxx'] = $vbphrase['yyyy']; |
#12
|
|||
|
|||
The templates that I wish to group start with NewTemplategroup. And this is what I found:
Use newtemplategroup in lower-case as the array index, otherwise it doesn't work // This works like a charm $only['newtemplategroup'] = 'New Template group'; // This does not work $only['NewTemplategroup'] = 'New Template group'; Thanks for the quick reply. I hope this helps someone |
#13
|
|||
|
|||
[quote=Oblivion Knight;803104]Want to cache templates or group custom templates in the Admin CP without editing the source code? Of course you do! Want to know how to achieve this? Read on..
Now in plain english the easiest way to do this step by step is: Add a plugin to the following hook location: Plugins & Products: Add New Plugin step 1 example:
step 2 example: Languages & Phrases: => Phrase Manager => Add New Phrase
last step example: Styles & Templates => choose your current style unless you have debug mode on, you can chooseMASTER STYLE => Add New Template
Quote:
I still give credits to Oblivion Knight, however, this I would rather say because it is far more easier to do these step by step. Now that I have gave you a break down on how to accomplish this the easy way, please feel free to rep me. But please, this original tutorial was by Oblivion Knight, I just broke it down in PLAIN ENGLISH! Thanks! |
#14
|
|||
|
|||
For some reason when I did this with a prefix with an underscore (_) it did not work, but as soon as I took the underscore out it worked just fine.
From the examples above it would appear that some people have gotten it to work with an underscore in their prefix, but it's just not working for me in 3.8. But the thing is, all of my vBa scripts have underscores in their template groups (adv_portal, adv_links), so I know it should work. Any ideas? PHP Code:
PHP Code:
|
#15
|
|||
|
|||
hello vB experts
i need some help i tried to add template into ad location section (template) and i did exactly the tutor said temlate group Code:
$only['ad_'] = $vbphrase['group_ad_location']; but seem not work the template i created it till outside of the ad location group any suggestion will be appriciated Sincerely, |
#16
|
||||
|
||||
Quote:
Code:
$only['ad'] = $vbphrase['group_ad_location']; |
#17
|
|||
|
|||
oh wow ... it works like champ
thanks so much .... Digital Jedi |
#18
|
|||
|
|||
I did it on my custom templates using 'Postbit' to try and put my custom postbits into that category with the default postbits that comes with vbulletin.
but for some strange reason i now have two "Postbit Templates" instead with the exact same spelling lol Code:
$only['menufortgm'] = 'Postbit'; $only['clanheaders'] = 'Postbit'; |
#19
|
|||
|
|||
I started creating products, and I am stuck
Can I ask, the footer and header templates, can it be a part of caching, or can I use the caching on footer or header template... and which templates can be reffered to or as $globaltemplates... Here is the HOOK for caching my template below: <hookname>cache_templates</hookname> and my PHPCODE: $globaltemplates = array_merge($globaltemplates, array('MYCODENAME')); and my replacement code: if ($vbulletin->options['social_five_on']) { $replace = '$ad_location[ad_footer_start]'; $vbulletin->templatecache['footer'] = str_replace($replace,$replace.fetch_template('MYCODENAME'),$vbulletin->templatecache['footer']); IS this done right? by the way this is for vB3.8 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|