Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: True Knight on April 07, 2006, 05:58:12 PM

Title: How can I set primary membergroup at the time of registration??? (SOLVED)
Post by: True Knight on April 07, 2006, 05:58:12 PM
I want to be able to assign a primary membergroup at the time of registration. So far I am able to assignin an additional membergroup at the time of registration (with some help from some folks from this forum.)

Here's the code in Register.php

Quote// This is the code to put them in the appropriate gender membergroup change the values accordingly
   if ($row['gender'] == 1)
   {
      updateMemberData($row['ID_MEMBER'], array('additionalGroups' => "26"));
   }
   else
   {
      updateMemberData($row['ID_MEMBER'], array('additionalGroups' => "25"));
   }

How can I make the last one assign to Primary Member group 25 and not additionalGroups 25?

Thanks!
True Knight
Title: Re: How can I set primary membergroup at the time of registration??? (SOLVED)
Post by: True Knight on April 11, 2006, 10:08:01 AM
I resolved this issue after a lot of trial and error... Here's the solution!

// This is the code to put them in the appropriate gender membergroup change the values accordingly
if ($row['gender'] == 1)
{
updateMemberData($row['ID_MEMBER'], array('additionalGroups' => "26"));
}
else
{
updateMemberData($row['ID_MEMBER'], array('ID_GROUP' => "25"));
}
Title: Re: How can I set primary membergroup at the time of registration??? (SOLVED)
Post by: DiLDoG on April 11, 2006, 01:30:41 PM
RACIST!!!! :P
Title: Re: How can I set primary membergroup at the time of registration??? (SOLVED)
Post by: True Knight on April 12, 2006, 07:37:03 AM
Raceist? I'm not seperating by Race, I'm seperating by gender. I know you are only half-joking but the reason is...because my forum deals with sensitive support issues that are necessary to deal with seperatly...men must have a men only support area, and women must have a women only support area so that they can feel comfortable talking about certain issues that we deal with on my forum.

Thanks,
True Knight