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:
$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?