PDA

View Full Version : append template


testbot
03-15-2010, 08:39 PM
is there an easy way to append a custom template to a custom template using a plugin?

something like:

$vbulletin->templatecache['postbit'] .= $vbulletin->templatecache['mytemplate'];

i tried that but for some reason it replaces the template instead of appending it.

testbot
03-17-2010, 03:59 PM
thanks :|

testbot
03-19-2010, 03:23 PM
so there's no way to append things to templates without doing preg_replace?

Vaupell
03-19-2010, 04:56 PM
ofcourse there is..

i did it in this plugin Costum TOS (https://vborg.vbsupport.ru/showthread.php?t=236484)

But you need to render something else it wont be updated in the chache,
so i made a blank template, which i render when modifying templates via plugin.

i use str replace to fit some code in a small area of the template rather than
replaceing it, so it still works after vb updates..

and if add stuff infront of it as your trying there via .=
it should be possible, but it needs a templater render();
to update.

check out that mod, and notice the plugin code..
im only working in the template cache, to display for the user.