Use This Code in signup.php script
PHP Code:
if ($_POST['do'] == '3')
{
$vbulletin->input->clean_array_gpc('p', array(
'cfield_2' => TYPE_NOHTML,
'cfield_6' => TYPE_INT,
'cfield_7' => TYPE_INT
));
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($vbulletin->userinfo);
$userfields = array('field2' => $vbulletin->GPC['cfield_2'],
'field6' => $vbulletin->GPC['cfield_6'],
'field7' => $vbulletin->GPC['cfield_7']
);
// Saving Userfields Now
$userdata->set_userfields($userfields);
$userdata->set('usergroupid', 9);
$userdata->pre_save();
if (!empty($userdata->errors))
{
$errorlist = '';
foreach ($userdata->errors AS $index => $error)
{
$errorlist .= "<li>$error</li>";
}
// ... additional code; $errorlist is outputted to the user
}
else
{
// save the data
$vbulletin->userinfo['userid'] = $userid = $userdata->save();
// ... additional processing code
}
}