----- 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 must be a numerical value.
  • " end if » Find the following on line 135: " " & vbNewLine & _ " Birth Date: " & vbNewLine & _ " " & vbNewLine & _ " On:  " & vbNewLine & _ " Off: " & vbNewLine & _ " " & getCurrentIcon(strIconSmileQuestion,"","") & "" & vbNewLine & _ " " & vbNewLine & _ » And replace it with the following: " " & vbNewLine & _ " Birth Date: " & vbNewLine & _ " " & vbNewLine & _ " On:  " & vbNewLine & _ " Off: " & vbNewLine & _ " " & getCurrentIcon(strIconSmileQuestion,"","") & "" & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " 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 & _ " " & vbNewLine & _ " " & getCurrentIcon(strIconSmileQuestion,"","") & "" & vbNewLine & _ " " & vbNewLine & _ ---------- config.asp ---------- » Find the following on line 100: Dim strAge, strAgeDOB, strCountry, strOccupation, strBio » And replace it with the following: Dim strAge, strAgeDOB, strMinAge, strCountry, strOccupation, strBio » Find the following on line 272: strAge = Application(strCookieURL & "STRAGE") strAgeDOB = Application(strCookieURL & "STRAGEDOB") » And replace it with the following: strAge = Application(strCookieURL & "STRAGE") strAgeDOB = Application(strCookieURL & "STRAGEDOB") strMinAge = cInt(Application(strCookieURL & "STRMINAGE")) ----------------- inc_datepicker.js ----------------- Replace the entire contents of the file with the following: var strUrl,dtNow,objYear,objMonth,objDay,arrMonths,arrDays,intYear,intOldYear,intMonth,intDay,intLen,intOldLen,intIndex,intValue; strUrl=window.location.href.toLowerCase(); dtNow=new Date(); objYear=document.getElementById("year"); objMonth=document.getElementById("month"); objDay=document.getElementById("day"); arrMonths=["January","February","March","April","May","June","July","August","September","October","November","December"]; arrDays=[31,28,31,30,31,30,31,31,30,31,30,31]; function DateSelector(w){ intYear=objYear.options[objYear.selectedIndex].value; if(!objMonth.disabled)intMonth=objMonth.options[objMonth.selectedIndex].value; else intMonth=0; if(!objDay.disabled)intDay=objDay.options[objDay.selectedIndex].value; else intDay=0; if(!w){ if(intYear!=""){ if(CheckYear(intYear)||CheckYear(intOldYear)){ if(CheckYear(intYear))intLen=dtNow.getMonth()+1; else intLen=12; Populate(objMonth,"Month",1,intMonth) } Show(objMonth); intOldYear=intYear; if(!objDay.disabled)DateSelector(1); }else{ Hide(objDay); Hide(objMonth); } }else{ if(intYear!=""&&intMonth!=""){ intLen=arrDays[intMonth-1]; if(intMonth-1==dtNow.getMonth()&&CheckYear(intYear))intLen=dtNow.getDate(); if(intMonth==2&&intLen==28&&intYear%4==0&&!(intYear%100==0&&intYear%400!=0))intLen++; if(intLen!=intOldLen)Populate(objDay,"Day",0,intDay) Show(objDay); intOldLen=intLen; }else Hide(objDay); } } function CheckYear(y){ if(y!=objYear[1].value)return false; return true; } function Hide(o){ if(!o.disabled){ o.disabled=true; o.selectedIndex=0; o.style.visibility="hidden"; } } function Populate(o,d,a,v){ o.options.length=0; o[0]=new Option(d,""); o.selectedIndex=0; for(var x=1;x<=intLen;x++){ intIndex=x; if(intIndex<=9)intValue="0"+intIndex; else intValue=intIndex; if(a)intIndex-- o[x]=new Option(a?arrMonths[intIndex]:intIndex,intValue); if(v==intValue)o.selectedIndex=x; } } function Show(o){ if(o.disabled){ o.style.visibility="visible"; o.disabled=false; o.focus(); } } if(strUrl.indexOf("register")!=-1||objYear.selectedIndex==0){ Hide(objDay); Hide(objMonth); }else{ intOldYear=objYear.options[objYear.selectedIndex].value; intOldLen=parseInt(objDay.options[objDay.length-1].value); } ----------------- inc_iconfiles.asp ----------------- » Find the following on line 41: Const strIconCalendar = "icon_calendar.gif|34|21" » And delete it. --------------- inc_profile.asp --------------- » Find the following on line 352: if strAgeDOB = "1" then Response.Write " " & vbNewLine Response.Write " " & vbNewLine & _ " Birth Date: " & vbNewLine & _ " "Register" then Response.Write(trim(ChkString(rs("M_DOB"), "display"))) Response.Write """>" & getCurrentIcon(strIconCalendar,"Choose Date","align=""absmiddle""") & "" & vbNewLine & _ " " & 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 & _ " Birth Date: " & vbNewLine & _ " " & vbNewLine & _ " "& vbNewLine & _ " "& vbNewLine & _ " "& vbNewLine & _ " "& vbNewLine & _ " " & 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