PDA

View Full Version : Capitalize a new user's name.


Masked Crusader
01-09-2007, 01:51 AM
Hey guys.

I am wanting to be a little bit of a perfectionist and I was hoping that someone may be able to help me or point me in the right direction.

When someone registers on my forum, sometimes they capitalize the first letter of their username.

What I want is a hack/plugin/product that can check, upon completing registration, whether or not the first letter of the new user's name is capitalized. If the first letter is capitalized, then do nothing. If the first letter is not capitalized, captalize it and then complete the registration.

Let me know if this possible. Thanks guys.

noppid
01-10-2007, 04:59 PM
In vBulletinHook::fetch_hook('register_start')...



if ($_POST['do'] == 'addmember')
{
$first_letter = substr($_POST['username'], 0, 1);
$the_rest = substr($_POST['username'], 1);
$_POST['username'] = strtoupper($first_letter) . $the_rest;

}


Not tested but should work;