View Full Version : How to change a specified code in a specified template with a specified code
Scanu
09-06-2011, 05:27 PM
Hi everyone i'd like to create a plugin that change a specified code for example {vb:raw navbar} in a specified template for example forumhome with a specified code for example "<div class="example_menu">
i'm searching for this all the day but i didn't found anything.. there isn't many tutorials for vb4 plugin coding
thanks in advance :)
Maybe this areticle will help: https://vborg.vbsupport.ru/showthread.php?t=228078
It's about how to write a plugin to make new variables to use in templates. If you want to change an existing one without editing the template, that's probably a little more difficult.
Scanu
09-07-2011, 03:15 PM
Really not i have already see that someone else?
al3bed
11-11-2011, 07:43 AM
Maybe this areticle will help: https://vborg.vbsupport.ru/showthread.php?t=228078
It's about how to write a plugin to make new variables to use in templates. If you want to change an existing one without editing the template, that's probably a little more difficult.
hi, I have the same question
I'm a little need to know the 'more difficult' .. it seems there is no way ever
your best shot is using ad_location and template hooks
but if you need to change or delete or add to an existing template it's impossible with vb4 or please tell me if you know a way~?!!!
OK, to be honest I'm not sure exactly what you want to do. If you want to change what's displayed somewhere, the easiest thing to do is to just edit the template. If you need to set a variable to use in a template, then you need to write a plugin and you can refer to the link I posted above.
If for some reason you don't want to edit a template (and I'm not sure why that would be), then you'd need to either change the value of an existing variable or else modify the template in a plugin, and both are a little difficult to explain. It would be easier if you could post exactly what you want to do.
al3bed
11-12-2011, 03:50 AM
I already know how to change the value of an existing variable, I want to modify the template in a plugin
for example I need to render newpost_quote template as empty of it's content for specific users using a plugin. it's mean without needing to update the template manually. code to replaced and rendered whenever the specific users come into that place
$coco = vB_Template::create('newpost_quote')->render();
$coco = str_replace($coco, "", $coco);
now, what I suppose to do to make $coco work? :)
Scanu
12-13-2011, 05:03 PM
Hi al3bed do you got it working?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.