Quote:
Originally Posted by BirdOPrey5
That looks right if the userid is in $userid, which I don't think it is- I think it's: $vbulletin->userinfo['userid'] , I was just using $userid as an example.
No wait that isn't right... hold on...
PHP Code:
function servicenumber($userstring)
{
if ( $vbulletin->userinfo['userid'] < 10) {
$userstring = "000" . $vbulletin->userinfo['userid'];
}
elseif ( $vbulletin->userinfo['userid'] < 100) {
$userstring = "00" . $vbulletin->userinfo['userid'];
}
elseif ( $vbulletin->userinfo['userid']< 1000) {
$userstring = "0" . $vbulletin->userinfo['userid'];
}
else{
$userstring=strval($vbulletin->userinfo['userid']);
}
return $userstring;
}
The last else is needed if you already have a 4 digit id...
also, seems like I should point this out.... 9,999 isn't all that many userid's, if the forum ever becomes halfway popular you might easily exceed 4 digit userid's even if due only to spammers who sign up... I would seriously suggest using at least 5 if not 6 characters for this to give you some room to grow.
|
Of course if it ever gets that popular I'll add in an extra zero, but for the moment I don't think it's necessary. Also thanks, I'll go try this out now.
--------------- Added [DATE]1283033226[/DATE] at [TIME]1283033226[/TIME] ---------------
Weird, it's still not showing up. :/
I added it to the functions.php, and it wouldn't work, along with moving it to the functions user file, but to no avail. I truly have no clue what is going on. -.-