Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Minimum Reputation to Join Public User Group Details »»
Minimum Reputation to Join Public User Group
Version: 1.6, by antialiasis antialiasis is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 04-14-2006 Last Update: 08-14-2006 Installs: 5
DB Changes Uses Plugins Template Edits
 
No support by the author.

This is a nice, simple product that basically allows you to set a minimum reputation for users to be able to join a public user group. Additionally, if a user's reputation level drops back below the limit, that user group will be temporarily "disabled", and then automatically activated again once the user reaches the limit again and so on.

This hack can be modified so that it uses a minimum post count, etc. instead of minimum reputation.

What it does in detail:

1) An option is added to the Admin CP for editing or adding user groups other than the default ones, which allows you to specify a minimum reputation level that people must have in order to join this user group.

2) When listing joinable user groups in the User CP, any free-for-all user group with a set minimum reputation level will have that reputation level shown in the Joining Conditions. If the user has reached that reputation level, the "Join Group" radio button is shown as normal; however, if the user has not, it will instead show a "You do not meet the minimum requirements to join this group" message. (There is also a plugin with a small sanity check: if somehow a user is joining the group anyway and doesn't have enough reputation, the user will stay in the group they're already in.)

3) Every time a user is given positive or negative reputation, a script checks whether any of the user's groups should be enabled or disabled, and if so, it makes the change.

4) When listing joinable user groups in the User CP, any usergroup which is disabled will be listed as one you are not a member of, but will have a notice instead of "Join Group" saying that you are already an inactive member of it.


Special thanks go to hambil for writing a better version of one of the plugins for me when my version wasn't working.

Version 1.6: Fixed both a code bug (see post by chiaa) and the inability to use 0 or a negative number as the minimum reputation.
Version 1.5: Added the feature to kick a user out of a group when dropping below minimum reputation level.


To install, simply import the product (which contains five plugins and five phrases, I believe, and adds two database columns) and make two template edits to modifyusergroups_nonmemberbit:

FIND

Code:
        <else />
                $vbphrase[anyone_free_to_join_group]
        </if>
REPLACE with

Code:
	<else />
                <if condition="$usergroup['minreputation']">
                        $vbphrase[minimum_reputation]: $usergroup[minreputation]
                <else />
		        $vbphrase[anyone_free_to_join_group]
                </if>
	</if>
Also FIND

Code:
        <else />
		<label for="rb_join_$usergroup[usergroupid]"><input type="radio" name="usergroupid" id="rb_join_$usergroup[usergroupid]" value="$usergroup[usergroupid]" />$vbphrase[join_group]</label>
        </if>
REPLACE with

Code:
	<else />
                <if condition="(!$usergroup['minreputation'] OR ($vbulletin->userinfo['reputation'] >= $usergroup['minreputation'])) AND !$inactivegroup">
		         <label for="rb_join_$usergroup[usergroupid]"><input type="radio" name="usergroupid" id="rb_join_$usergroup[usergroupid]" value="$usergroup[usergroupid]" />$vbphrase[join_group]</label>
                <else />
                         <if condition="$inactivegroup">
                                  $vbphrase[group_inactive]
                         <else />
                                  $vbphrase[cannot_join_group]
                         </if>
                </if>
	</if>
And you're done. Enjoy and click Install.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-15-2006, 01:50 AM
bada_bing's Avatar
bada_bing bada_bing is offline
 
Join Date: Feb 2004
Location: Michigan
Posts: 1,698
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds usefull I will reserve this for my new site and one I add it I will click install
Reply With Quote
  #3  
Old 04-15-2006, 05:23 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah I'll definitely install this right now.
Reply With Quote
  #4  
Old 04-22-2006, 04:12 AM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Upgraded to version 1.5, major feature added.
Reply With Quote
  #5  
Old 07-15-2006, 09:11 AM
chiaa chiaa is offline
 
Join Date: Apr 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I make it so someone has to have a minimum post count and minimum reputation? Not the or as mentioned in hack description, but both =).
Reply With Quote
  #6  
Old 07-15-2006, 12:30 PM
aLReeMi aLReeMi is offline
 
Join Date: Jun 2006
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #7  
Old 07-16-2006, 04:21 AM
chiaa chiaa is offline
 
Join Date: Apr 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After install I got:

Warning: array_intersect(): Argument #2 is not an array in /reputation.php(172) : eval()'d code on line 23

Warning: implode(): Bad arguments. in /reputation.php(172) : eval()'d code on line 23

when giving reputation. Everything seems to be functioning correctly, but I have disabled the mod until I know what the hell this is.
Reply With Quote
  #8  
Old 08-14-2006, 10:29 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I think I fixed your problem. Upgrade the product.

Both minimum post count and reputation... Hmm, I'd need to make some fairly extensive changes, but it's a good idea for the hack anyway. Will do. =)
Reply With Quote
  #9  
Old 09-23-2006, 02:08 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hack

I'd like to be able to make the profile_joingroup_unmoderated call at the global level, just so I could display it in another page. Any idea how to get the variables?

Thanks
Reply With Quote
  #10  
Old 09-28-2006, 06:21 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As in you'd want to display a list of usergroups you need minimum reputation to join somewhere on another page?
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 01:29 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06201 seconds
  • Memory Usage 2,296KB
  • Queries Executed 23 (?)
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
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)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