PDA

View Full Version : Give specific REP power to usergroups


Skyrider
03-14-2014, 05:47 PM
Seeing there's no plugin that alters/changes a user or group's Reputation Power directly and instantly, I was wondering if someone could help me with this. I'm wanting to give a specific usergroup reputation power.

I found this:
https://vborg.vbsupport.ru/showthread.php?t=98163

but I can't get it to work. Most likely (I assume) because it's meant for an older version of vBulletin, but I appreciate the help someone can give me.

I know the "reputation power" is calculated, etc. But the forums reputation has been altered for our needs, and seeing the system is quite limited.. I'm forced to do other methods.

Regards,
Skyrider

Lynne
03-14-2014, 10:08 PM
Did you try just writing a plugin to use the reputation_power hook location? Something like:

if (is_member_of($userinfo['usergroup'], xx)) $reppower = yy;


NOT TESTED AT ALL, so test on your test site.

Skyrider
03-15-2014, 12:07 AM
I have tried that this morning, but that doesn't seem to work I'm afraid. The reputation of the user doesn't change at all. We have our "+" reputation completely disabled / removed. People can only give negative reputation. So if this code "only" works if a user in the group receives positive reputation for it to alter to the number in the plugin code, then I'm afraid I need another method.

I'm afraid the reputation function php code overrides the plugin one.. but I could be wrong.

Appreciate the reply btw!

tbworld
03-15-2014, 02:44 AM
Did you try just writing a plugin to use the reputation_power hook location? Something like:

if (is_member_of($userinfo['usergroup'], xx)) $reppower = yy;
NOT TESTED AT ALL, so test on your test site.


Try this: @Lynne was very close. Thanks @Lynne :)
if (is_member_of($vbulletin->userinfo, xx)) $reppower = yy;xx = User Group ID or list of ID's ie. 6,5,3
yy = Your reputation number

Hook: reputation_power

Note - This does not write to the database, it just alters the displayed information that gets sent to the template.

Skyrider
03-15-2014, 10:45 AM
Try this: @Lynne was very close. Thanks @Lynne :)
if (is_member_of($vbulletin->userinfo, xx)) $reppower = yy;xx = User Group ID or list of ID's ie. 6,5,3
yy = Your reputation number

Hook: reputation_power

Note - This does not write to the database, it just alters the displayed information that gets sent to the template.
I'm sorry, even that doesn't work. And I'm sure I the hook, usergroup & value of the reppower is correct. And yea, even the plugin is active. If you mean by the way by "displayed" that it is only for the show, then I really need something that actually does the real deal.

I really need specific usergroups to have a specific certain of rep power that works with when they are repping people.

If a hook won't do the trick, then maybe I need to try something within the functions_reputation.php regarding the administration rep power that will also affects specific groups as also been used here:

https://vborg.vbsupport.ru/showthread.php?t=98163

Same link as I've posted in the first post.

Thanks for all the help thus far!

Regards,
Skyrider

tbworld
03-15-2014, 10:48 AM
What version of vBulletin, PHP?

Show your plugin code here. Something is wrong, or you have another modification interfering. I tested the code above before I posted it. (Of course there is always bizarre circumstances.) Do you have any other reputation mods loaded?

Skyrider
03-15-2014, 10:56 AM
Using vBulletin 4.2.1, PHP 5.2.17

Code:
if (is_member_of($vbulletin->userinfo, 27)) $reppower = 123;

Hook: reputation_power

Running the following reputation mods: (reputation wise).

- Enhanced Reputation Checks - https://vborg.vbsupport.ru/showthread.php?t=231790
- Extended reputation display - https://vborg.vbsupport.ru/showthread.php?t=231876

Disabled them, but no effect. Rep power is still the same.

tbworld
03-15-2014, 11:01 AM
Try placing the code in 'functions_reputation.php' right after the hook around line #77. This is very simple code it should work.

if (is_member_of($vbulletin->userinfo, 6)) $reppower = 66;


This is exactly the syntax I tested at the same location.

Skyrider
03-15-2014, 11:10 AM
It's very weird, but not even that seems to work. That's odd, because I'm also using:

($hook = vBulletinHook::fetch_hook('reputation_power')) ? eval($hook) : false;

$reppower *= 2;
return $reppower;
in functions_reputation.php

Of which that works, and is giving every user reputation power of 2. Of which I want for everyone to start off with. But if I even add a if / else like I've done yesterday, or temp-disabled reppower 2 and used your line before and even tried after the return $reppower; (around line 77) code. It refuses to alter/change the rep power of that specific group.

Final code:
($hook = vBulletinHook::fetch_hook('reputation_power')) ? eval($hook) : false;

if (is_member_of($vbulletin->userinfo, 27)) $reppower = 123;
return $reppower;

Even by disabling all plugins and leave the above usergroup rep power code intact in the php file, doesn't change the usergroups rep power.

tbworld
03-15-2014, 11:17 AM
What version of vBulletin are you running?

Skyrider
03-15-2014, 11:18 AM
4 posts above, Using vBulletin 4.2.1, PHP 5.2.17.

tbworld
03-15-2014, 11:29 AM
Okay hold on.. Your looking for the posters reputation not the viewers reputation correct? I was so caught up in correcting the code, that I never examined the functionality. So lets go back and check our premises. That is what happens when I try to juggle too many tasks :)

Skyrider
03-15-2014, 11:37 AM
Hehe, no problem. I appreciate the help so far. But ya, I'm merely interested in altering a specific usergroups reputation power (not normal reputation). Doesn't matter if it shows the rep power incorrectly, as long the altered rep power has an effect when giving people reputation.

tbworld
03-15-2014, 11:42 AM
So to confirm. you want this particular user group to have an elevated reputation power, so that it will have an increased effect when giving another user a reputation?

Skyrider
03-15-2014, 11:43 AM
Exactly :).

tbworld
03-15-2014, 11:48 AM
Okay, let me rethink this from scratch as if I were to do this. At first I was just trying to correct the "if condition", as I figured the logic was already worked out, but I need to work this out for myself. Going to grab a cup of coffee and look at the code.

ozzy47
03-15-2014, 11:53 AM
Have you tried this mod, https://vborg.vbsupport.ru/showthread.php?t=266604

Skyrider
03-15-2014, 11:58 AM
Have you tried this mod, https://vborg.vbsupport.ru/showthread.php?t=266604
I have, but from what I read it only "works" when that usergroup has an increased rep power and gives out positive rep. Positive rep is disabled on our forums. From what I can tell, I can't get that plugin to work on my end. I just need something that gives out rep power right away to specific groups. Much easier for us to work with.