Facebook 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4289
Latest: JoshuaShoor
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43790
Total Topics: 7602
Most Online Today: 75
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 61
Total: 61

Author Topic: Default [Additional] Membergroups upon Registration  (Read 255 times)

0 Members and 1 Guest are viewing this topic.

Offline Senkusha

  • Community Suite Customer
  • Member
  • ******
  • Posts: 39
    • View Profile
    • The Kawaii Klub
Default [Additional] Membergroups upon Registration
« on: April 24, 2025, 06:20:28 am »
I've been poking around on the modifications page looking for a mod that will automatically assign membergroups upon registration.  But, I want to assign these membergroups on the Additional Membergroups section, but not changing the Primary Member Group (I'm using membergroups as a method of Access Control.

I would love a full mod for this, but a simple database/php hack would be acceptable for a quick and dirty fix in the Registration php file.

I have two membergroups that I want all members to be initially assigned.  I'm thinking that the database query could be modified to include:
Code: [Select]
$query = $smcFunc('','
  UPDATE {db_prefix}members
  SET additional_groups = {string:memberGroups}
  WHERE id_member = {int:newMember}',
  array(
    'memberGroups = '15,16',
    'newMember' => $ID_MEMBER,
  )
);
Where:
  15, 16 are the ID's of the membergroups I want to add.
  $ID_MEMBER is the newly generated ID

Does this look correct?
-- Senkusha
Creative Pioneer exploring anime role playing adventures!
Visit my Creative Anime Role Playing Community
SMF 2.1.4

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16673
    • View Profile
Re: Default [Additional] Membergroups upon Registration
« Reply #1 on: April 30, 2025, 10:22:52 am »
Looks ok I suggest giving it a try.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
4811 Views
Last post April 21, 2007, 10:13:58 pm
by olandir
1 Replies
6105 Views
Last post July 11, 2011, 08:55:18 am
by SMFHacks
8 Replies
10736 Views
Last post August 19, 2016, 04:45:29 am
by Tonyvic
3 Replies
1654 Views
Last post May 18, 2022, 10:06:01 am
by SMFHacks
0 Replies
1769 Views
Last post March 18, 2023, 05:21:23 am
by mickjav

+- Recent Topics

[Mod]Cloudflare Turnstile for SMF by SMFHacks
May 08, 2025, 10:08:43 am

Disable "Notify me of Comments feature" by Kiwi
May 08, 2025, 02:04:16 am

Trying to access array offset on null by Michel68
May 05, 2025, 08:47:34 am

Default [Additional] Membergroups upon Registration by SMFHacks
April 30, 2025, 10:22:52 am

Sorted FTP Import Directory by SMFHacks
April 25, 2025, 05:11:22 am

Search results items per page? by SMFHacks
April 18, 2025, 04:12:23 pm

Suggestions and request by Senkusha
April 03, 2025, 02:30:43 pm

How does a member add a Classified Listing? by SMFHacks
March 28, 2025, 08:05:50 pm

Auto converting to webp or AVIF by [chrisB]
March 28, 2025, 01:46:00 pm

Thumbnail creation settings by SMFHacks
March 28, 2025, 12:42:51 pm

Powered by EzPortal