<% '################################################################################# '## Copyright (C) 2000-01 Michael Anderson and Pierre Gorissen '## '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '## of the License, or any later version. '## '## All copyright notices regarding Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## reinhold@bigfoot.com '## '## or '## '## Snitz Communications '## C/O: Michael Anderson '## PO Box 200 '## Harpswell, ME 04079 '################################################################################# 'Session.LCID = 1033 '## Do Not Edit Response.Buffer = true 'On Error Goto ErrHandler dim strDBType, strConnString, strTablePrefix, strMemberTablePrefix '## Do Not Edit '################################################################################# '## SELECT YOUR DATABASE TYPE AND CONNECTION TYPE (access, sqlserver or mysql) '################################################################################# 'strDBType = "sqlserver" strDBType = "access" 'strDBType = "mysql" '## Make sure to uncomment one of the strConnString lines! 'strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/fpdb/snitz_forums_2000.mdb") '## MS Access 97 using virtual path 'strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\inetpub\dbroot\snitz_forums_2000.mdb" '## MS Access 97 'strConnString = "driver={SQL Server};server=SERVER;uid=UID;pwd=PASSWORD;database=DATABASE_NAME" '## MS SQL Server 7 'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/tools/snitz2000.mdb") '## MS Access 2000 using virtual path 'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:/nthc-spc/dlamar/dwlamar/docwong.com/db/docwong2002.mdb;" 'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\WebSites\huw\databases\flyagaric.mdb;" '## MS Access 2000 'strConnString = "driver={SQL Server};server=SERVER;uid=UID;pwd=PWD;database=DB" '## MS SQL Server 7/2000 'strConnString = "driver=MySQL;server=SERVER_NAME;uid=MYSQL_USER;pwd=PASSWORD;database=DATABASE_NAME" '## MySQL strConnString = "DSN=docwong-portal" strTablePrefix = "FORUM_" strMemberTablePrefix = "FORUM_" '################################################################################# '## Do Not Edit Below This Line - It could destroy your forums and lose data '################################################################################# dim strVersion, strForumTitle, strCopyright, strTitleImage, strHomeURL, strForumURL, strCookieURL dim strAuthType, strSetCookieToForum dim strEmail, strUniqueEmail, strMailMode, strMailServer, strSender dim strDateType, strTimeAdjust, strTimeType, strForumTimeAdjust dim strMoveTopicMode, strMoveNotify, strIPLogging, strPrivateForums, strShowModerators, strShowRank, strAllowForumCode, strAllowHTML dim strNoCookies, strEditedByDate dim intHotTopicNum, strHotTopic dim strIMGInPosts dim strHomepage, strICQ, strAIM, strInForumAdmin, strSecureAdmin, strIcons, strGfxButtons dim strBadWordFilter, strBadWords dim strDefaultFontFace, strDefaultFontSize, strHeaderFontSize, strFooterFontSize dim strPageBGColor, strDefaultFontColor dim strLinkColor, strLinkTextDecoration, strVisitedLinkColor, strVisitedTextDecoration, strActiveLinkColor, strHoverFontColor, strHoverTextDecoration dim strHeadCellColor, strHeadFontColor, strCategoryCellColor, strCategoryFontColor dim strForumFirstCellColor, strForumCellColor, strAltForumCellColor, strForumFontColor, strForumLinkColor dim strTableBorderColor, strPopUpTableColor, strPopUpBorderColor, strNewFontColor, strTopicWidthLeft, strTopicNoWrapLeft, strTopicWidthRight, strTopicNoWrapRight dim strRankColor1, strRankColor2, strRankColor3 dim strRankLevel0, strRankLevel1, strRankLevel2, strRankLevel3, strRankLevel4, strRankLevel5 dim intRankLevel0, intRankLevel1, intRankLevel2, intRankLevel3, intRankLevel4, intRankLevel5 dim strShowStatistics, strShowImagePoweredBy, strLogonForMail, strShowPaging, strShowTopicNav, strPageSize, strPageNumberSize dim strNTGroupsSTR,strDBNTSQLName dim strModeration, strSubscription '## Local Time Display dim intLocalBias dim intServerBias dim intForumBias '## Local Time Display dim strPortalBGColor, strCurrentTemplate strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/")) strUniqueID = "Snitz00" if Application(strCookieURL & "ConfigLoaded")= "" or IsNull(Application(strCookieURL & "ConfigLoaded")) or blnSetup="Y" then '## if the configvariables aren't loaded into the Application object '## or after the admin has changed the configuration '## the variables get (re)loaded set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Errors.Clear my_Conn.Open strConnString if blnSetup <> "Y" then for counter = 0 to my_conn.Errors.Count -1 ConnErrorNumber = my_conn.Errors(counter).Number if my_conn.Errors(counter).Number <> 0 then my_conn.Errors.Clear Response.Redirect "setup.asp?RC=1&CC=1&strDBType=" & strDBType & "&EC=" & ConnErrorNumber end if next end if my_conn.Errors.Clear '## if the configvariables aren't loaded into the Application object '## or after the admin has changed the configuration '## the variables get (re)loaded '## Forum_SQL strSql = "SELECT * FROM " & strTablePrefix & "CONFIG_NEW " set rsConfig = my_Conn.Execute (strSql) blnLoadConfig = TRUE for counter = 0 to my_conn.Errors.Count -1 ConnErrorNumber = my_conn.Errors(counter).Number if my_conn.Errors(counter).Number <> 0 then if blnSetup <> "Y" then my_conn.Errors.Clear myConnError = my_Conn.Errors(counter).Number my_Conn.Errors.Clear Err.Clear strSql = "SELECT " & strTablePrefix & "CONFIG.C_STRVERSION, " strSql = strSql & strTablePrefix & "CONFIG.C_STRSENDER " strSql = strSql & " FROM " & strTablePrefix & "CONFIG " set rsInfo = my_Conn.Execute (StrSql) strVersion = rsInfo("C_STRVERSION") strSender = rsInfo("C_STRSENDER") rsInfo.Close set rsInfo = nothing my_Conn.Close set my_Conn = nothing Response.Redirect "setup.asp?RC=3&MAIL=" & Server.UrlEncode(strSender) & "&VER=" & Server.URLEncode(strVersion) & "&strDBType="& strDBType & "&EC=" & myConnError else my_conn.Errors.Clear blnLoadConfig = FALSE end if end if next my_conn.Errors.Clear on error goto 0 if blnLoadConfig then Application.Lock do while not rsConfig.EOF Application(strCookieURL & rsConfig("C_VARIABLE")) = rsConfig("C_VALUE") rsConfig.MoveNext loop Application.UnLock rsConfig.close end if Application.Lock Application(strCookieURL & "ConfigLoaded")= "YES" Application.UnLock LoadModConfig() my_Conn.Close set my_Conn = nothing end if ' ## Read the config-info from the application variables... strCurrentTemplate = Application(strCookieURL & "strCurrentTemplate") strPortalBGColor = Application(strCookieURL & "strPortalBGColor") strVersion = Application(strCookieURL & "strVersion") strForumTitle = Application(strCookieURL & "strForumTitle") strCopyright = Application(strCookieURL & "strCopyright") strTitleImage = Application(strCookieURL & "strTitleImage") strHomeURL = Application(strCookieURL & "strHomeURL") strForumURL = Application(strCookieURL & "strForumURL") strAuthType = Application(strCookieURL & "strAuthType") strSetCookieToForum = Application(strCookieURL & "strSetCookieToForum") strEmail = Application(strCookieURL & "strEmail") strUniqueEmail = Application(strCookieURL & "strUniqueEmail") strMailMode = Application(strCookieURL & "strMailMode") strMailServer = Application(strCookieURL & "strMailServer") strSender = Application(strCookieURL & "strSender") strDateType = Application(strCookieURL & "strDateType") strTimeAdjust = Application(strCookieURL & "strTimeAdjust") strTimeType = Application(strCookieURL & "strTimeType") strMoveTopicMode = Application(strCookieURL & "strMoveTopicMode") strMoveNotify = Application(strCookieURL & "strMoveNotify") strIPLogging = Application(strCookieURL & "strIPLogging") strPrivateForums = Application(strCookieURL & "strPrivateForums") strShowModerators = Application(strCookieURL & "strShowModerators") strAllowForumCode = Application(strCookieURL & "strAllowForumCode") strIMGInPosts = Application(strCookieURL & "strIMGInPosts") strAllowHTML = Application(strCookieURL & "strAllowHTML") strNoCookies = Application(strCookieURL & "strNoCookies") strSecureAdmin = Application(strCookieURL & "strSecureAdmin") strHotTopic = Application(strCookieURL & "strHotTopic") intHotTopicNum = cint(Application(strCookieURL & "intHotTopicNum")) strICQ = Application(strCookieURL & "strICQ") strYAHOO = Application(strCookieURL & "strYAHOO") strAIM = Application(strCookieURL & "strAIM") strFullName = Application(strCookieURL & "strFullName") strPicture = Application(strCookieURL & "strPicture") strSex = Application(strCookieURL & "strSex") strCity= Application(strCookieURL & "strCity") strState = Application(strCookieURL & "strState") strAge = Application(strCookieURL & "strAge") strCountry = Application(strCookieURL & "strCountry") strOccupation = Application(strCookieURL & "strOccupation") strBio = Application(strCookieURL & "strBio") strHobbies = Application(strCookieURL & "strHobbies") strLNews = Application(strCookieURL & "strLNews") strQuote = Application(strCookieURL & "strQuote") strMarStatus = Application(strCookieURL & "strMarStatus") strFavLinks = Application(strCookieURL & "strFavLinks") strRecentTopics = Application(strCookieURL & "strRecentTopics") strAllowHideEmail = "1" '##not yet used ! strHomepage = Application(strCookieURL & "strHomepage") strUseExtendedProfile = (strBio + strHobbies + strLNews + strRecentTopics + strPicture + strQuote) > 0 strUseExtendedProfile = strUseExtendedProfile or ((strICQ + strYAHOO + strAIM + strFullName*2 + strSex + strCity + strState + strAge + strCountry + strOccupation + strFavLinks*2) > 5) strIcons = Application(strCookieURL & "strIcons") strGfxButtons = Application(strCookieURL & "strGfxButtons") strEditedByDate = Application(strCookieURL & "strEditedByDate") strBadWordFilter = Application(strCookieURL & "strBadWordFilter") strBadWords = Application(strCookieURL & "strBadWords") strDefaultFontFace = Application(strCookieURL & "strDefaultFontFace") strDefaultFontSize = Application(strCookieURL & "strDefaultFontSize") strHeaderFontSize = Application(strCookieURL & "strHeaderFontSize") strFooterFontSize = Application(strCookieURL & "strFooterFontSize") strPageBGColor = Application(strCookieURL & "strPageBGColor") strDefaultFontColor = Application(strCookieURL & "strDefaultFontColor") strLinkColor = Application(strCookieURL & "strLinkColor") strLinkTextDecoration = Application(strCookieURL & "strLinkTextDecoration") strVisitedLinkColor = Application(strCookieURL & "strVisitedLinkColor") strVisitedTextDecoration = Application(strCookieURL & "strVisitedTextDecoration") strActiveLinkColor = Application(strCookieURL & "strActiveLinkColor") strHoverFontColor = Application(strCookieURL & "strHoverFontColor") strHoverTextDecoration = Application(strCookieURL & "strHoverTextDecoration") strHeadCellColor = Application(strCookieURL & "strHeadCellColor") strHeadFontColor = Application(strCookieURL & "strHeadFontColor") strCategoryCellColor = Application(strCookieURL & "strCategoryCellColor") strCategoryFontColor = Application(strCookieURL & "strCategoryFontColor") strForumFirstCellColor = Application(strCookieURL & "strForumFirstCellColor") strForumCellColor = Application(strCookieURL & "strForumCellColor") strAltForumCellColor = Application(strCookieURL & "strAltForumCellColor") strForumFontColor = Application(strCookieURL & "strForumFontColor") strForumLinkColor = Application(strCookieURL & "strForumLinkColor") strTableBorderColor = Application(strCookieURL & "strTableBorderColor") strPopUpTableColor = Application(strCookieURL & "strPopUpTableColor") strPopUpBorderColor = Application(strCookieURL & "strPopUpBorderColor") strNewFontColor = Application(strCookieURL & "strNewFontColor") strTopicWidthLeft = Application(strCookieURL & "strTopicWidthLeft") strTopicNoWrapLeft = Application(strCookieURL & "strTopicNoWrapLeft") strTopicWidthRight = Application(strCookieURL & "strTopicWidthRight") strTopicNoWrapRight = Application(strCookieURL & "strTopicNoWrapRight") strShowRank = Application(strCookieURL & "strShowRank") strRankAdmin = Application(strCookieURL & "strRankAdmin") strRankMod = Application(strCookieURL & "strRankMod") strRankLevel0 = Application(strCookieURL & "strRankLevel0") strRankLevel1 = Application(strCookieURL & "strRankLevel1") strRankLevel2 = Application(strCookieURL & "strRankLevel2") strRankLevel3 = Application(strCookieURL & "strRankLevel3") strRankLevel4 = Application(strCookieURL & "strRankLevel4") strRankLevel5 = Application(strCookieURL & "strRankLevel5") strRankColorAdmin = Application(strCookieURL & "strRankColorAdmin") strRankColorMod = Application(strCookieURL & "strRankColorMod") strRankColor0 = Application(strCookieURL & "strRankColor0") strRankColor1 = Application(strCookieURL & "strRankColor1") strRankColor2 = Application(strCookieURL & "strRankColor2") strRankColor3 = Application(strCookieURL & "strRankColor3") strRankColor4 = Application(strCookieURL & "strRankColor4") strRankColor5 = Application(strCookieURL & "strRankColor5") intRankLevel0 = Cint(Application(strCookieURL & "intRankLevel0")) intRankLevel1 = Cint(Application(strCookieURL & "intRankLevel1")) intRankLevel2 = Cint(Application(strCookieURL & "intRankLevel2")) intRankLevel3 = Cint(Application(strCookieURL & "intRankLevel3")) intRankLevel4 = Cint(Application(strCookieURL & "intRankLevel4")) intRankLevel5 = Cint(Application(strCookieURL & "intRankLevel5")) strShowStatistics = Application(strCookieURL & "strShowStatistics") strShowImagePoweredBy = Application(strCookieURL & "strShowImagePoweredBy") strLogonForMail = Application(strCookieURL & "strLogonForMail") strShowPaging = Application(strCookieURL & "strShowPaging") strShowTopicNav = Application(strCookieURL & "strShowTopicNav") strPageSize = Application(strCookieURL & "strPageSize") strPageNumberSize = Application(strCookieURL & "strPageNumberSize") strForumTimeAdjust = DateAdd("h", strTimeAdjust , Now()) strNTGroups = Application(strCookieURL & "STRNTGROUPS") strAutoLogon = Application(strCookieURL & "STRAUTOLOGON") ' DEM --> Added line for moderation strModeration = Application(strCookieURL & "STRMODERATION") ' DEM --> Added line for subscription services strSubscription = Application(strCookieURL & "STRSUBSCRIPTION") '## Local Time Display Dim dtmDate Set dtmDate = GetObject("java:java.util.Date") intServerBias = dtmDate.getTimezoneOffset() intForumBias = Application(strCookieURL & "STRFORUMBIAS") strForumTimeZAdjust = DateAdd("n", + intServerBias , Now()) intForumDaylAdjust = intForumDaylightBias() strForumTimeAdjust = DateAdd("n", - intForumBias - intForumDaylAdjust, strForumTimeZAdjust) '## Local Time Display strNTGroups = Application(strCookieURL & "STRNTGROUPS") strAutoLogon = Application(strCookieURL & "STRAUTOLOGON") 'Huw's mod changes ReadModConfig() '------------------ if strSecureAdmin = "0" then Session(strCookieURL & "Approval") = "15916941253" end if on error goto 0 if strAuthType = "db" then strDBNTSQLName = "M_NAME" strAutoLogon ="0" strNTGroups ="0" else strDBNTSQLName = "M_USERNAME" end if function intForumDaylightBias() set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Errors.Clear my_Conn.Open strConnString intForumDaylightBias = 0 '## Forum_SQL - Get User's Local Time Adjustment strSql = "SELECT " & strTablePrefix & "TIMEZONE.Z_BIAS" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_DAYLBIAS" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_DAYLDAYNUM" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_DAYLWEEKDAY" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_DAYLMONTH" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_STDDAYNUM" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_STDWEEKDAY" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_STDMONTH" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_DAYLHOUR" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_DAYLMIN" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_STDHOUR" strSql = strSql & ", " & strTablePrefix & "TIMEZONE.Z_STDMIN" strSql = strSql & " FROM " & strTablePrefix & "TIMEZONE " strSql = strSql & " WHERE Z_ID = " & strTimeAdjust set rsMemTime = my_Conn.Execute(strSql) if not rsMemTime.eof then if rsMemTime("Z_STDMONTH") <> 0 and rsMemTime("Z_DAYLMONTH") <> 0 then 'daylight saving zone if month(now) < rsMemTime("Z_DAYLMONTH") then intForumDaylightBias = 0 if mode = "1" then exit function end if if month(now) > rsMemTime("Z_STDMONTH") then intForumDaylightBias = 0 if mode = "1" then exit function end if else intForumDaylightBias = 0 exit function end if dsStartDate = DayLightTimeStart(rsMemTime) dsEndDate = StandardTimeStart(rsMemTime) if Now > dsStartDate and Now < dsEndDAte then intForumDaylightBias = rsMemTime("Z_DAYLBIAS") else intForumDaylightBias = 0 end if end if '## Local Time Display rsMemTime.close my_conn.close end function function DaylightTimeStart(rsMemTime) dsDayNum = rsMemTime("Z_DAYLDAYNUM") dsWeekDay = rsMemTime("Z_DAYLWEEKDAY") dsMonth = rsMemTime("Z_DAYLMONTH") dsStartTime = rsMemTime("Z_DAYLHOUR") & ":" & rsMemTime("Z_DAYLMIN") & ":00" 'get the date of the first weekday in the month for daylight saving dsStartDay = weekday(cdate(rsMemTime("Z_DAYLMONTH") & "/1/" & year(now))) - 1 if dsStartDay <> dsWeekDay then counter = 1 do until dsStartDay = dsWeekDay counter = counter + 1 dsStartDay = weekday(cdate(rsMemTime("Z_DAYLMONTH") & "/" & counter &"/" & year(now))) - 1 loop dsStartDay = counter ' Now find the actual date for the day we want for x = 0 to dsDayNum - 1 if IsDate(rsMemTime("Z_DAYLMONTH") & "/" & dsStartDay + (7 * x) &"/" & year(now)) then if rsMemTime("Z_DAYLMONTH") < 10 then DaylightTimeStart = cDate("0" & rsMemTime("Z_DAYLMONTH") & "/" & dsStartDay + (7 * x) &"/" & year(now) & " " & dsStartTime ) else DaylightTimeStart = cDate(rsMemTime("Z_DAYLMONTH") & "/" & dsStartDay + (7 * x) &"/" & year(now) & " " & dsStartTime ) end if else 'do nothing gone past the end end if next else DaylightTimeStart = cdate(rsMemTime("Z_DAYLMONTH") & "/1/" & year(now) & " " & dsStartTime) end if end function function StandardTimeStart(rsMemTime) stdDayNum = rsMemTime("Z_STDDAYNUM") stdWeekDay = rsMemTime("Z_DAYLWEEKDAY") stdMonth = rsMemTime("Z_STDMONTH") stdEndTime = rsMemTime("Z_STDHOUR") & ":" & rsMemTime("Z_STDMIN") & ":00" 'get first day of month it changes back stdStartDay = weekday(cdate(rsMemTime("Z_STDMONTH") & "/1/" & year(now))) - 1 if stdStartDay <> stdWeekDay then counter = 1 do until stdStartDay = stdWeekDay counter = counter + 1 stdStartDay = weekday(cdate(rsMemTime("Z_STDMONTH") & "/" & counter &"/" & year(now))) - 1 loop stdStartDay = counter ' Now find the actual date for the day we want for x = 0 to stdDayNum - 1 if IsDate(rsMemTime("Z_STDMONTH") & "/" & stdStartDay + (7 * x) &"/" & year(now)) then if rsMemTime("Z_STDMONTH") < 10 then StandardTimeStart = cDate("0" & rsMemTime("Z_STDMONTH") & "/" & stdStartDay + (7 * x) &"/" & year(now) & " " & stdEndTime ) else StandardTimeStart = cDate(rsMemTime("Z_STDMONTH") & "/" & stdStartDay + (7 * x) &"/" & year(now) & " " & stdEndTime ) end if else 'do nothing gone past the end of the month end if next else StandardTimeStart = cdate(rsMemTime("Z_STDMONTH") & "/1/" & year(now) & " " & stdEndTime) end if end function %>