Log in

View Full Version : How Can I set a Custom User Title?


mknapik
07-08-2008, 02:09 PM
I've been trying to mod the code in my forum to set the user title for new users based on a custom Cookie that I've set using the vbSetCookie function.

When the user registers, I try to set the usertitle to the value of the cookie.

So in global.php, i have
vbsetcookie('Foo','Bar');

and in register.php, i have
$userdata->set('customtitle',1);
$userdata->set('usertitle',$vbulletin->GPC[COOKIE_PREFIX . 'Foo']);

I would expect that the usertitle is now 'Bar', but it ends up being empty.

Please help?

--------------- Added 1215530388 at 1215530388 ---------------

Found it!

I wasn't setting the GPC properly.

Had to add $vbulletin->input->clean_gpc('c','Foo',TYPE_NOCLEAN);

Thanks anyways.