Log in

View Full Version : Disable reputation in certain forums!


GavoTrav
08-13-2011, 10:43 PM
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:

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:


if (in_array($thread['forumid'], array(1, 2, 3)))
$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
I haven't tried it so I don't know if it will work, but you could try making a plugin with code like:

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:


if (in_array($thread['forumid'], array(1, 2, 3))
$vbulletin->options['reputationenable'] = 0;



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

I used,


if (in_array($thread['forumid'], array(80, 102))
$vbulletin->options['reputationenable'] = 0;

Result:

Parse error: syntax error, unexpected T_VARIABLE in /home/user/public_html/forums/showthread.php(377) : eval()'d code on line 2


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
I used,


if (in_array($thread['forumid'], array(80, 102))
$vbulletin->options['reputationenable'] = 0;
Result:

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:
<if condition="in_array($post['forumid'], array(80,102))">
reputation code here
</if>

kh99
08-16-2011, 03:08 PM
I used,


if (in_array($thread['forumid'], array(80, 102))
$vbulletin->options['reputationenable'] = 0;

Result:

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.


if (in_array($thread['forumid'], array(80, 102)))
$vbulletin->options['reputationenable'] = 0;

GavoTrav
08-16-2011, 03:10 PM
Oops, sorry, that was missing a close paren.


if (in_array($thread['forumid'], array(80, 102)))
$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
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
It worked anyway.

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

Lynne
08-16-2011, 03:52 PM
I think Lynne was just a little late responding to the earlier post where the parenthesis was missing. :)
Yep. That's what happens when I open a bunch of threads in separate tabs and then go through them. Sometimes I end up being a bit late in posting. :)

Boofo
08-16-2011, 03:54 PM
Ahhhh, but you do it so well. ;)

Lynne
08-17-2011, 01:32 AM
Ahhhh, but you do it so well. ;)
Better late than never, right? :D

zascok
07-07-2012, 08:14 AM
what is the Hook Location for the xml attached above please?

kh99
07-07-2012, 11:56 AM
what is the Hook Location for the xml attached above please?

It uses hook showthread_getinfo. The hook name is in the xml, so if you import it you don't have to know the hook.

zascok
07-07-2012, 12:13 PM
It uses hook showthread_getinfo. The hook name is in the xml, so if you import it you don't have to know the hook.


interesting, but my vB says it's not a hook , it's a plugin, so was up to copyAndPaste :confused:

I'll try it, thank you

kh99
07-07-2012, 12:28 PM
You should be using Plugins & Products > Download / Upload Plugins, then scroll to the bottom and use the "Browse" button to find the xml file on your computer. (but if you want to use "Add New Plugin" and copy/paste the code, that's OK too).