Author |
Topic  |
|
JohnC
Junior Member
 
215 Posts |
Posted - 09 October 2004 : 10:43:40
|
I searched for this topic first but came up empty handed.
How (and in what files and where) do I limit the character size of the User Name field? I consistently get people registering with long user names and it messes with the formatting of the forums.
Thanks in advance! |
|
Roland
Advanced Member
    
Netherlands
9335 Posts |
Posted - 09 October 2004 : 11:08:57
|
Try this: starting at line 211 of register.asp you should have this: if Len(trim(Request.Form("Name"))) < 3 then Err_Msg = Err_Msg & "<li>Your UserName must be at least <strong>3</strong> characters long</li>" end if
Change it to this: if Len(trim(Request.Form("Name"))) < 3 then Err_Msg = Err_Msg & "<li>Your UserName must be at least <strong>3</strong> characters long</li>" elseif Len(trim(Request.Form("Name"))) > 5 then Err_Msg = Err_Msg & "<li>Your UserName is too long. The maximum length is <strong>5</strong> characters.</li>" end if
Don't forget to change the number (5) to the max length you want to allow usernames to be. |
 |
|
JohnC
Junior Member
 
215 Posts |
Posted - 11 October 2004 : 14:33:26
|
Thanks for the quick response Roland!
I have Version 3.4.03 and on line 213 it reads:
if strAutoLogon <> 1 then if trim(Request.Form("Name")) = "" then Err_Msg = Err_Msg & "<li>You must choose a UserName</li>" end if end if
I don't see any line in my register.asp that looks like what you listed. |
Edited by - JohnC on 11 October 2004 14:35:05 |
 |
|
Roland
Advanced Member
    
Netherlands
9335 Posts |
Posted - 11 October 2004 : 17:50:36
|
If you haven't installed any MODs, I'd suggest you update your forums to the latest version and then add this fix. I tested this on 3.4.04 and it worked fine there, but even though the latest version is 3.4.05 it shouldn't matter (much).
I'll check if I still have 3.4.03 here, but I won't be able to give you the right codes today anymore as I'm heading off in a few minutes. |
 |
|
rasure
Junior Member
 
289 Posts |
Posted - 11 October 2004 : 18:43:31
|
All you need to do to limit the maximum length of a username is in inc_profile find this at around line 250
Response.Write " <input name=""Name"" size=""25"" maxLength=""25"" value="""
if strMode <> "Register" then Response.Write(ChkString(rs("M_NAME"), "display")) replace the piece in red to the number of characters you wish to limit your usernames by. The same principle can be applied any form fields. |
Psychic & Spiritual Development Resources |
Edited by - rasure on 11 October 2004 18:46:54 |
 |
|
JohnC
Junior Member
 
215 Posts |
Posted - 12 October 2004 : 04:34:34
|
Thanks for the reply, rasure, that did the trick for any new members signing up. I'm wondering what's going to happen, if anything, to the existing member names that are greater than my selected max character length...? |
 |
|
rasure
Junior Member
 
289 Posts |
Posted - 12 October 2004 : 05:00:27
|
It wont effect those who already have longer names because they cant actually change their username in the forums anyway not like that can with their passwords, not unless you have changed the username code to allow them to do this. |
Psychic & Spiritual Development Resources |
 |
|
JohnC
Junior Member
 
215 Posts |
Posted - 12 October 2004 : 05:34:52
|
Great! Thanks again rasure, that was an easy fix. |
 |
|
|
Topic  |
|