Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Aiheen aloitti: Sincere - heinäkuu 11, 2006, 07:29:54 AP

Otsikko: limiting the number of characters in the username
Kirjoitti: Sincere - heinäkuu 11, 2006, 07:29:54 AP
Hello

I often have people signing up with very very long usernames...

some people even put their email adress as their username, such as [email protected]

It would be interesting if we can limit the username to something like 20 characters.

Otsikko: Re: limiting the number of characters in the username
Kirjoitti: Sincere - heinäkuu 15, 2006, 06:18:11 AP
Lainaus käyttäjältä: Sincere - heinäkuu 11, 2006, 07:29:54 AP
Hello

I often have people signing up with very very long usernames...

some people even put their email adress as their username, such as [email protected]

It would be interesting if we can limit the username to something like 20 characters.



How can I encourage the knowledgeable ones to help me?

How can I get help?

I can pay a professional who can help with this.
Otsikko: Re: limiting the number of characters in the username
Kirjoitti: H - heinäkuu 15, 2006, 06:31:31 AP
Open Forum / themes / default / register.template.php

Find:


<input type="text" name="user" size="20" tabindex="', $context['tabindex']++, '" maxlength="25" />


change maxlength to the maximum username length.

You will also need to edit the register.template.php of your other themes ;)
Otsikko: Re: limiting the number of characters in the username
Kirjoitti: Sincere - heinäkuu 15, 2006, 09:16:01 AP
Lainaus käyttäjältä: huwnet - heinäkuu 15, 2006, 06:31:31 AP
Open Forum / themes / default / register.template.php

Find:


<input type="text" name="user" size="20" tabindex="', $context['tabindex']++, '" maxlength="25" />


change maxlength to the maximum username length.

You will also need to edit the register.template.php of your other themes ;)


I thank you very much for this very kind help and your time.

I in fact only have one theme, the default, and users are not allowed to choose another

PLEASE, tell me, in private if you wish, how much I should send you (paypal is preferred)

Otsikko: Re: limiting the number of characters in the username
Kirjoitti: ghostfreak - heinäkuu 15, 2006, 01:01:06 IP
I don't think he wants paid :P
Otsikko: Re: limiting the number of characters in the username
Kirjoitti: JayBachatero - heinäkuu 17, 2006, 02:38:56 AP
What version of SMF are you using?  These lines make sure that it's not too long.  This is for 1.1 RC2

// Don't use too long a name.
if ($func['strlen']($regOptions['username']) > 25)
$regOptions['username'] = $func['htmltrim']($func['substr']($regOptions['username'], 0, 25));
Otsikko: Re: limiting the number of characters in the username
Kirjoitti: Sincere - heinäkuu 17, 2006, 03:42:57 AP
Lainaus käyttäjältä: Jay The Code Monkey - heinäkuu 17, 2006, 02:38:56 AP
What version of SMF are you using?  These lines make sure that it's not too long.  This is for 1.1 RC2

// Don't use too long a name.
if ($func['strlen']($regOptions['username']) > 25)
$regOptions['username'] = $func['htmltrim']($func['substr']($regOptions['username'], 0, 25));


1.1RC2

25 chars is far too long. 16 is more than enough
Otsikko: Re: limiting the number of characters in the username
Kirjoitti: JayBachatero - heinäkuu 17, 2006, 01:08:35 IP
Open Subs-Members.php and on line ~621 and ~622 change the 25 to what ever # you want.
Otsikko: Re: limiting the number of characters in the username
Kirjoitti: Sincere - heinäkuu 17, 2006, 02:00:15 IP
Lainaus käyttäjältä: Jay The Code Monkey - heinäkuu 17, 2006, 01:08:35 IP
Open Subs-Members.php and on line ~621 and ~622 change the 25 to what ever # you want.


thank you very much

I appreciate your help