View Full Version : Disable certain hack in certain style?
MikesSite
11-09-2010, 02:45 PM
I have some hacks on my forum that I would like to disable in certain styles. The hack is a random album picture on the forum home, but on my mobile style I would like to disable this all together.
How can I disable certain hacks on a certain style?
Thanks.
You can check the styleid to see what style is being displayed, but exactly what you'd have to do to disable the hack depends on exactly what it does. Maybe you can just put an "if" in a template
Edit: ...if it's possible to remove the hack from a template you could just modify the template in that style. (But if the mod has an on/off option then it might be better to do what Lynne suggests below).
Lynne
11-10-2010, 01:20 AM
You can write a plugin to do this, but you need to look in the code for the modification to grab the correct variable that will turn the modification off.
hook_location: style_fetch
php code:
if ($styleid == x){
$vbulletin->options['modification_on_off'] = 0;
}Change x to the styleid and 'modification_on_off' to the variable name used by the modification to turn it on and off. For instance, in my Move Smilies below Textarea mod, the on/off variable is named "lynne_sb_below", so I would write it like this to not show in styleid 5
if ($styleid == 5){
$vbulletin->options['lynne_sb_below'] = 0;
}
As I said, you will need to look in the code for the modification to get the name of the option to turn it on and off. (And some mods don't have one.)
MikesSite
11-15-2010, 02:25 PM
Lynn,
You are the best!! Thank you so much. How could I define 2 styles within this? I tried separating style ID #'s by commas but that didn't work. For now I just made another plugin with the other style ID.
KH9,
Thank you for the advise, I really appreciate it :D
Lynne
11-15-2010, 02:46 PM
if (in_array($styleid, array(5,6))){
$vbulletin->options['lynne_sb_below'] = 0;
}
MikesSite
11-15-2010, 03:23 PM
Thanks.
What do I do if the mod doesnt have a variable to turn the modification off?
Lynne
11-15-2010, 05:44 PM
Thanks.
What do I do if the mod doesnt have a variable to turn the modification off?
Add one? Look for other variables to use that would turn it off?
MikesSite
11-15-2010, 05:53 PM
Any suggestions when looking for other variables to use to turn it off?
Lynne
11-15-2010, 07:19 PM
Not really. You kinda have to take a look at the code and see what variable does what.
MikesSite
11-15-2010, 07:53 PM
Okay, I will look into it more in depth tonight.
Thanks, Lynne :D You're the best
gamerzhut
11-16-2010, 02:34 AM
Thank you lynne
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.