vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Disable certain hack in certain style? (https://vborg.vbsupport.ru/showthread.php?t=253406)

MikesSite 11-09-2010 02:45 PM

Disable certain hack in certain style?
 
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.

kh99 11-09-2010 11:35 PM

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. [S]Maybe you can just put an "if" in a template [/S]

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:
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

PHP Code:

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

PHP Code:

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

Quote:

Originally Posted by MikesSite (Post 2122127)
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


All times are GMT. The time now is 01:13 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01020 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete