Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2010, 02:45 PM
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 11-09-2010, 11:35 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #3  
Old 11-10-2010, 01:20 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
  #4  
Old 11-15-2010, 02:25 PM
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 11-15-2010, 02:46 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if (in_array($styleid, array(5,6))){
$vbulletin->options['lynne_sb_below'] = 0;

Reply With Quote
  #6  
Old 11-15-2010, 03:23 PM
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.

What do I do if the mod doesnt have a variable to turn the modification off?
Reply With Quote
  #7  
Old 11-15-2010, 05:44 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MikesSite View Post
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?
Reply With Quote
  #8  
Old 11-15-2010, 05:53 PM
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any suggestions when looking for other variables to use to turn it off?
Reply With Quote
  #9  
Old 11-15-2010, 07:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not really. You kinda have to take a look at the code and see what variable does what.
Reply With Quote
  #10  
Old 11-15-2010, 07:53 PM
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I will look into it more in depth tonight.

Thanks, Lynne You're the best
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:56 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10478 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete