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

Reply
 
Thread Tools
Random Usergroup on Registration Details »»
Random Usergroup on Registration
Version: 1.02, by dstruct2k dstruct2k is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Category: Profile Enhancements - Version: 3.8.x Rating:
Released: 04-12-2009 Last Update: 04-12-2009 Installs: 17
Uses Plugins
Re-useable Code  
No support by the author.

This is a remake of one of my earlier mods, found here.

The original did not support the plugin system, and could not deal with email activation. Now both of these issues have been addressed!

What does this addon do?
This addon will allow admins to set a list of usergroups by usergroupid for new members to be randomly sorted into. You still have to create the usergroups yourself, this addon just sorts people into them.

Why do I want this addon?
If you have any reason to split your members into groups (the first example that comes to mind would be a Harry Potter website) and would like people to be sorted automatically.

Can the system be disabled?
Just disable the addon from your admincp.

Help! I can't find my usergroupid's/this addon doesn't work/I think it ate my cat!
Post your questions here! I'll be glad to assist in any way. Oh, and good luck with the cat.


Changelog
1.0 - Initial release.


1.01 - Bug Fix Release
  • Fixed issue where "random" was sometimes selecting an invalid usergroup.
  • Corrected install file to create a setting under Registration Options in vBulletin where the usergroup list could be maintained.
1.02 - Bug Fix Release
  • Corrected errors in setting validation - Please follow the example when entering your settings.

Download Now

File Type: xml product-fpx_rndm_usrgrp.xml (3.6 KB, 112 views)

Supporters / CoAuthors

Show Your Support

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

Comments
  #2  
Old 04-13-2009, 07:32 AM
dstruct2k's Avatar
dstruct2k dstruct2k is offline
 
Join Date: Dec 2002
Location: Winnipeg
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<i>Reserved.</i>
Reply With Quote
  #3  
Old 04-13-2009, 03:29 PM
Jasem's Avatar
Jasem Jasem is offline
 
Join Date: Feb 2006
Location: www.menokia.com
Posts: 594
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice work, thank you!

Installed
Reply With Quote
  #4  
Old 04-13-2009, 03:37 PM
Tobes Tobes is offline
 
Join Date: Jan 2005
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have 3.7.2--will this still work? I installed the product, and it says it worked fine, but I can't find where to define which usergroups should be used during the random assignments.
Reply With Quote
  #5  
Old 04-13-2009, 04:09 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad to see my help got this modification added so quickly! You've got a problem with your XML file. It should look like this toward the bottom:

Code:
	<options>
		<settinggroup name="register" displayorder="200">
			<setting varname="fpx_rndm_usrgrp_list" displayorder="150">
				<datatype>free</datatype>
				<defaultvalue>2</defaultvalue>
				<validationcode><![CDATA[return( preg_match("/^[\d+[\s,]*]+$|^$/", $data) );]]></validationcode>
			</setting>
		</settinggroup>
	</options>
Without the setting/settinggroup in there at all, it would result in the problem Tobes talked about - being unable to alter the settings. This code change adds an option for the random group thing to the registration options and ensures that the list entered is a valid list of numbers separated by commas or spaces (or if they want to disable it they can just enter a blank, this will stop the extra code from running in the plugins which saves on server load - though they can also enter a singular 2).
Reply With Quote
  #6  
Old 04-13-2009, 04:40 PM
dstruct2k's Avatar
dstruct2k dstruct2k is offline
 
Join Date: Dec 2002
Location: Winnipeg
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm certain the XML should've included that... I exported the product in its entirety. I suppose there's a bug with Advanced Product Management then!

Re-upped, update sent to all installed users. Thanks Tiger, I'll be doing more addons of varying difficulty over the next little while and I'll definitely keep you in mind if I get stumped again
Reply With Quote
  #7  
Old 04-13-2009, 04:46 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dstruct2k View Post
I suppose there's a bug with Advanced Product Management then!
Ah ha! So that's why your XML has a problem with mixed newline characters. It contains both linux and windows newline characters, which isn't a problem for machines to overlook but with human debugging it's a real pain. At least this modification isn't a very large one.
Reply With Quote
  #8  
Old 04-13-2009, 04:49 PM
dstruct2k's Avatar
dstruct2k dstruct2k is offline
 
Join Date: Dec 2002
Location: Winnipeg
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I found APM and it's great for building new addons from scratch... But apparently it has its flaws...
Reply With Quote
  #9  
Old 04-13-2009, 04:55 PM
dstruct2k's Avatar
dstruct2k dstruct2k is offline
 
Join Date: Dec 2002
Location: Winnipeg
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tobes View Post
I have 3.7.2--will this still work? I installed the product, and it says it worked fine, but I can't find where to define which usergroups should be used during the random assignments.
Please update to the latest version, this will correct your issues.

PS - It should work on any version of vB that supports hooks in the registration file. If you're curious, open up your register.php file and look for these 2 text blocks:
PHP Code:
($hook vBulletinHook::fetch_hook('register_form_complete')) ? eval($hook) : false
PHP Code:
($hook vBulletinHook::fetch_hook('register_activate_process')) ? eval($hook) : false
If both of these lines already exist in your register.php file, this addon will work fine. You cannot manually add these lines in, they must already exist in your version of vBulletin.
Reply With Quote
  #10  
Old 04-13-2009, 04:55 PM
Wseries Wseries is offline
 
Join Date: May 2008
Location: Sydney, Australia
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd like to use this to assign my users to one of two groups randomly, but how would I go about doing that for members who have already registered? Can this mod do that?
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 06:55 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.04698 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
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)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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
  • (1)postbit_attachment
  • (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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete