Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2011, 10:43 PM
GavoTrav's Avatar
GavoTrav GavoTrav is offline
 
Join Date: Jun 2011
Location: Ireland
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Disable reputation in certain forums!

Well yes I want to disable reputation in a certain section/subforum.

I searched and found this post which needed the same thing but no answer:
https://vborg.vbsupport.ru/showthread.php?t=115319

Any help appreciated!
Reply With Quote
  #2  
Old 08-14-2011, 12:46 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I haven't tried it so I don't know if it will work, but you could try making a plugin with code like:

PHP Code:
if (some check for forumid)
    
$vbulletin->options['reputationenable'] = 0

The problem is figuring out where to do that. I'm not sure you can do it in a "global" hook (one that gets run on every page) because I think sometimes you don't know what forum you're dealing with until you get in to the specific script.

You could probably start out with a plugin using showthread_getinfo and something like:

PHP Code:
if (in_array($thread['forumid'], array(123)))
    
$vbulletin->options['reputationenable'] = 0

(or else try what HMBeaty suggests in the next post).
Reply With Quote
  #3  
Old 08-14-2011, 12:49 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or you could just wrap the reputation images in a conditional in the postbit so that you can only see it on certain forums
Reply With Quote
  #4  
Old 08-16-2011, 03:02 PM
GavoTrav's Avatar
GavoTrav GavoTrav is offline
 
Join Date: Jun 2011
Location: Ireland
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I haven't tried it so I don't know if it will work, but you could try making a plugin with code like:

PHP Code:
if (some check for forumid)
    
$vbulletin->options['reputationenable'] = 0

The problem is figuring out where to do that. I'm not sure you can do it in a "global" hook (one that gets run on every page) because I think sometimes you don't know what forum you're dealing with until you get in to the specific script.

You could probably start out with a plugin using showthread_getinfo and something like:

PHP Code:
if (in_array($thread['forumid'], array(123))
    
$vbulletin->options['reputationenable'] = 0

(or else try what HMBeaty suggests in the next post).
I used,

Code:
if (in_array($thread['forumid'], array(80, 102))
    $vbulletin->options['reputationenable'] = 0;
Result:
Code:
Parse error: syntax error, unexpected T_VARIABLE in /home/user/public_html/forums/showthread.php(377) : eval()'d code on line 2
Quote:
Originally Posted by HMBeaty View Post
Or you could just wrap the reputation images in a conditional in the postbit so that you can only see it on certain forums
How would I go about putting it for a specific forumid.
The forum Ids would be 80, 102
Reply With Quote
  #5  
Old 08-16-2011, 03:08 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GavoTrav View Post
I used,

Code:
if (in_array($thread['forumid'], array(80, 102))
    $vbulletin->options['reputationenable'] = 0;
Result:
Code:
Parse error: syntax error, unexpected T_VARIABLE in /home/user/public_html/forums/showthread.php(377) : eval()'d code on line 2
How would I go about putting it for a specific forumid.
The forum Ids would be 80, 102
Try this:
HTML Code:
<if condition="in_array($post['forumid'], array(80,102))">
reputation code here
</if>
Reply With Quote
Благодарность от:
GavoTrav
  #6  
Old 08-16-2011, 03:08 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GavoTrav View Post
I used,

Code:
if (in_array($thread['forumid'], array(80, 102))
    $vbulletin->options['reputationenable'] = 0;
Result:
Code:
Parse error: syntax error, unexpected T_VARIABLE in /home/user/public_html/forums/showthread.php(377) : eval()'d code on line 2
Oops, sorry, that was missing a close paren.

PHP Code:
if (in_array($thread['forumid'], array(80102)))
    
$vbulletin->options['reputationenable'] = 0
Reply With Quote
Благодарность от:
GavoTrav
  #7  
Old 08-16-2011, 03:10 PM
GavoTrav's Avatar
GavoTrav GavoTrav is offline
 
Join Date: Jun 2011
Location: Ireland
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Oops, sorry, that was missing a close paren.

PHP Code:
if (in_array($thread['forumid'], array(80102)))
    
$vbulletin->options['reputationenable'] = 0
This works perfectly!

Thanks
Reply With Quote
  #8  
Old 08-16-2011, 03:16 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Count your parenthesis - you need to have an equal amount of ( and ) and you do not.
Reply With Quote
  #9  
Old 08-16-2011, 03:28 PM
GavoTrav's Avatar
GavoTrav GavoTrav is offline
 
Join Date: Jun 2011
Location: Ireland
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Count your parenthesis - you need to have an equal amount of ( and ) and you do not.
It worked anyway. This is what I used:

Attached file
Attached Files
File Type: xml Disable reputation in section.xml (362 Bytes, 15 views)
Reply With Quote
  #10  
Old 08-16-2011, 03:31 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GavoTrav View Post
It worked anyway.
I think Lynne was just a little late responding to the earlier post where the parenthesis was missing.
Reply With Quote
Reply


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 07:28 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.04893 seconds
  • Memory Usage 2,309KB
  • Queries Executed 14 (?)
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
  • (6)bbcode_code
  • (1)bbcode_html
  • (6)bbcode_php
  • (7)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
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete