I was trying to creat a custom Register Page outside the vB And i will use the Custom Page writing in this page but for some reson it dont work with me .. could someone please give me example code working ?
PHP Code:
<?php
# Add a user to vBulletin (offline)
function qpc_post($varname)
{
return trim(stripslashes((get_magic_quotes_gpc()) ? $_POST[$varname] : addslashes($_POST[$varname])));
}
$dst_setting = intval(qpc_post('dst'));
switch ($dst_setting)
{
case 0:
case 1:
$userdm->set_bitfield('options', 'dstonoff', $dst_setting);
break;
case 2:
$userdm->set_bitfield('options', 'dstauto', 1);
break;
}
#If there are errors (eMail not set, eMail banned, Username taken, etc.) you can check for errors using
if (count($userdm->errors)) {
for($i=0; $i<count($userdm->errors); $i++) {
print "ERROR{$i}:{$userdm->errors[$i]}\n";
}
} else {
# If everything is OK
$newuserid = $userdm->save();
print "vbuserid:$newuserid\n";
}