Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2017, 05:02 PM
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Auto-select usergroup depending on registration option?

Hello, do you have any idea how to make these changes from a plugin ?.

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

I use version 4.2.4 and these steps do not work for me. Also I see wrong edit directly from php, I would like it to be from a plugin.

my field5:


my new group 16:


Thx!
Reply With Quote
  #2  
Old 05-25-2017, 08:13 PM
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Someone really should mark that as broken. I tried using it as well (15+ minutes) and ended up just writing a trigger (2 minutes) on my user table.

You could probably also write a plugin at register_addmember_complete.
Reply With Quote
Благодарность от:
RaYdeN.ADM
  #3  
Old 05-25-2017, 09:21 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by grey_goose View Post
Someone really should mark that as broken. I tried using it as well (15+ minutes) and ended up just writing a trigger (2 minutes) on my user table.

You could probably also write a plugin at register_addmember_complete.
After a review of the "register.php" script, it appears the best hook location might be at "register_addmember_process"...I will try my hand at putting together a product that allows defining profile fields that will determine a new user's usergroup.
Reply With Quote
Благодарность от:
RaYdeN.ADM
  #4  
Old 05-26-2017, 04:35 AM
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
After a review of the "register.php" script, it appears the best hook location might be at "register_addmember_process"...I will try my hand at putting together a product that allows defining profile fields that will determine a new user's usergroup.
It would be great to have a plug that performs this function. :up:


Waiting here
Reply With Quote
  #5  
Old 05-30-2017, 12:46 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for the delay...I was a bit under the weather over the weekend. Anyway, I have attached a simple product for you to test.

The product has two settings, one which allows you to enable/disable it (the default value is "disabled" so you will need to enable it first.

The second setting allows you to define the custom profile fields and the usergroupids associated with the possible values from that profile field.

For example, I used a single-line text profile field, and if a new user enters one of these strings:
  • Administrator
  • Global Moderator
  • Moderator

Then they are moved to that usergroup once registration is completed. The definition I used is:

field5|Administrator,6|Global Moderator,5|Moderator,7

Please let me know if you have any issues, and/or would like any additional features.
Attached Files
File Type: xml product-markflregisterusergroup.xml (3.3 KB, 3 views)
Reply With Quote
  #6  
Old 05-30-2017, 02:50 AM
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice work, thanks!

work = ok
Reply With Quote
Благодарность от:
MarkFL
  #7  
Old 05-30-2017, 02:55 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RaYdeN.ADM View Post
Nice work, thanks!

work = ok
Okay, good deal. I will publish this officially soon, after perhaps adding additional features if I think of any, and I will cite you as co-author since it was your request.
Reply With Quote
  #8  
Old 06-01-2017, 12:23 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have published a more robust version here:

Auto-Select Usergroup Based On Profile Field(s)
Reply With Quote
  #9  
Old 06-01-2017, 12:41 AM
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good work!
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 08:01 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.04391 seconds
  • Memory Usage 2,271KB
  • Queries Executed 12 (?)
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
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (3)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete