Anti-spam Birthdate Add-on - Posted (9341 Views)
Support Moderator
Shaggy
Posts: 6780
6780
This is a very simple little add-on that will dramatically reduce the number of spam registrations on your forums. While it won't stop spammers from manually registering for accounts, it will stimmy the vast majority of scripts and bots out there which are pre-programmed to only complete those fields that are required on the registration form. This add-on will make the date of birth (or age, depending on your setup) field required and throw an error if it isn't completed.
First, find the following on line 346 of inc_profile.asp:
Code:
"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Age: </font></b></td>" & vbNewLine & _
And replace it with the following:
Code:
"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> Age: </font></b></td>" & vbNewLine & _
Find the following on line 374:
Code:
"                      <td bgcolor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Birth Date: </font></b></td>" & vbNewLine & _
And replace it with the following:
Code:
"                      <td bgcolor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> Birth Date: </font></b></td>" & vbNewLine & _
Find the following on lines 1150 and 1465 (which will become line 1471 after the first edit) of pop_profile.asp and on line 381 of register.asp:
Code:
if len(strMAge) > 0 then
if not isNumeric(strMAge) then
Err_Msg = Err_Msg & "<li>You must enter a numerical value for your age.</li>"
elseif strMinAge > 0 and strMAge < strMinAge then
Err_Msg = Err_Msg & "<li>You must be at least " & strMinAge & " years old.</li>"
end if
end if
And replace it with the following:
Code:
if len(strMAge) > 0 then
if not isNumeric(strMAge) then
Err_Msg = Err_Msg & "<li>You must enter a numerical value for your age.</li>"
elseif strMinAge > 0 and strMAge < strMinAge then
Err_Msg = Err_Msg & "<li>You must be at least " & strMinAge & " years old.</li>"
end if
else
if strAge = "1" then
Err_Msg = Err_Msg & "<li>You must provide your age.</li>"
elseif strAgeDOB = "1" then
Err_Msg = Err_Msg & "<li>You must provide your birth date.</li>"
end if
end if
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Advanced Member
JJenson
Posts: 2121
2121
Thanks Shaggy that will be great to have.<
Posted
Advanced Member
JJenson
Posts: 2121
2121
Hey shaggy is there a way we can take this one step further and maybe create a way the Super Admin can have a check box that if checked will make that field required?
I believe it s houldn't be terribly difficult but I could be wrong? smile<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Ay, you can if you want - I may even do it meself if I have a bit of time over the next few days - but the main purpose of this was to give people a quick & easy way to deter the spambots moreso than making those fields mandatory for all members, if you get my meaning wink
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Advanced Member
JJenson
Posts: 2121
2121
Definantly I understand and is great. Just thought the added feature would be nice. I have done it manually and maybe will take a shot at doing this. Maybe I will take a shot at it and you can correct me if I am wrong? I could use the learning experiance.<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Ay, fire away, you know where I am if you need me smile
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Advanced Member
JJenson
Posts: 2121
2121
Sounds great thanks<
Posted
Junior Member
Mr Pink
Posts: 387
387
I'd like to use this code with the Firstname field, can somebody help me with this please.<
Martin
Leyland Forum Leyland Lancashire UK
Posted
Advanced Member
JJenson
Posts: 2121
2121
Look here Mr. Pink:

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=59513&SearchTerms=last,name,required

Just apply this to the first name instead of the last name.<
Posted
Junior Member
Mr Pink
Posts: 387
387
Thanks Jeff smile<
Martin
Leyland Forum Leyland Lancashire UK
Posted
Advanced Member
JJenson
Posts: 2121
2121
No problem Glad you got it working.<
You Must enter a message