Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

limiting the number of characters in the username

Aloittaja Sincere, heinäkuu 11, 2006, 07:29:54 AP

« edellinen - seuraava »

Sincere

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.

Do you need a special mod for your smf forums? contact me for a quote.

Sincere

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.
Do you need a special mod for your smf forums? contact me for a quote.

H

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 ;)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Sincere

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)

Do you need a special mod for your smf forums? contact me for a quote.

ghostfreak


http://www.xfilesforum.net - Dare To Believe?
http://www.idealforum.co.uk - The Green Blitz!

JayBachatero

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));
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Sincere

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
Do you need a special mod for your smf forums? contact me for a quote.

JayBachatero

Open Subs-Members.php and on line ~621 and ~622 change the 25 to what ever # you want.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Sincere

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

Do you need a special mod for your smf forums? contact me for a quote.

Advertisement: