Quote:
Originally Posted by paulfletcher
Hey.  Well It was working for the secondary user-group. Although I found out that I needed one for the primary group. So Amykhar helped me out with this slight modification of the script... Works on my board (3.5.4).
PHP Code:
switch($userinfo['field5']) { case "A": $userdata->set('usergroupid', 12); break; case "B": $userdata->set('usergroupid', 13); break; case "C": $userdata->set('usergroupid', 18); break; }
Talk to you later,
Paul F
|
Hello,
I have made it like this;
switch($userinfo['field5'])
{
case "Male":
$userdata->set('usergroupid', 30);
break;
case "Female":
$userdata->set('usergroupid', 29);
break;
}
and added beneath the the plugin
Quote:
// Get the value for field 5
$user = $db->query_first("
SELECT field5
FROM " . TABLE_PREFIX . "userfield
WHERE userid = " . $vbulletin->userinfo['userid'] . "
");
if ($user['field5'] == 'Male')
{
$userdata->set('usergroupid', 30);
if ($user['field5'] == 'Female')
{
$userdata->set('usergroupid', 29);
}
switch($userinfo['field5'])
{
case "Male":
$userdata->set('usergroupid', 30);
break;
case "Female":
$userdata->set('usergroupid', 29);
break;
}
|
Am I doing this right?
Thanks for a reply, of any advanced person with this script