Facebook 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4293
Latest: siriusblack
New This Month: 2
New This Week: 1
New Today: 0
Stats
Total Posts: 43802
Total Topics: 7605
Most Online Today: 473
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 262
Total: 262

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

0 Members and 4 Guests 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: 16678
    • 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
5024 Views
Last post April 21, 2007, 10:13:58 pm
by olandir
1 Replies
6336 Views
Last post July 11, 2011, 08:55:18 am
by SMFHacks
8 Replies
10965 Views
Last post August 19, 2016, 04:45:29 am
by Tonyvic
3 Replies
1974 Views
Last post May 18, 2022, 10:06:01 am
by SMFHacks
0 Replies
1919 Views
Last post March 18, 2023, 05:21:23 am
by mickjav

+- Recent Topics

SMF Classifieds 6.0 by SMFHacks
June 18, 2025, 08:26:33 pm

The path must not be empty - Bulk Uploader Issues by SMFHacks
June 13, 2025, 09:03:52 pm

A day? by davejo
June 11, 2025, 04:14:35 pm

Dual 'Upload Url' by davejo
June 06, 2025, 04:27:45 pm

Automatic Sorting of Categories by Kiwi
June 03, 2025, 10:32:32 pm

[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

Powered by EzPortal