vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Auto-select usergroup depending on registration option? (https://vborg.vbsupport.ru/showthread.php?t=325140)

RaYdeN.ADM 05-24-2017 05:02 PM

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:
https://vborg.vbsupport.ru/external/2017/05/15.png

my new group 16:
https://vborg.vbsupport.ru/external/2017/05/16.png

Thx! :)

grey_goose 05-25-2017 08:13 PM

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.

MarkFL 05-25-2017 09:21 PM

Quote:

Originally Posted by grey_goose (Post 2586960)
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. :)

RaYdeN.ADM 05-26-2017 04:35 AM

Quote:

Originally Posted by MarkFL (Post 2586963)
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 :)

MarkFL 05-30-2017 12:46 AM

1 Attachment(s)
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. :)

RaYdeN.ADM 05-30-2017 02:50 AM

Nice work, thanks!

work = ok :)

MarkFL 05-30-2017 02:55 AM

Quote:

Originally Posted by RaYdeN.ADM (Post 2587097)
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. :)

MarkFL 06-01-2017 12:23 AM

I have published a more robust version here:

Auto-Select Usergroup Based On Profile Field(s)

RaYdeN.ADM 06-01-2017 12:41 AM

Good work!


All times are GMT. The time now is 06:30 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.01193 seconds
  • Memory Usage 1,730KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete