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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Anti-spam Birthdate Add-on
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 18 January 2007 :  09:20:49  Show Profile  Reply with Quote
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:
"                      <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:
"                      <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:
"                      <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:
"                      <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:
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:
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.”

Edited by - Shaggy on 18 January 2007 09:22:04

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 January 2007 :  10:20:46  Show Profile  Visit JJenson's Homepage  Reply with Quote
Thanks Shaggy that will be great to have.<
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 January 2007 :  11:53:07  Show Profile  Visit JJenson's Homepage  Reply with Quote
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? <
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 18 January 2007 :  11:56:35  Show Profile  Reply with Quote
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

<

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.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 January 2007 :  11:59:44  Show Profile  Visit JJenson's Homepage  Reply with Quote
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.<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 18 January 2007 :  12:01:16  Show Profile  Reply with Quote
Ay, fire away, you know where I am if you need me

<

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.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 January 2007 :  12:02:35  Show Profile  Visit JJenson's Homepage  Reply with Quote
Sounds great thanks<
Go to Top of Page

Mr Pink
Junior Member

United Kingdom
387 Posts

Posted - 22 January 2007 :  14:53:50  Show Profile  Visit Mr Pink's Homepage  Send Mr Pink an AOL message  Reply with Quote
I'd like to use this code with the Firstname field, can somebody help me with this please.<

Martin
Leyland Forum Leyland Lancashire UK
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 22 January 2007 :  14:56:48  Show Profile  Visit JJenson's Homepage  Reply with Quote
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.<
Go to Top of Page

Mr Pink
Junior Member

United Kingdom
387 Posts

Posted - 22 January 2007 :  15:20:05  Show Profile  Visit Mr Pink's Homepage  Send Mr Pink an AOL message  Reply with Quote
Thanks Jeff <

Martin
Leyland Forum Leyland Lancashire UK
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 22 January 2007 :  15:21:12  Show Profile  Visit JJenson's Homepage  Reply with Quote
No problem Glad you got it working.<
Go to Top of Page

jon123456
Starting Member

United Kingdom
8 Posts

Posted - 04 March 2007 :  12:24:56  Show Profile  Visit jon123456's Homepage  Reply with Quote
Nice and simple and implementation worked at first attempt on my new 3.4.0.6 forum - Thanks <
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 March 2007 :  05:22:21  Show Profile  Reply with Quote
You're welcome.

<

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.”
Go to Top of Page

KC
Junior Member

USA
152 Posts

Posted - 07 March 2007 :  14:33:24  Show Profile  Visit KC's Homepage  Reply with Quote
Just a note Shaggy...
Come on man, please don't leave all that blank space on
the left in your code post.
I'm running 1152x864 full screen browser and have to horizontal scroll way to many times for every text line in every post like this one even condensing screen size with Ctrl-Mouse Wheel Scroll!

Just editing it so
" <td bgcolor=""" & strPopUpTableColor & """

Just displayed in your post as
"<td bgcolor=""" & strPopUpTableColor & """
Would really help.
My old eyes and hands just can't see that small text and move that much even on a 21" monitor ;-}
----------

Now about this "spam and bot registrations" thing...

If you run an NT server, an Access database, and VBscript
Put this code right below your last <!--include-->
line in your policy.asp page.


<%
if not request.servervariables("http_referer") ="" then
refer=request.servervariables("http_referer")
refer= LCase(refer)
ELSE
refer=""
end if

if left(refer,17) ="http://vales.com/" then
%>
(display the page)

You need to change the URL in this example!
The refer tag simply looks where the click or direct URL entry came from.

The format is:

<%if left(refer,17) ="http://vales.com/"%>

Where in this example ="http://vales.com/" is my entire server and not a specifc site, you can do that buy extending the URL like this:

<%left(refer,32) ="http://YourSitename.com/special/

The "left(refer,NUMBER)" is the exact legnth from the Refer URL from the left you want to compare, so make sure the count matches the text.
What this does is simply prevent people from using whatever page you want protected from entering from anying but a link from your site.

------

At the very bottom of the code, add this line to close it out.

<%
else
Response.Redirect "http://vales.com/problem.htm"
end if
%>
-----------
You can Response.Redirect that problem address anywhere to any page you want.
But mission acomplished, if you are not clicking the link from the site you can't do squat on a protected page.



<

Owner of vales.com and Elite Computers.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 08 March 2007 :  04:11:40  Show Profile  Reply with Quote
KC, that's exactly as those lines appear in the Snitz files; were I to remove the white space before posting here, those searching for the entire line by copying it from here would never find it and would be in here moaning that my instructions are wrong.

As for your mod, we used to check the referring URL to ensure people came through policy.asp before registering; however this caused no end of problems for Norton users as Norton blocks the sending of the http_referer variable for no good reason and these forums were chock full of posts from people who were frustrated that they couldn't get past policy.asp. Also, bots can easily be rewritten to land on another page in your forum and then following your registration link.

<

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.”
Go to Top of Page

kolucoms6
Average Member

845 Posts

Posted - 13 January 2008 :  02:38:08  Show Profile  Reply with Quote

I used the code, but somehow I cant see the DOB field..

Here is the page :

http://www.ulcindia.com/forum/register.asp?mode=Register
<
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07