vb.org Archive

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

GavoTrav 08-13-2011 10:43 PM

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!

kh99 08-14-2011 12:46 AM

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).

HMBeaty 08-14-2011 12:49 AM

Or you could just wrap the reputation images in a conditional in the postbit so that you can only see it on certain forums

GavoTrav 08-16-2011 03:02 PM

Quote:

Originally Posted by kh99 (Post 2233232)
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 (Post 2233234)
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

HMBeaty 08-16-2011 03:08 PM

Quote:

Originally Posted by GavoTrav (Post 2234225)
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>


kh99 08-16-2011 03:08 PM

Quote:

Originally Posted by GavoTrav (Post 2234225)
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


GavoTrav 08-16-2011 03:10 PM

Quote:

Originally Posted by kh99 (Post 2234232)
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 :D

Lynne 08-16-2011 03:16 PM

Count your parenthesis - you need to have an equal amount of ( and ) and you do not.

GavoTrav 08-16-2011 03:28 PM

1 Attachment(s)
Quote:

Originally Posted by Lynne (Post 2234238)
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

kh99 08-16-2011 03:31 PM

Quote:

Originally Posted by GavoTrav (Post 2234244)
It worked anyway.

I think Lynne was just a little late responding to the earlier post where the parenthesis was missing. :)


All times are GMT. The time now is 05:01 PM.

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.01158 seconds
  • Memory Usage 1,756KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (6)bbcode_php_printable
  • (7)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