-----
Notes
-----
» Line references are for an unmodified, out of the zip v3.4.05 with no security fixes, etc.
» This mod has already been added to v3.4.06 of the base Snitz code.
» All changes below have a "knock-on" effect meaning that, after making a change, the line references for any further changes to the same file will be adjusted accordingly.
» Always back up your files (including your database) before starting work on any mod.
» Support for this mod is availble at http://forum.snitz.com/forum/forum.asp?FORUM_ID=94
------
Thanks
------
... to OneWayMule, for the original code snippet upon which this mod was based
... to Davio and Ruirib, for their help testing this
--------
Database
--------
» Run the following in your alternative mod setup before applying the changes below.
[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('STRMINAGE','13')
[END]
-------------
Files to edit
-------------
» The following files need to be edited:
admin_config_members.asp
config.asp
inc_datepicker.js
inc_iconfile.asp
inc_profile.asp
policy.asp
pop_config_help.asp
pop_profile.asp
register.asp
------------------------
admin_config_members.asp
------------------------
» Find the following on line 36:
» And replace it with the following:
» Find the following on line 57:
if Request.Form("strAge") = "1" and Request.Form("strAgeDOB") = "1" then
Err_Msg = Err_Msg & "
Age and Birth Date cannot both be On at the same time
"
end if
» And replace it with the following:
if Request.Form("strAge") = "1" and Request.Form("strAgeDOB") = "1" then
Err_Msg = Err_Msg & "
Age and Birth Date cannot both be On at the same time
"
end if
intAge = ChkString(trim(Request.Form("strMinAge")), "SQLString")
if len(intAge) = 0 then
intAge = 0
end if
if not isNumeric(intAge) then
Err_Msg = Err_Msg & "
Minimum Age: " & vbNewLine
intYoungest = 0
if strAge = "1" then
set rs = my_Conn.execute(TopSQL("SELECT M_AGE FROM " & strMemberTablePrefix & "MEMBERS WHERE M_AGE <> '' AND M_STATUS <> 0 ORDER BY M_AGE ASC", 1))
if not rs.eof then
intYoungest = cInt(rs("M_AGE"))
end if
rs.close
set rs = nothing
elseif strAgeDOB="1" then
set rs = my_Conn.execute(TopSQL("SELECT M_DOB FROM " & strMemberTablePrefix & "MEMBERS WHERE M_DOB <> '' AND M_STATUS <> 0 ORDER BY M_DOB DESC", 1))
if not rs.eof then
intYoungest = cInt(DisplayUsersAge(DOBToDate(rs("M_DOB"))))
end if
rs.close
set rs = nothing
end if
if intYoungest>0 then
Response.Write " Youngest member is " & intYoungest & " " & vbNewLine
end if
Response.Write "
" & vbNewLine
end if
» And replace it with the following:
if strAgeDOB = "1" then
strDOByear = ""
strDOBmonth = ""
strDOBday = ""
if strMode <> "Register" then
strMDOB = trim(ChkString(rs("M_DOB"), "display"))
if len(strMDOB) > 0 then
strDOByear = cInt(left(strMDOB, 4))
strDOBmonth = cInt(mid(strMDOB, 5, 2))
strDOBday = cInt(right(strMDOB, 2))
end if
end if
Response.Write "
" & vbNewLine
end if
----------
policy.asp
----------
» Find the following on line 76:
"
By pressing the "Agree" button, you agree that you, the " & _
"user, are 13 years of age or over. You are fully responsible for any information " & _
» And replace it with the following:
"
By pressing the "Agree" button, you agree that you, the user, are "
if strMinAge > 0 then
Response.Write strMinAge & " years of age or over. You are "
end if
Response.Write "fully responsible for any information " & _
-------------------
pop_config_help.asp
-------------------
» Find the following on line 516:
"
" & vbNewLine & _
"
What is City For?
" & vbNewLine & _
"
" & vbNewLine & _
» And replace it with the following:
"
" & vbNewLine & _
"
What is Minimum Age for?
" & vbNewLine & _
"
" & vbNewLine & _
"
" & vbNewLine & _
"
" & vbNewLine & _
" Prevent users under the age you specify here from registering. The default is 13 for COPPA compliancy but you can change it to anything you want. To turn this feature off completely, set the minimum age to 0." & vbNewLine & _
" " & getCurrentIcon(strIconGoUp,"Go To Top Of Page","align=""right""") & "
" & vbNewLine & _
"
" & vbNewLine & _
"
" & vbNewLine & _
"
What is City For?
" & vbNewLine & _
"
" & vbNewLine & _
---------------
pop_profile.asp
---------------
» Find the following on line 1131:
if not IsValidURL(trim(Request.Form("Photo_URL"))) then
Err_Msg = Err_Msg & "
Photo URL: Invalid URL" & strURLError & "
"
end if
» And replace it with the following:
if not IsValidURL(trim(Request.Form("Photo_URL"))) then
Err_Msg = Err_Msg & "
Photo URL: Invalid URL" & strURLError & "
"
end if
strMAge = ""
if strAge = "1" then
strMAge = ChkString(trim(Request.Form("Age")), "SQLString")
end if
if strAgeDOB = "1" then
strMDOB = ChkString(Request.Form("year"), "SQLString") & ChkString(Request.Form("month"), "SQLString") & ChkString(Request.Form("day"), "SQLString")
if len(strMDOB) <> 8 then
strMDOB = ""
else
if not IsValidBirthDate() then
Err_Msg = Err_Msg & "
Date of Birth: Invalid Date
"
else
strMAge = DisplayUsersAge(DOBToDate(strMDOB))
end if
end if
end if
if len(strMAge) > 0 then
if not isNumeric(strMAge) then
Err_Msg = Err_Msg & "
You must enter a numerical value for your age.
"
elseif strMinAge > 0 and strMAge < strMinAge then
Err_Msg = Err_Msg & "
You must be at least " & strMinAge & " years old.
"
end if
end if
» Find the following on line 1237:
if strAge = "1" then
strSql = strsql & ", M_AGE = '" & ChkString(Request.Form("Age"),"SQLString") & "'"
end if
if strAgeDOB = "1" then
strSql = strsql & ", M_DOB = '" & ChkString(Request.Form("AgeDOB"),"SQLString") & "'"
end if
» And replace it with the following:
if strAge = "1" then
strSql = strsql & ", M_AGE = '" & strMAge & "'"
end if
if strAgeDOB= "1" then
strSql = strsql & ", M_DOB = '" & strMDOB & "'"
end if
» Find the following on line 1452:
if not IsValidURL(trim(Request.Form("Photo_URL"))) then
Err_Msg = Err_Msg & "
Photo URL: Invalid URL" & strURLError & "
"
end if
» And replace it with the following:
if not IsValidURL(trim(Request.Form("Photo_URL"))) then
Err_Msg = Err_Msg & "
Photo URL: Invalid URL" & strURLError & "
"
end if
strMAge = ""
if strAge = "1" then
strMAge = ChkString(trim(Request.Form("Age")), "SQLString")
end if
if strAgeDOB = "1" then
strMDOB = ChkString(Request.Form("year"), "SQLString") & ChkString(Request.Form("month"), "SQLString") & ChkString(Request.Form("day"), "SQLString")
if len(strMDOB) <> 8 then
strMDOB = ""
else
if not IsValidBirthDate() then
Err_Msg = Err_Msg & "
Date of Birth: Invalid Date
"
else
strMAge = DisplayUsersAge(DOBToDate(strMDOB))
end if
end if
end if
if len(strMAge) > 0 then
if not isNumeric(strMAge) then
Err_Msg = Err_Msg & "
You must enter a numerical value for your age.
"
elseif strMinAge > 0 and strMAge < strMinAge then
Err_Msg = Err_Msg & "
You must be at least " & strMinAge & " years old.
"
end if
end if
» Find the following on line 1560:
if strAge = "1" then
strSql = strsql & ", M_AGE = '" & chkString(Request.Form("Age"),"SQLString") & "'"
end if
if strAgeDOB = "1" then
strSql = strsql & ", M_DOB = '" & ChkString(Request.Form("AgeDOB"),"SQLString") & "'"
end if
» And replace it with the following:
if strAge = "1" then
strSql = strsql & ", M_AGE = '" & strMAge & "'"
end if
if strAgeDOB= "1" then
strSql = strsql & ", M_DOB = '" & strMDOB & "'"
end if
» Find the following on line 1654:
Function IsValidURL(sValidate)
Dim sInvalidChars
Dim bTemp
Dim i
» And replace if with the following:
function IsValidBirthDate()
IsValidBirthDate = true
strMDOByear = cInt(left(strMDOB, 4))
strMDOBmonth = cInt(mid(strMDOB, 5, 2))
strMDOBday = cInt(right(strMDOB, 2))
arrDays = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
intDays = arrDays(strMDOBMonth - 1)
if strMDOBmonth = 2 and strMDOByear mod 4 = 0 and not (strMDOByear mod 100 = 0 and not strMDOBYear mod 400 = 0) then
intDays = intDays + 1
end if
if strMDOBday > intDays or strMDOB > left(DateToStr(strForumTimeAdjust), 8) then
IsValidBirthDate = false
end if
end function
Function IsValidURL(sValidate)
Dim sInvalidChars
Dim bTemp
Dim i
------------
register.asp
------------
» Find the following on line 351:
if not IsValidURL(trim(Request.Form("Photo_URL"))) then
Err_Msg = Err_Msg & "
Photo URL: Invalid URL" & strURLError & "
"
end if
» And replace it with the following:
if not IsValidURL(trim(Request.Form("Photo_URL"))) then
Err_Msg = Err_Msg & "
Photo URL: Invalid URL" & strURLError & "
"
end if
strMAge = ""
if strAge = "1" then
strMAge = ChkString(trim(Request.Form("Age")), "SQLString")
end if
if strAgeDOB = "1" then
strMDOB = ChkString(Request.Form("year"), "SQLString") & ChkString(Request.Form("month"), "SQLString") & ChkString(Request.Form("day"), "SQLString")
if len(strMDOB) <> 8 then
strMDOB = ""
else
strMDOByear = cInt(left(strMDOB, 4))
strMDOBmonth = cInt(mid(strMDOB, 5, 2))
strMDOBday = cInt(right(strMDOB, 2))
arrDays = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
intDays = arrDays(strMDOBMonth - 1)
if strMDOBmonth = 2 and strMDOByear mod 4 = 0 and not (strMDOByear mod 100 = 0 and not strMDOBYear mod 400 = 0) then
intDays = intDays + 1
end if
if strMDOBday > intDays or strMDOB > left(DateToStr(strForumTimeAdjust), 8) then
Err_Msg = Err_Msg & "
Date of Birth: Invalid Date
"
else
strMAge = DisplayUsersAge(DOBToDate(strMDOB))
end if
end if
end if
if len(strMAge) > 0 then
if not isNumeric(strMAge) then
Err_Msg = Err_Msg & "
You must enter a numerical value for your age.
"
elseif strMinAge > 0 and strMAge < strMinAge then
Err_Msg = Err_Msg & "
You must be at least " & strMinAge & " years old to join this forum.
"
end if
end if
» Find the following on line 551:
if strAge = "1" then
strSql = strsql & ", '" & ChkString(Request.Form("Age"),"SQLString") & "'"
else
strSql = strsql & ", ''"
end if
if strAgeDOB = "1" then
strSql = strsql & ", '" & ChkString(Request.Form("AgeDOB"),"SQLString") & "'"
else
strSql = strsql & ", ''"
end if
» And replace it with the following:
if strAge = "1" then
strSql = strsql & ", '" & strMAge & "'"
else
strSql = strsql & ", ''"
end if
if strAgeDOB = "1" then
strSql = strsql & ", '" & strMDOB & "'"
else
strSql = strsql & ", ''"
end if
---------------
Files to delete
---------------
» Finally, you can delete these files completely, if you wish:
icon_calendar.gif
pop_datepicker.asp