Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2014, 05:47 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 03-14-2014, 10:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-15-2014, 12:07 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #4  
Old 03-15-2014, 02:44 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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.
Reply With Quote
  #5  
Old 03-15-2014, 10:45 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
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
Reply With Quote
  #6  
Old 03-15-2014, 10:48 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 03-15-2014, 10:56 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 03-15-2014, 11:01 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 03-15-2014, 11:10 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 03-15-2014, 11:17 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What version of vBulletin are you running?
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 02:13 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.09433 seconds
  • Memory Usage 2,261KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_php
  • (2)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
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete