Okay I tried doing this with your gender code, and I get sort of a weird result. This is what I have:
Code:
// Get the value for field 20
$gender = $vbulletin->db->query_first("SELECT * FROM userfield WHERE userid=".$vbulletin->userinfo['userid']);
if ($gender['field6'] == 'M')
{
$membergroupids = $userdata->fetch_field('membergroupids');
if ($membergroupids)
{
$membergroupids = $membergroupids . ", 30";
}
else
{
$membergroupids = 30;
}
$userdata->set('membergroupids', $membergroupids);
}
else
{
$membergroupids = $userdata->fetch_field('membergroupids');
if ($membergroupids)
{
$membergroupids = $membergroupids . ", 31";
}
else
{
$membergroupids = 31;
}
$userdata->set('membergroupids',$membergroupids);
}
So my gender field is field 6, and my choices at M or F. So I made a test user with the M setting, and it put them in usergroup 31. So unless I'm reading that wrong, that's the wrong one. Am I just totally missing something here? Any help would be appreciated