MOD Definition: Add-On ANti-Spam Registration
-----------------------------------------------
Version: 1
Date of Release: 18/7/2003
Author:  Robert Grund
Snitz Username: Rgrund
Installation Grade (1=easy and 10 Hard): 3


INSTALLATION GUIDELINES
-----------------------

NOTE:  ALWAYS MAKE A BACKUP FROM ALL THE FILES SO THAT YOU CAN REINSTALL YOUR OLD SYSTEM

The following files need to be modified:

a. register.asp
b. inc_profile.asp

1. open inc_profile.asp
2. Goto line 507  the section above should look like this

if strAUAnon = "1" then
  response.write "                    <tr>" & VBNewLine & _
                 "                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & fLang(strLangMOD_Ls3kAU_04000) & "<br />" & fLang(strLangMOD_Ls3kAU_04010) & ": </font></b></td>" & VBNewLine & _
                 "                      <td bgColor=""" & strPopUpTableColor & """ valign=""middle"">" & VBNewLine & _
				 "                        <select name=""AUHide"">" & vbNewLine
  if RS("M_AUHIDE") = "1" or trim(RS("M_AUHIDE")) = "" then
    response.write "                        <option value=""1"" selected>" & fLang(strLangMOD_Ls3kAU_04020) & "</option>" & VBNewLine & _
                   "                        <option value=""0"">" & fLang(strLangMOD_Ls3kAU_04030) & "</option>" & VBNewLine
  else
    response.write "                        <option value=""1"">" & fLang(strLangMOD_Ls3kAU_04020) & "</option>" & VBNewLine & _
                   "                        <option value=""0"" selected>" & fLang(strLangMOD_Ls3kAU_04030) & "</option>" & VBNewLine
  end if
  response.write "                        </select>" & VBNewLine & _
                 "                      </td>" & VBNewLine & _
                 "                    </tr>" & VBNewLine
end if


3. at line 507 insert the following code
'########################
'## Anti-Spam Code Start
'########################

'We check that the page calling the profile is the register.asp

If Right(Request.Servervariables("SCRIPT_NAME"),12) = "register.asp" then
		'Defining the randomized code
		'We define the number of images to show

		HowManyNbr = 6

		'We loop through the Number Generating to get all the HowManyNbr

		NumbersToShow = ""
		Randomize

		For I = 1 to HowManyNbr
			NumbersToShow = NumbersToShow & Fix(9*Rnd)
		Next

		'We will now decode the randomized numbers (Very Simple)
		RandomizedCode = NumbersToShow * 50000 - 17456

		'We genearte the table now

		Response.Write "                    <tr>" & vbNewLine & _
				"                      <td valign=""top"" align=""center"" colspan=""2"" bgcolor=""" & strCategoryCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Registration Anti SPAM Confirmation</font></b></td>" & vbNewLine & _
				"                    </tr>" & vbNewLine & _
				"                    <tr>" & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
				"Your unique registration code</b><br>If you do not see any numbers, or see broken "& vbNewLine & _
				"images, please contact a board administrator to rectify the problem.</td>"& vbNewLine
		Response.Write	"                      </font></td>" & vbNewLine & _
				"                    </tr>" & vbNewLine & _
				"                    <tr>" & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
		Response.Write "<input type='hidden' name='regid' value='"& RandomizedCode &"'>"& vbNewLine
		'We now define the images
		'Again we loop through to get the image number
		NullStop = False
		Response.Write "                    </tr>" & vbNewLine & _
				" <tr>"  & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap width=""10%""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """></font>&nbsp;</font></b></td>" & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
		For I = 1 to HowManyNbr
			Response.Write "<img src='register.asp?code=image&rc=" & RandomizedCode &"&p=" & I & "' border='0' alt='Code'>"& vbNewLine
		Next
		Response.Write "                    </tr>" & vbNewLine & _
				" <tr>"  & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
				"<b>Confirm registration code</b><br>To prevent mass registration programs from registering " &_
				"accounts, please enter the 6 digit code shown above in image format.<br>Note: Only numbers are " & _
				" allowed, a '0' is a numerical zero, not the alphabetical 'O'.</td>"& vbNewLine
		Response.Write	"                      </font></td>" & vbNewLine & _
				"                    </tr>" & vbNewLine & _
				" <tr>"  & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap width=""10%""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font>&nbsp;</font></b></td>" & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
				" <input type='text' size='7' maxlength='6' name='reg_code' class='forminput'>" & vbNewLine
		Response.Write	"                      </font></td>" & vbNewLine & _
				"                    </tr>" & vbNewLine
End If

'#######################
'## Anti-Spam Code - END
'#######################

4. Save the inc_profile.asp

5. open the register.asp

6. Goto line 39

above you should see the following line

'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################

7. insert the following code

'###################
'## Antispam Start
'####################
'We now set the code
strRCCode = Request.QueryString("rc")
strRC = Request.QueryString("code")
strRCP = Request.QueryString("p")

If strRC = "image" then
	NullStop = False
	RandCode = (strRCCode + 17456) / 50000
	lenCode = Len(RandCode)
	If LenCode < 6 and Nullstop = False then
	For J = 1 to (6 - LenCode)
		NullRC = NullRC & "0"
	Next
	NullStop = True
	End If
	RandCode = NullRC & RandCode
	ImageP = Mid(RandCode, strRCP,1)
	Response.Redirect "images/" & ImageP & ".gif"
Else
'#####################
'## Antspam End
'#####################

8. Goto line 275 (line 274 should end with End If)
9. Insert following code

		'###########################
		'#### Antispam Error Start
		RandCode = Request.Form("reg_code")
		strRCCode = Request.Form("regid")
		RandCode2 = (strRCCode + 17456) / 50000
		lenCode = Len(RandCode2)
		NullStop = False
		If LenCode < 6 and Nullstop = False then
			For J = 1 to (6 - LenCode)
				NullRC = NullRC & "0"
			Next
			NullStop = True
		End If
		RandCode2 = NullRC & RandCode2

		If RandCode <> RandCode2 then
			Err_Msg = Err_Msg & "<li>The registration code you have enterd is not correct!</li>"
		End If
		'#### Antispam Error End 
		'########################

10. Goto line 718. Line 717 should be 

	WriteFooter

11. Insert after the line entry "writefooter" the following code
'#### Antispam modification
end if
'#### Antispam End

12. Copy the images into the imgaes folder within the forum folder.

You are set and done!!!

