vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Give specific REP power to usergroups (https://vborg.vbsupport.ru/showthread.php?t=309529)

Skyrider 03-14-2014 05:47 PM

Give specific REP power to usergroups
 
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:

PHP Code:

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

Quote:

Originally Posted by Lynne (Post 2487307)
Did you try just writing a plugin to use the reputation_power hook location? Something like:

PHP Code:

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 :)
Code:

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

Quote:

Originally Posted by tbworld (Post 2487341)
Try this: @Lynne was very close. Thanks @Lynne :)
Code:

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:
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.
Code:

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:

Code:

($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:
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?


All times are GMT. The time now is 06:32 AM.

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.01073 seconds
  • Memory Usage 1,749KB
  • 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
  • (2)bbcode_php_printable
  • (2)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