Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Limit size of User Name
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

JohnC
Junior Member

215 Posts

Posted - 09 October 2004 :  10:43:40  Show Profile
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  Show Profile
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.
Go to Top of Page

JohnC
Junior Member

215 Posts

Posted - 11 October 2004 :  14:33:26  Show Profile
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
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 11 October 2004 :  17:50:36  Show Profile
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.
Go to Top of Page

rasure
Junior Member

289 Posts

Posted - 11 October 2004 :  18:43:31  Show Profile  Visit rasure's Homepage
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
Go to Top of Page

JohnC
Junior Member

215 Posts

Posted - 12 October 2004 :  04:34:34  Show Profile
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...?
Go to Top of Page

rasure
Junior Member

289 Posts

Posted - 12 October 2004 :  05:00:27  Show Profile  Visit rasure's Homepage
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
Go to Top of Page

JohnC
Junior Member

215 Posts

Posted - 12 October 2004 :  05:34:52  Show Profile
Great! Thanks again rasure, that was an easy fix.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.43 seconds. Powered By: Snitz Forums 2000 Version 3.4.07