<% @ Language=VBScript %> <% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2010 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** 'Set the timeout of the forum Server.ScriptTimeout = 90 Session.Timeout = 20 'Set the date time format to your own locale if you are getting a CDATE error '(this shouldn't ever be required in version 8 or above, but left in for backward compatibility) 'Session.LCID = 1033 'If there is no database set then need to run the installation setup If strDatabaseType = "" Then Response.Redirect("setup.asp") '****************************************** '*** Database connection **** '****************************************** Call openDatabase(strCon) '****************************************** '*** Read in Configuration Data **** '****************************************** Call getForumConfigurationData() '****************************************** '*** Get Session ID **** '****************************************** 'Call sub to get session data if not a search engine spider (also imporves serach engine indexing) If NOT strOSType = "Search Robot" Then Call getSessionData() '****************************************** '*** Read in session Last Visit **** '****************************************** 'Read in the last visit date dtmLastVisitDate = getSessionItem("LV") '****************************************** '*** Read in Logged-in User Data **** '****************************************** 'Call the sub procedure to read in the details for this user Call getUserData("UID") '****************************************** '*** Setup Last Visit Data **** '****************************************** 'Make sure the variable is of a date datatype If isDate(dtmLastVisitDate) Then dtmLastVisitDate = CDate(dtmLastVisitDate) 'Set a cookie with the last date/time the user used the forum to calculate if there any new posts 'If the date/time the user was last here is 20 minutes since the last visit then set the session variable to the users last date they were here If dtmLastVisitDate = "" AND isDate(getCookie("lVisit", "LV")) Then 'Read from cookie Call saveSessionItem("LV", internationalDateTime(getCookie("lVisit", "LV"))) 'Intilise the last date variable dtmLastVisitDate = CDate(getCookie("lVisit", "LV")) 'Save new cookie Call setCookie("lVisit", "LV", internationalDateTime(Now()), True) 'If the last entry date is not alreay set set it to now ElseIf dtmLastVisitDate = "" Then Call saveSessionItem("LV", internationalDateTime(Now())) dtmLastVisitDate = Now() End If 'If the cookie is older than 1 minute set a new one If IsDate(getCookie("lVisit", "LV")) Then If CDate(getCookie("lVisit", "LV")) < DateAdd("n", -1, Now()) Then Call setCookie("lVisit", "LV", internationalDateTime(Now()), True) End If 'If there is no date in the cookie or it is empty then set the date to now() Else Call setCookie("lVisit", "LV", internationalDateTime(Now()), True) End If '****************************************** '*** Set some user defaults **** '****************************************** 'Make sure the main admin account remains active and full access rights and in the admin group If lngLoggedInUserID = 1 Then intGroupID = 1 blnActiveMember = True blnBanned = False End If 'If in the admin group set the admin boolean to true If intGroupID = 1 Then blnAdmin = True 'If Session-less Guest browsing is allowed then remove session ID's from strings If blnGuest AND blnGuestSessions = false Then strQsSID = "" strQsSID1 = "" strQsSID2 = "" End If 'Debugging info If Request.QueryString("about") Then Call about() '****************************************** '*** Redirect if forum is closed **** '****************************************** 'If the forums are closed redirect to the forums closed page If blnForumClosed AND blnDisplayForumClosed = False AND blnAdmin = False Then 'Reset server objects Call closeDatabase() 'Redirect to the forum closed page Response.Redirect("forum_closed.asp" & strQsSID1) End If '****************************************** '*** Initialise certain variables **** '****************************************** 'Intilise bread crumb trail with the forum home strBreadCrumbTrail = " " & strTxtForumHome & "" '****************************************** '*** Initialise Upload Path Settings **** '****************************************** 'Intilise the file upload path for this user 'For security the upload path is set below at global scale so users NEVER seee other users upload directory 'However we may need the parent upload directory for admin/moderator purposes strUploadOriginalFilePath = strUploadFilePath 'If in the Guest group then set the uploas folder to the public folder If intGroupID = 2 Then strUploadFilePath = strUploadFilePath & "/public" 'Else the user has their own upload folder Else strUploadFilePath = strUploadFilePath & "/" & lngLoggedInUserID End If %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2010 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** 'Dimension global variables Dim rsDateTimeFormat 'Holds the date a time data Dim saryDateTimeData 'Holds the info for converting the date and time Dim intLoopCounter 'loop counter '****************************************** '*** Initialise array *** '****************************************** 'The date and time formatting data is feed into an application array as this data won't change 'between users and pages so cuts done on un-necessary calls to the database 'Initialise the array from the application veriable If isArray(Application(strAppPrefix & "saryAppDateTimeFormatData")) AND blnUseApplicationVariables Then saryDateTimeData = Application(strAppPrefix & "saryAppDateTimeFormatData") 'Else the application level array holding the date and time data is not created so create it Else 'Craete a recordset to get the date and time format data Set rsDateTimeFormat = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT " & strDbTable & "DateTimeFormat.ID, " & strDbTable & "DateTimeFormat.Date_format, " & strDbTable & "DateTimeFormat.Year_format, " & strDbTable & "DateTimeFormat.Seporator, " & strDbTable & "DateTimeFormat.Month1, " & strDbTable & "DateTimeFormat.Month2, " & strDbTable & "DateTimeFormat.Month3, " & strDbTable & "DateTimeFormat.Month4, " & strDbTable & "DateTimeFormat.Month5, " & strDbTable & "DateTimeFormat.Month6, " & strDbTable & "DateTimeFormat.Month7, " & strDbTable & "DateTimeFormat.Month8, " & strDbTable & "DateTimeFormat.Month9, " & strDbTable & "DateTimeFormat.Month10, " & strDbTable & "DateTimeFormat.Month11, " & strDbTable & "DateTimeFormat.Month12, " & strDbTable & "DateTimeFormat.Time_format, " & strDbTable & "DateTimeFormat.am, " & strDbTable & "DateTimeFormat.pm, " & strDbTable & "DateTimeFormat.Time_offset, " & strDbTable & "DateTimeFormat.Time_offset_hours " & _ "FROM " & strDbTable & "DateTimeFormat" & strDBNoLock & " " & _ "WHERE " & strDbTable & "DateTimeFormat.ID = 1;" 'Query the database rsDateTimeFormat.Open strSQL, adoCon 'If there are records returned then enter the data returned into an array If NOT rsDateTimeFormat.EOF Then 'Place the date time data into an array saryDateTimeData = rsDateTimeFormat.GetRows() End If 'Relese server objects rsDateTimeFormat.Close Set rsDateTimeFormat = Nothing 'Update the application level variable holding the the time and date formatting (better performance) If blnUseApplicationVariables Then 'Lock the application so that no other user can try and update the application level variable at the same time Application.Lock 'Update the application level variable Application(strAppPrefix & "saryAppDateTimeFormatData") = saryDateTimeData 'Unlock the application Application.UnLock End If End If '****************************************** '*** Date Format ***** '****************************************** 'Function to format date Private Function DateFormat(ByVal dtmDate) Dim strNewDate 'Holds the new date format Dim intDay 'Holds the integer number for the day Dim intMonth 'Holds a integer number from 1 to 12 for the month Dim strMonth 'Holds the month in it's final format which may be a number or a string so it is set to a sring value Dim intYear 'Holds the year Dim dtmNow 'Holds the present date Dim dtmTempDate 'Temprary storage area for date 'If the array is empty set the date as server default If isNull(saryDateTimeData) Then 'Set the date as orginal DateFormat = dtmDate 'If there is a data in the array then format the date Else 'Get the date now from the server dtmNow = Now() 'Place the global forum time off-set onto the recorded database time If saryDateTimeData(19,0) = "+" Then dtmTempDate = DateAdd("h", + saryDateTimeData(20,0), dtmDate) dtmNow = DateAdd("h", + saryDateTimeData(20,0), dtmNow) ElseIf saryDateTimeData(19,0) = "-" Then dtmTempDate = DateAdd("h", - saryDateTimeData(20,0), dtmDate) dtmNow = DateAdd("h", - saryDateTimeData(20,0), dtmNow) End If 'Place the users time off set onto the recorded database time If strTimeOffSet = "+" Then dtmTempDate = DateAdd("h", + intTimeOffSet, dtmTempDate) dtmNow = DateAdd("h", + intTimeOffSet, dtmNow) ElseIf strTimeOffSet = "-" Then dtmTempDate = DateAdd("h", - intTimeOffSet, dtmTempDate) dtmNow = DateAdd("h", - intTimeOffSet, dtmNow) End If 'Seprate the date into differnet strings intDay = CInt(Day(dtmTempDate)) intMonth = CInt(Month(dtmTempDate)) intYear = CInt(Year(dtmTempDate)) 'If the date is today return today as the date If intDay = CInt(Day(dtmNow)) AND intMonth = CInt(Month(dtmNow)) AND intYear = CInt(Year(dtmNow)) Then 'If today is shown in bold If blnBoldToday Then DateFormat = "" & strTxtToday & "" 'Else don't display today in bold Else DateFormat = strTxtToday End If 'Else if the date was yesterday return yeserday as the date ElseIf intDay = (CInt(Day(dtmNow))-1) AND intMonth = CInt(Month(dtmNow)) AND intYear = CInt(Year(dtmNow)) Then DateFormat = strTxtYesterday 'Else if the date is 30 december 1899 then date is unknown ElseIf intDay = 30 AND intMonth = 12 AND intYear = 1899 Then DateFormat = strTxtUnknown 'Else format the date Else 'Place 0 infront of days under 10 If intDay < 10 then intDay = "0" & intDay 'If the year is two digits then sorten the year string If saryDateTimeData(2,0) = "short" Then intYear = Right(intYear, 2) 'Format the month strMonth = saryDateTimeData((intMonth + 3),0) 'If the user has entered their own date format get that If NOT strDateFormat = "" Then saryDateTimeData(1,0) = strDateFormat 'Format the date Select Case saryDateTimeData(1,0) 'Format dd/mm/yy Case "dd/mm/yy" DateFormat = intDay & saryDateTimeData(3,0) & strMonth & saryDateTimeData(3,0) & intYear 'Format mm/dd/yy Case "mm/dd/yy" DateFormat = strMonth & saryDateTimeData(3,0) & intDay & saryDateTimeData(3,0) & intYear 'Format yy/dd/mm Case "yy/dd/mm" DateFormat = intYear & saryDateTimeData(3,0) & intDay & saryDateTimeData(3,0) & strMonth 'Format yy/mm/dd Case "yy/mm/dd" DateFormat = intYear & saryDateTimeData(3,0) & strMonth & saryDateTimeData(3,0) & intDay End Select End If End If End Function '****************************************** '*** Time Format ***** '****************************************** 'Function to format time Function TimeFormat(ByVal dtmTime) Dim strNewDate 'Holds the new date format Dim intHour 'Holds the integer number for the hours Dim intMinute 'Holds a integer number for the mintes Dim strPeriod 'Holds wether it is am or pm Dim dtmTempTime 'Temporary storage area for the time 'If the array is empty then return tyhe original time If isNull(saryDateTimeData) Then 'Set the date as server default TimeFormat = dtmTime 'If there is a data in the array then format the date Else 'Place the global forum time off-set onto the recorded database time If saryDateTimeData(19,0) = "+" Then dtmTempTime = DateAdd("h", + saryDateTimeData(20,0), dtmTime) ElseIf saryDateTimeData(19,0) = "-" Then dtmTempTime = DateAdd("h", - saryDateTimeData(20,0), dtmTime) End If 'Place the users time off-set onto the recorded database time If strTimeOffSet = "+" Then dtmTempTime = DateAdd("h", + intTimeOffSet, dtmTempTime) ElseIf strTimeOffSet = "-" Then dtmTempTime = DateAdd("h", - intTimeOffSet, dtmTempTime) End If 'Seprate the time into differnet strings intHour = CInt(Hour(dtmTempTime)) intMinute = CInt(Minute(dtmTempTime)) 'Place 0 infront of minutes under 10 If intMinute < 10 then intMinute = "0" & intMinute 'If the time is 12 hours then change the time to 12 hour clock If CInt(saryDateTimeData(16,0)) = 12 Then 'Set the time period If intHour >= 12 then strPeriod = saryDateTimeData(18,0) Else strPeriod = saryDateTimeData(17,0) End If 'Change the hour to 12 hour clock time Select Case intHour Case 00 intHour = 12 Case 01 intHour = 1 Case 02 intHour = 2 Case 03 intHour = 3 Case 04 intHour = 4 Case 05 intHour = 5 Case 06 intHour = 6 Case 07 intHour = 7 Case 08 intHour = 8 Case 09 intHour = 9 Case 13 intHour = 1 Case 14 intHour = 2 Case 15 intHour = 3 Case 16 intHour = 4 Case 17 intHour = 5 Case 18 intHour = 6 Case 19 intHour = 7 Case 20 intHour = 8 Case 21 intHour = 9 Case 22 intHour = 10 Case 23 intHour = 11 End Select 'ElseIf it is 24 hour clock place another 0 infront of anything below 10 hours ElseIf intHour < 10 Then intHour = "0" & intHour End If 'Return the Formated time TimeFormat = intHour & ":" & intMinute & strPeriod End If End Function '************************************************************************** '*** Date Format for without 'Today' and no date alteration option ***** '************************************************************************** 'Function to format date that doesn't use 'Today' or 'Yesterday' in dates Private Function stdDateFormat(ByVal dtmDate, ByVal blnDateOffSet) Dim strNewDate 'Holds the new date format Dim intDay 'Holds the integer number for the day Dim intMonth 'Holds a integer number from 1 to 12 for the month Dim strMonth 'Holds the month in it's final format which may be a number or a string so it is set to a sring value Dim intYear 'Holds the year Dim dtmTempDate 'Temporary storage area for date 'If the array is empty set the date as server default If isNull(saryDateTimeData) Then 'Set the date as orginal stdDateFormat = dtmDate 'If there is a data in the array then format the date Else 'If date time off set is included the calaculate new date If blnDateOffSet Then 'Place the global forum time off-set onto the recorded database time If saryDateTimeData(19,0) = "+" Then dtmTempDate = DateAdd("h", + saryDateTimeData(20,0), dtmDate) ElseIf saryDateTimeData(19,0) = "-" Then dtmTempDate = DateAdd("h", - saryDateTimeData(20,0), dtmDate) End If 'Place the users time off set onto the recorded database time If strTimeOffSet = "+" Then dtmTempDate = DateAdd("h", + intTimeOffSet, dtmTempDate) ElseIf strTimeOffSet = "-" Then dtmTempDate = DateAdd("h", - intTimeOffSet, dtmTempDate) End If 'Else just process the date 'as is' Else dtmTempDate = dtmDate End If 'Seprate the date into differnet strings intDay = CInt(Day(dtmTempDate)) intMonth = CInt(Month(dtmTempDate)) intYear = CInt(Year(dtmTempDate)) 'Place 0 infront of days under 10 If intDay < 10 then intDay = "0" & intDay 'If the year is two digits then sorten the year string If saryDateTimeData(2,0) = "short" Then intYear = Right(intYear, 2) 'Format the month strMonth = saryDateTimeData((intMonth + 3),0) 'If the user has entered their own date format get that If NOT strDateFormat = "" Then saryDateTimeData(1,0) = strDateFormat 'Format the date Select Case saryDateTimeData(1,0) 'Format dd/mm/yy Case "dd/mm/yy" stdDateFormat = intDay & saryDateTimeData(3,0) & strMonth & saryDateTimeData(3,0) & intYear 'Format mm/dd/yy Case "mm/dd/yy" stdDateFormat = strMonth & saryDateTimeData(3,0) & intDay & saryDateTimeData(3,0) & intYear 'Format yy/dd/mm Case "yy/dd/mm" stdDateFormat = intYear & saryDateTimeData(3,0) & intDay & saryDateTimeData(3,0) & strMonth 'Format yy/mm/dd Case "yy/mm/dd" stdDateFormat = intYear & saryDateTimeData(3,0) & strMonth & saryDateTimeData(3,0) & intDay End Select End If End Function '****************************************** '*** Date/Time Number ***** '****************************************** 'Function to format time Function DateTimeNum(ByVal strElement) Dim strDateElement 'Get the date/time element required Select Case strElement Case "Year" strDateElement = CInt(Year(Now())) Case "Month" strDateElement = CInt(Month(Now())) Case "Day" strDateElement = CInt(Day(Now())) Case "Hour" strDateElement = CInt(Hour(Now())) Case "Minute" strDateElement = CInt(Minute(Now())) Case "Second" strDateElement = CInt(Second(Now())) End Select 'If below 10 then place a 0 in front of te returned string If strDateElement < 10 then strDateElement = "0" & strDateElement 'Return function DateTimeNum = strDateElement End Function '****************************************** '*** RSS Date Format ***** '****************************************** 'Function to format date for RSS feeds Private Function RssDateFormat(ByVal dtmDate, ByVal strTimeZone) Dim strNewDate 'Holds the new date format Dim intDay 'Holds the integer number for the day Dim intWeekDay 'Holds the weekday in interget format Dim strWeekDay 'Holds the day in string format Dim intMonth 'Holds a integer number from 1 to 12 for the month Dim strMonth 'Holds the month in it's final format which may be a number or a string so it is set to a sring value Dim intYear 'Holds the year Dim dtmNow 'Holds the present date Dim dtmTempDate 'Temprary storage area for date Dim intHour 'Holds the integer number for the hours Dim intMinute 'Holds a integer number for the mintes Dim intSeconds 'Holds the secounds 'If the array is empty set the date as server default If isNull(saryDateTimeData) Then 'Set the date as orginal RssDateFormat = dtmDate 'If there is a data in the array then format the date Else 'Get the date now from the server dtmNow = Now() 'Place the global forum time off-set onto the recorded database time If saryDateTimeData(19,0) = "+" Then dtmTempDate = DateAdd("h", + saryDateTimeData(20,0), dtmDate) dtmNow = DateAdd("h", + saryDateTimeData(20,0), dtmNow) ElseIf saryDateTimeData(19,0) = "-" Then dtmTempDate = DateAdd("h", - saryDateTimeData(20,0), dtmDate) dtmNow = DateAdd("h", - saryDateTimeData(20,0), dtmNow) End If 'Place the users time off set onto the recorded database time If strTimeOffSet = "+" Then dtmTempDate = DateAdd("h", + intTimeOffSet, dtmTempDate) dtmNow = DateAdd("h", + intTimeOffSet, dtmNow) ElseIf strTimeOffSet = "-" Then dtmTempDate = DateAdd("h", - intTimeOffSet, dtmTempDate) dtmNow = DateAdd("h", - intTimeOffSet, dtmNow) End If 'Seprate the date into differnet strings intDay = CInt(Day(dtmTempDate)) intWeekDay = CInt(WeekDay(dtmTempDate)) intMonth = CInt(Month(dtmTempDate)) intYear = CInt(Year(dtmTempDate)) intHour = CInt(Hour(dtmTempDate)) intMinute = CInt(Minute(dtmTempDate)) intSeconds = CInt(Second(dtmTempDate)) 'Place 0 infront of days under 10 If intDay < 10 then intDay = "0" & intDay 'Place 0 infront of hours under 10 If intHour < 10 then intHour = "0" & intHour 'Place 0 infront of minutes under 10 If intMinute < 10 then intMinute = "0" & intMinute 'Place 0 infront of hours under 10 If intSeconds < 10 then intSeconds = "0" & intSeconds 'Format the month Select Case intMonth Case 1 strMonth = "Jan" Case 2 strMonth = "Feb" Case 3 strMonth = "Mar" Case 4 strMonth = "Apr" Case 5 strMonth = "May" Case 6 strMonth = "Jun" Case 7 strMonth = "Jul" Case 8 strMonth = "Aug" Case 9 strMonth = "Sep" Case 10 strMonth = "Oct" Case 11 strMonth = "Nov" Case 12 strMonth = "Dec" End Select 'Format the day Select Case intWeekDay Case 1 strWeekDay = "Sun" Case 2 strWeekDay = "Mon" Case 3 strWeekDay = "Tue" Case 4 strWeekDay = "Wed" Case 5 strWeekDay = "Thu" Case 6 strWeekDay = "Fri" Case 7 strWeekDay = "Sat" End Select 'Format the date RssDateFormat = strWeekDay & ", " & intDay & " " & strMonth & " " & intYear & " " & intHour & ":" & intMinute & ":" & intSeconds & " " & strTimeZone End If End Function '****************************************** '*** Now() date with off-set ***** '****************************************** 'Calculate the now() date according to any server time off-set Private Function getNowDate() Dim dtmNow 'Get the date now from the server dtmNow = Now() 'Place the global forum time off-set onto the recorded database time If saryDateTimeData(19,0) = "+" Then dtmNow = DateAdd("h", + saryDateTimeData(20,0), dtmNow) ElseIf saryDateTimeData(19,0) = "-" Then dtmNow = DateAdd("h", - saryDateTimeData(20,0), dtmNow) End If 'Place the users time off set onto the recorded database time If strTimeOffSet = "+" Then dtmNow = DateAdd("h", + intTimeOffSet, dtmNow) ElseIf strTimeOffSet = "-" Then dtmNow = DateAdd("h", - intTimeOffSet, dtmNow) End If 'Return date getNowDate = dtmNow End Function %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2010 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** '****************************************** '*** Strip entites from RTE posts ***** '****************************************** Private Function WYSIWYGFormatPost(ByVal strMessage) 'Format messages that use the WYSIWYG Editor strMessage = Replace(strMessage, " border=0>", ">", 1, -1, 1) strMessage = Replace(strMessage, " target=_blank>", ">", 1, -1, 1) strMessage = Replace(strMessage, " target=_top>", ">", 1, -1, 1) strMessage = Replace(strMessage, " target=_self>", ">", 1, -1, 1) strMessage = Replace(strMessage, " target=_parent>", ">", 1, -1, 1) strMessage = Replace(strMessage, " style=""CURSOR: hand""", "", 1, -1, 1) 'Strip wordTidy tags strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) 'Strip out add blocking injection code 'Strip out code injected by Badly behaved Firefox plugins strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "
 
", "", 1, -1, 1) 'Strip out Norton Internet Security pop up add blocking injected code strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) 'Strip out Zone Alarm Pro's pop up add blocking injected code (bloody pain in the arse crap software) If Instr(1, strMessage, "", 1) Then strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "window.open=NS_ActualOpen; orig_onload = window.onload; orig_onunload = window.onunload; window.onload = noopen_load; window.onunload = noopen_unload;", "", 1, -1, 1) End If 'Strip out Norton Personal Firewall 2003's pop up add blocking injected code strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) 'Strip out Kerio Firewall pop up add blocking injected code (now Sunbelt) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) strMessage = Replace(strMessage, "", "", 1, -1, 1) 'Strip linux firewall for my LAN that injects this for ad blocking strMessage = Replace(strMessage, "", "", 1, -1, 1) 'Return the function WYSIWYGFormatPost = strMessage End Function '****************************************** '*** Format Post Function ***** '****************************************** 'Format Post Function to covert HTML tags into safe tags Private Function FormatPost(ByVal strMessage) 'Format spaces and HTML strMessage = Replace(strMessage, "<", "<", 1, -1, 1) strMessage = Replace(strMessage, ">", ">", 1, -1, 1) strMessage = Replace(strMessage, " ", "       ", 1, -1, 1) strMessage = Replace(strMessage, " ", "      ", 1, -1, 1) strMessage = Replace(strMessage, " ", "     ", 1, -1, 1) strMessage = Replace(strMessage, " ", "    ", 1, -1, 1) strMessage = Replace(strMessage, " ", "   ", 1, -1, 1) strMessage = Replace(strMessage, vbTab, "     ", 1, -1, 1) strMessage = Replace(strMessage, Chr(10), "
", 1, -1, 1) 'Return the function FormatPost = strMessage End Function '****************************************** '*** Format Forum Codes Function ***** '****************************************** 'Format Forum Codes Function to covert forum codes to HTML Private Function FormatForumCodes(ByVal strMessage) Dim strTempMessage 'Temporary word hold for e-mail, fonts, and url words Dim strMessageLink 'Holds the new mesage link that needs converting back into code Dim lngStartPos 'Holds the start position for a link Dim lngEndPos 'Holds the end position for a word Dim intLoop 'Loop counter 'If emoticons are on then change the emotion symbols for the path to the relative smiley icon If blnEmoticons = True Then 'Loop through the emoticons array For intLoop = 1 to UBound(saryEmoticons) strMessage = Replace(strMessage, saryEmoticons(intLoop,2), "", 1, -1, 1) Next End If 'Change forum codes for bold and italic HTML tags back to the normal satandard HTML tags strMessage = Replace(strMessage, "[B]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/B]", "", 1, -1, 1) strMessage = Replace(strMessage, "[STRONG]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/STRONG]", "", 1, -1, 1) strMessage = Replace(strMessage, "[I]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/I]", "", 1, -1, 1) strMessage = Replace(strMessage, "[EM]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/EM]", "", 1, -1, 1) strMessage = Replace(strMessage, "[U]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/U]", "", 1, -1, 1) strMessage = Replace(strMessage, "[HR]", "
", 1, -1, 1) strMessage = Replace(strMessage, "[LIST=1]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[/LIST=1]", "
", 1, -1, 1) strMessage = Replace(strMessage, "[LIST]", "", 1, -1, 1) strMessage = Replace(strMessage, "[LI]", "
  • ", 1, -1, 1) strMessage = Replace(strMessage, "[/LI]", "
  • ", 1, -1, 1) strMessage = Replace(strMessage, "[CENTER]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[/CENTER]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[STRIKE]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/STRIKE]", "", 1, -1, 1) strMessage = Replace(strMessage, "[SUB]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/SUB]", "", 1, -1, 1) strMessage = Replace(strMessage, "[SUP]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/SUP]", "", 1, -1, 1) strMessage = Replace(strMessage, "[BR]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[PRE]", "
    ", 1, -1, 1)
    	strMessage = Replace(strMessage, "[/PRE]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[P]", "

    ", 1, -1, 1) strMessage = Replace(strMessage, "[/P]", "

    ", 1, -1, 1) strMessage = Replace(strMessage, "[P ALIGN=CENTER]", "

    ", 1, -1, 1) strMessage = Replace(strMessage, "[P ALIGN=JUSTIFY]", "

    ", 1, -1, 1) strMessage = Replace(strMessage, "[P ALIGN=LEFT]", "

    ", 1, -1, 1) strMessage = Replace(strMessage, "[P ALIGN=RIGHT]", "

    ", 1, -1, 1) strMessage = Replace(strMessage, "[DIV]", "

    ", 1, -1, 1) strMessage = Replace(strMessage, "[/DIV]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[DIV ALIGN=CENTER]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[DIV ALIGN=JUSTIFY]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[DIV ALIGN=LEFT]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[DIV ALIGN=RIGHT]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[BLOCKQUOTE]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[/BLOCKQUOTE]", "
    ", 1, -1, 1) strMessage = Replace(strMessage, "[SIZE=1]", "", 1, -1, 1) strMessage = Replace(strMessage, "[SIZE=2]", "", 1, -1, 1) strMessage = Replace(strMessage, "[SIZE=3]", "", 1, -1, 1) strMessage = Replace(strMessage, "[SIZE=4]", "", 1, -1, 1) strMessage = Replace(strMessage, "[SIZE=5]", "", 1, -1, 1) strMessage = Replace(strMessage, "[SIZE=6]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/SIZE]", "", 1, -1, 1) strMessage = Replace(strMessage, "[FONT=Arial]", "", 1, -1, 1) strMessage = Replace(strMessage, "[FONT=Courier]", "", 1, -1, 1) strMessage = Replace(strMessage, "[FONT=Times]", "", 1, -1, 1) strMessage = Replace(strMessage, "[FONT=Verdana]", "", 1, -1, 1) strMessage = Replace(strMessage, "[/FONT]", "", 1, -1, 1) 'These are for backward compatibility with old forum codes strMessage = Replace(strMessage, "[BLACK]", "", 1, -1, 1) strMessage = Replace(strMessage, "[WHITE]", "", 1, -1, 1) strMessage = Replace(strMessage, "[BLUE]", "", 1, -1, 1) strMessage = Replace(strMessage, "[RED]", "", 1, -1, 1) strMessage = Replace(strMessage, "[GREEN]", "", 1, -1, 1) strMessage = Replace(strMessage, "[YELLOW]", "", 1, -1, 1) strMessage = Replace(strMessage, "[ORANGE]", "", 1, -1, 1) strMessage = Replace(strMessage, "[BROWN]", "", 1, -1, 1) strMessage = Replace(strMessage, "[MAGENTA]", "", 1, -1, 1) strMessage = Replace(strMessage, "[CYAN]", "", 1, -1, 1) strMessage = Replace(strMessage, "[LIME GREEN]", "", 1, -1, 1) 'Loop through the message till all or any images are turned into HTML images Do While InStr(1, strMessage, "[IMG]", 1) > 0 AND InStr(1, strMessage, "[/IMG]", 1) > 0 'Find the start position in the message of the [IMG] code lngStartPos = InStr(1, strMessage, "[IMG]", 1) 'Find the position in the message for the [/IMG]] closing code lngEndPos = InStr(lngStartPos, strMessage, "[/IMG]", 1) + 6 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 'Read in the code to be converted into a hyperlink from the message strMessageLink = Trim(Mid(strMessage, lngStartPos, (lngEndPos - lngStartPos))) 'Place the message link into the tempoary message variable strTempMessage = strMessageLink 'Format the IMG tages into an HTML image tag strTempMessage = Replace(strTempMessage, "[IMG]", " at the end If InStr(1, strTempMessage, "[/IMG]", 1) Then strTempMessage = Replace(strTempMessage, "[/IMG]", """>", 1, -1, 1) Else strTempMessage = strTempMessage & ">" End If 'Place the new fromatted hyperlink into the message string body strMessage = Replace(strMessage, strMessageLink, strTempMessage, 1, -1, 1) Loop 'Loop through the message till all or any hyperlinks are turned into HTML hyperlinks Do While InStr(1, strMessage, "[URL=", 1) > 0 AND InStr(1, strMessage, "[/URL]", 1) > 0 'Find the start position in the message of the [URL= code lngStartPos = InStr(1, strMessage, "[URL=", 1) 'Find the position in the message for the [/URL] closing code lngEndPos = InStr(lngStartPos, strMessage, "[/URL]", 1) + 6 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 7 'Read in the code to be converted into a hyperlink from the message strMessageLink = Trim(Mid(strMessage, lngStartPos, (lngEndPos - lngStartPos))) 'Place the message link into the tempoary message variable strTempMessage = strMessageLink 'Format the link into an HTML hyperlink strTempMessage = Replace(strTempMessage, "[URL=", " at the end If InStr(1, strTempMessage, "[/URL]", 1) Then strTempMessage = Replace(strTempMessage, "[/URL]", "", 1, -1, 1) strTempMessage = Replace(strTempMessage, "]", """>", 1, -1, 1) Else strTempMessage = strTempMessage & ">" End If 'Place the new fromatted hyperlink into the message string body strMessage = Replace(strMessage, strMessageLink, strTempMessage, 1, -1, 1) Loop 'Loop through the message till all or any hyperlinks are turned into HTML hyperlinks Do While InStr(1, strMessage, "[URL]", 1) > 0 AND InStr(1, strMessage, "[/URL]", 1) > 0 'Find the start position in the message of the [URL] code lngStartPos = InStr(1, strMessage, "[URL]", 1) 'Find the position in the message for the [/URL]] closing code lngEndPos = InStr(lngStartPos, strMessage, "[/URL]", 1) + 6 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 'Read in the code to be converted into a hyperlink from the message strMessageLink = Trim(Mid(strMessage, lngStartPos, (lngEndPos - lngStartPos))) 'Place the message link into the tempoary message variable strTempMessage = strMessageLink 'Remove hyperlink BB codes strTempMessage = Replace(strTempMessage, "[URL]", "", 1, -1, 1) strTempMessage = Replace(strTempMessage, "[/URL]", "", 1, -1, 1) 'Format the URL tages into an HTML hyperlinks strTempMessage = "" & strTempMessage & "" 'Place the new fromatted hyperlink into the message string body strMessage = Replace(strMessage, strMessageLink, strTempMessage, 1, -1, 1) Loop 'Loop through the message till all or any email links are turned into HTML mailto links Do While InStr(1, strMessage, "[EMAIL=", 1) > 0 AND InStr(1, strMessage, "[/EMAIL]", 1) > 0 'Find the start position in the message of the [EMAIL= code lngStartPos = InStr(1, strMessage, "[EMAIL=", 1) 'Find the position in the message for the [/EMAIL] closing code lngEndPos = InStr(lngStartPos, strMessage, "[/EMAIL]", 1) + 8 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 9 'Read in the code to be converted into a email link from the message strMessageLink = Trim(Mid(strMessage, lngStartPos, (lngEndPos - lngStartPos))) 'Place the message link into the tempoary message variable strTempMessage = strMessageLink 'Format the link into an HTML mailto link strTempMessage = Replace(strTempMessage, "[EMAIL=", " at the end If InStr(1, strTempMessage, "[/EMAIL]", 1) Then strTempMessage = Replace(strTempMessage, "[/EMAIL]", "", 1, -1, 1) strTempMessage = Replace(strTempMessage, "]", """>", 1, -1, 1) Else strTempMessage = strTempMessage & ">" End If 'Place the new fromatted HTML mailto into the message string body strMessage = Replace(strMessage, strMessageLink, strTempMessage, 1, -1, 1) Loop 'Loop through the message till all or any files are turned into HTML hyperlinks Do While InStr(1, strMessage, "[FILE=", 1) > 0 AND InStr(1, strMessage, "[/FILE]", 1) > 0 'Find the start position in the message of the [FILE= code lngStartPos = InStr(1, strMessage, "[FILE=", 1) 'Find the position in the message for the [/FILE] closing code lngEndPos = InStr(lngStartPos, strMessage, "[/FILE]", 1) + 7 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 8 'Read in the code to be converted into a hyperlink from the message strMessageLink = Trim(Mid(strMessage, lngStartPos, (lngEndPos - lngStartPos))) 'Place the message link into the tempoary message variable strTempMessage = strMessageLink 'Format the link into an HTML hyperlink strTempMessage = Replace(strTempMessage, "[FILE=", " at the end If InStr(1, strTempMessage, "[/FILE]", 1) Then strTempMessage = Replace(strTempMessage, "[/FILE]", "", 1, -1, 1) strTempMessage = Replace(strTempMessage, "]", """>", 1, -1, 1) Else strTempMessage = strTempMessage & ">" End If 'Place the new fromatted hyperlink into the message string body strMessage = Replace(strMessage, strMessageLink, strTempMessage, 1, -1, 1) Loop 'Loop through the message till all font colour codes are turned into fonts colours Do While InStr(1, strMessage, "[COLOR=", 1) > 0 AND InStr(1, strMessage, "[/COLOR]", 1) > 0 'Find the start position in the message of the [COLOR= code lngStartPos = InStr(1, strMessage, "[COLOR=", 1) 'Find the position in the message for the [/COLOR] closing code lngEndPos = InStr(lngStartPos, strMessage, "[/COLOR]", 1) + 8 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 9 'Read in the code to be converted into a font colour from the message strMessageLink = Trim(Mid(strMessage, lngStartPos, (lngEndPos - lngStartPos))) 'Place the message colour into the tempoary message variable strTempMessage = strMessageLink 'Format the link into an font colour HTML tag strTempMessage = Replace(strTempMessage, "[COLOR=", "", 1, -1, 1) strTempMessage = Replace(strTempMessage, "]", ">", 1, -1, 1) Else strTempMessage = strTempMessage & ">" End If 'Place the new fromatted colour HTML tag into the message string body strMessage = Replace(strMessage, strMessageLink, strTempMessage, 1, -1, 1) Loop 'Hear for backward compatability with old colour codes abive strMessage = Replace(strMessage, "[/COLOR]", "", 1, -1, 1) 'Return the function FormatForumCodes = strMessage End Function '****************************************** '*** Format User Quote *** '****************************************** 'This function formats quotes that contain usernames Function formatUserQuote(ByVal strMessage) 'Declare variables Dim strQuotedAuthor 'Holds the name of the author who is being quoted Dim strQuotedMessage 'Hold the quoted message Dim lngStartPos 'Holds search start postions Dim lngEndPos 'Holds end start postions Dim strBuildQuote 'Holds the built quoted message Dim strOriginalQuote 'Holds the quote in original format 'Loop through all the quotes in the message and convert them to formated quotes Do While InStr(1, strMessage, "[QUOTE=", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 'Get the start and end in the message of the author who is being quoted lngStartPos = InStr(1, strMessage, "[QUOTE=", 1) + 7 lngEndPos = InStr(lngStartPos, strMessage, "]", 1) 'If there is something returned get the authors name If lngStartPos > 6 AND lngEndPos > 0 Then strQuotedAuthor = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) End If 'Get the start and end in the message of the message to quote lngStartPos = lngStartPos + Len(strQuotedAuthor) + 1 lngEndPos = InStr(lngStartPos, strMessage, "[/QUOTE]", 1) 'Make sure the end position is not in error If lngEndPos - lngStartPos =< 0 Then lngEndPos = lngStartPos + Len(strQuotedAuthor) 'If there is something returned get message to quote If lngEndPos > lngStartPos Then 'Get the message to be quoted strQuotedMessage = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Srip out any perenetis for those that are use to BBcodes that are different strQuotedAuthor = Replace(strQuotedAuthor, """", "", 1, -1, 1) 'Build the HTML for the displying of the quoted message strBuildQuote = vbCrLf & "
    " & strTxtOriginallyPostedBy & " " & strQuotedAuthor & "

    " & strQuotedMessage & "
    " End If 'Get the start and end position in the start and end position in the message of the quote lngStartPos = InStr(1, strMessage, "[QUOTE=", 1) lngEndPos = InStr(lngStartPos, strMessage, "[/QUOTE]", 1) + 8 'Make sure the end position is not in error If lngEndPos - lngStartPos =< 7 Then lngEndPos = lngStartPos + Len(strQuotedAuthor) + 8 'Get the original quote to be replaced in the message strOriginalQuote = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Replace the quote codes in the message with the new formated quote If strBuildQuote <> "" Then strMessage = Replace(strMessage, strOriginalQuote, strBuildQuote, 1, -1, 1) Else strMessage = Replace(strMessage, strOriginalQuote, Replace(strOriginalQuote, "[", "[", 1, -1, 1), 1, -1, 1) End If Loop 'Return the function formatUserQuote = strMessage End Function '****************************************** '*** Format Quote *** '****************************************** 'This function formats the quote Function formatQuote(ByVal strMessage) 'Declare variables Dim strQuotedMessage 'Hold the quoted message Dim lngStartPos 'Holds search start postions Dim lngEndPos 'Holds end start postions Dim strBuildQuote 'Holds the built quoted message Dim strOriginalQuote 'Holds the quote in original format 'Loop through all the quotes in the message and convert them to formated quotes Do While InStr(1, strMessage, "[QUOTE]", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 'Get the start and end in the message of the author who is being quoted lngStartPos = InStr(1, strMessage, "[QUOTE]", 1) + 7 lngEndPos = InStr(lngStartPos, strMessage, "[/QUOTE]", 1) 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 7 'If there is something returned get message to quote If lngEndPos > lngStartPos Then 'Get the message to be quoted strQuotedMessage = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Build the HTML for the displying of the quoted message strBuildQuote = vbCrLf & "
    " & strQuotedMessage & "
    " End If 'Get the start and end position in the start and end position in the message of the quote lngStartPos = InStr(1, strMessage, "[QUOTE]", 1) lngEndPos = InStr(lngStartPos, strMessage, "[/QUOTE]", 1) + 8 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 7 'Get the original quote to be replaced in the message strOriginalQuote = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Replace the quote codes in the message with the new formated quote If strBuildQuote <> "" Then strMessage = Replace(strMessage, strOriginalQuote, strBuildQuote, 1, -1, 1) Else strMessage = Replace(strMessage, strOriginalQuote, Replace(strOriginalQuote, "[", "[", 1, -1, 1), 1, -1, 1) End If Loop 'Return the function formatQuote = strMessage End Function '****************************************** '*** Format Code Block *** '****************************************** 'This function formats the code blocks Function formatCode(ByVal strMessage) 'Declare variables Dim strCodeMessage 'Hold the coded message Dim lngStartPos 'Holds search start postions Dim lngEndPos 'Holds end start postions Dim strBuildCodeBlock 'Holds the built coded message Dim strOriginalCodeBlock 'Holds the code block in original format 'Loop through all the codes in the message and convert them to formated code block Do While InStr(1, strMessage, "[CODE]", 1) > 0 AND InStr(1, strMessage, "[/CODE]", 1) > 0 'Get the start and end in the message of the author who is being coded lngStartPos = InStr(1, strMessage, "[CODE]", 1) + 6 lngEndPos = InStr(lngStartPos, strMessage, "[/CODE]", 1) 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 'If there is something returned get message to code block If lngEndPos > lngStartPos Then 'Get the message to be coded strCodeMessage = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Build the HTML for the displaying of the code strBuildCodeBlock = vbCrLf & "
    " & strCodeMessage & "
    " End If 'Get the start and end position in the start and end position in the message of the code block lngStartPos = InStr(1, strMessage, "[CODE]", 1) lngEndPos = InStr(lngStartPos, strMessage, "[/CODE]", 1) + 7 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 'Get the original code to be replaced in the message strOriginalCodeBlock = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Replace the code codes in the message with the new formated code block If strBuildCodeBlock <> "" Then strMessage = Replace(strMessage, strOriginalCodeBlock, strBuildCodeBlock, 1, -1, 1) Else strMessage = Replace(strMessage, strOriginalCodeBlock, Replace(strOriginalCodeBlock, "[", "[", 1, -1, 1), 1, -1, 1) End If Loop 'Return the function formatCode = strMessage End Function '****************************************** '*** Format Signature *** '****************************************** 'This function formats falsh codes Function formatSignature(ByVal strSignature) Dim strSignatureArea 'Create signature strSignatureArea = "" & _ vbCrLf & " " & _ vbCrLf & "
    " & _ vbCrLf & " " & strSignature & _ vbCrLf & "
    " & _ vbCrLf & " " 'Return the function formatSignature = strSignatureArea End Function '****************************************** '*** Format Flash File Support *** '****************************************** 'This function formats falsh codes Function formatFlash(ByVal strMessage) 'Declare variables Dim lngStartPos 'Holds search start postions Dim lngEndPos 'Holds end start postions Dim saryFlashAttributes 'Holds the features of the input flash file Dim intAttrbuteLoop 'Holds the attribute loop counter Dim strFlashWidth 'Holds the string value of the width of the Flash file Dim intFlashWidth 'Holds the interger value of the width of the flash file Dim strFlashHeight 'Holds the string value of the height of the Flash file Dim intFlashHeight 'Holds the interger value of the height of the flash file Dim strBuildFlashLink 'Holds the converted BBcode for the flash file Dim strTempFlashMsg 'Tempoary store for the BBcode Dim strFlashLink 'Holds the link to the flash file 'Loop through all the codes in the message and convert them to formated flash links Do While InStr(1, strMessage, "[FLASH", 1) > 0 AND InStr(1, strMessage, "[/FLASH]", 1) > 0 'Initiliase variables intFlashWidth = 250 intFlashHeight = 250 strFlashLink = "" strBuildFlashLink = "" strTempFlashMsg = "" 'Get the Flash BBcode from the message lngStartPos = InStr(1, strMessage, "[FLASH", 1) lngEndPos = InStr(lngStartPos, strMessage, "[/FLASH]", 1) + 8 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 'Get the original Flash BBcode from the message strTempFlashMsg = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Get the start and end in the message of the attributes of the Flash file lngStartPos = InStr(1, strTempFlashMsg, "[FLASH", 1) + 6 lngEndPos = InStr(lngStartPos, strTempFlashMsg, "]", 1) 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos 'If there is something returned get the details (eg. dimensions) of the flash file If strTempFlashMsg <> "" Then 'Place any attributes for the flash file in an array saryFlashAttributes = Split(Trim(Mid(strTempFlashMsg, lngStartPos, lngEndPos-lngStartPos)), " ") 'Get the dimensions of the Flash file 'Loop through the array of atrributes that are for the falsh file to get the dimentions For intAttrbuteLoop = 0 To UBound(saryFlashAttributes) 'If this is the width attribute then read in the width dimention If InStr(1, saryFlashAttributes(intAttrbuteLoop), "WIDTH=", 1) Then 'Get the width dimention strFlashWidth = Replace(saryFlashAttributes(intAttrbuteLoop), "WIDTH=", "", 1, -1, 1) 'Make sure we are left with a numeric number if so convert to an interger and place in an interger variable If isNumeric(strFlashWidth) Then intFlashWidth = CInt(strFlashWidth) End If 'If this is the height attribute then read in the height dimention If InStr(1, saryFlashAttributes(intAttrbuteLoop), "HEIGHT=", 1) Then 'Get the height dimention strFlashHeight = Replace(saryFlashAttributes(intAttrbuteLoop), "HEIGHT=", "", 1, -1, 1) 'Make sure we are left with a numeric number if so convert to an interger and place in an interger variable If isNumeric(strFlashHeight) Then intFlashHeight = CInt(strFlashHeight) End If Next 'Get the link to the flash file lngStartPos = InStr(1, strTempFlashMsg, "]", 1) + 1 lngEndPos = InStr(lngStartPos, strTempFlashMsg, "[/FLASH]", 1) 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 8 'Read in the code to be converted into a hyperlink from the message strFlashLink = Trim(Mid(strTempFlashMsg, lngStartPos, (lngEndPos - lngStartPos))) 'Build the HTML for the displying of the flash file If strFlashLink <> "" Then strBuildFlashLink = "" End If End If 'Replace the flash codes in the message with the new formated flash link If strBuildFlashLink <> "" Then strMessage = Replace(strMessage, strTempFlashMsg, strBuildFlashLink, 1, -1, 1) Else strMessage = Replace(strMessage, strTempFlashMsg, Replace(strTempFlashMsg, "[", "[", 1, -1, 1), 1, -1, 1) End If Loop 'Return the function formatFlash = strMessage End Function '****************************************** '*** YouTube Support *** '****************************************** 'This function formats YouTube Function formatYouTube(ByVal strMessage) 'Declare variables Dim strYouTubeLink 'Hold the You Tube Link Dim lngStartPos 'Holds search start postions Dim lngEndPos 'Holds end start postions Dim strBuildYouTube 'Holds the built coded message Dim strOriginalYouTube 'Holds the code block in original format 'Loop through all the BB codes in the message and convert to a link to the YouTube movie Do While InStr(1, strMessage, "[TUBE]", 1) > 0 AND InStr(1, strMessage, "[/TUBE]", 1) > 0 'Get the start and end of the YouTube BBcode lngStartPos = InStr(1, strMessage, "[TUBE]", 1) + 6 lngEndPos = InStr(lngStartPos, strMessage, "[/TUBE]", 1) 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 'If there is a YouTube link then process If lngEndPos > lngStartPos Then 'Get the YouTube link strYouTubeLink = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Replace watch?v= with v/ for those copy and pasting links strYouTubeLink = Replace(Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)), "watch?v=", "v/") 'See if the YouTube link contains the whole URL or just the file name If InStr(1, strYouTubeLink, "http://", 1) = 0 Then strYouTubeLink = "http://www.youtube.com/v/" & strYouTubeLink 'Insert youTube movie strBuildYouTube = "" End If 'Get the start and end position in the start and end position in the message of the BBcode YouTube lngStartPos = InStr(1, strMessage, "[TUBE]", 1) lngEndPos = InStr(lngStartPos, strMessage, "[/TUBE]", 1) + 7 'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 'Get the original code to be replaced in the message strOriginalYouTube = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Replace the code codes in the message with the new formated code block If strBuildYouTube <> "" Then strMessage = Replace(strMessage, strOriginalYouTube, strBuildYouTube, 1, -1, 1) Else strMessage = Replace(strMessage, strOriginalYouTube, Replace(strOriginalYouTube, "[", "[", 1, -1, 1), 1, -1, 1) End If Loop 'Return the function formatYouTube = strMessage End Function '****************************************** '*** Display edit author *** '****************************************** 'This function formats XML into the name of the author and edit date and time if a message has been edited 'XML is used so that the date can be stored as a double npresion number so that it can display the local edit time to the message reader Function editedXMLParser(ByVal strMessage) 'Declare variables Dim strEditedAuthor 'Holds the name of the author who is editing the post Dim dtmEditedDate 'Holds the date the post was edited Dim lngStartPos 'Holds search start postions Dim lngEndPos 'Holds end start postions 'Get the start and end in the message of the author who edit the post lngStartPos = InStr(1, strMessage, "", 1) + 8 lngEndPos = InStr(1, strMessage, "", 1) If lngEndPos < lngStartPos Then lngEndPos = lngStartPos 'If there is something returned get the authors name strEditedAuthor = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Get the start and end in the message of the date the message was edited lngStartPos = InStr(1, strMessage, "", 1) + 10 lngEndPos = InStr(1, strMessage, "", 1) If lngEndPos < lngStartPos Then lngEndPos = lngStartPos 'If there is something returned get the date the message was edited dtmEditedDate = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) 'Get the start and end position in the string of the XML to remove lngStartPos = InStr(1, strMessage, "", 1) lngEndPos = InStr(1, strMessage, "", 1) + 9 If lngEndPos < lngStartPos Then lngEndPos = lngStartPos 'If there is something returned strip the XML from the message strMessage = Replace(strMessage, Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)), "", 1, -1, 1) 'Place the name of the person who edited the post If strEditedAuthor <> "" Then 'If there is a date and time display the author date and time the post was edited If IsDate(dtmEditedDate) Then dtmEditedDate = CDate(dtmEditedDate) editedXMLParser = strMessage & "

    " & strTxtEditBy & " " & strEditedAuthor & " - " & DateFormat(dtmEditedDate) & " " & strTxtAt & " " & TimeFormat(dtmEditedDate) & "
    " 'Just display the author name who edited the post Else editedXMLParser = strMessage & "

    " & strTxtEditBy & " " & strEditedAuthor & "
    " End If End If End Function '****************************************** '*** Convert Post to Text Function *** '****************************************** 'Function to romove icons and colurs to just leave plain text Function ConvertToText(ByVal strMessage) Dim strTempMessage 'Temporary word hold for e-mail and url words Dim strMessageLink 'Holds the new mesage link that needs converting back into code Dim lngStartPos 'Holds the start position for a link Dim lngEndPos 'Holds the end position for a word Dim intLoop 'Loop counter 'Remove hyperlinks strMessage = Replace(strMessage, " target=""_blank""", "", 1, -1, 1) 'Loop through the message till all or any hyperlinks are turned into back into froum codes Do While InStr(1, strMessage, " 0 AND InStr(1, strMessage, "", 1) > 0 'Find the start position in the message of the HTML hyperlink lngStartPos = InStr(1, strMessage, " closing code lngEndPos = InStr(lngStartPos, strMessage, "", 1) + 4 'Make sure the end position is not in error If lngEndPos - lngStartPos =< 9 Then lngEndPos = lngStartPos + 9 'Read in the code to be converted back into forum codes from the message strMessageLink = Trim(Mid(strMessage, lngStartPos, (lngEndPos - lngStartPos))) 'Place the message link into the tempoary message variable strTempMessage = strMessageLink 'Format the HTML hyperlink back into forum codes If InStr(1, strTempMessage, "src=""", 1) Then strTempMessage = Replace(strTempMessage, "", " ", 1, -1, 1) Else strTempMessage = Replace(strTempMessage, "", 1, -1, 1) strTempMessage = Replace(strTempMessage, "", " ", 1, -1, 1) strTempMessage = Replace(strTempMessage, """>", "
    - ", 1, -1, 1) End If 'Place the new fromatted codes into the message string body strMessage = Replace(strMessage, strMessageLink, strTempMessage, 1, -1, 1) Loop 'Get any that may slip through (don't look as good but still has the same effect) strMessage = Replace(strMessage, "", 1) - lngMessagePosition) 'Place the HTML tag back into the tempary message store strTempMessage = strTempMessage & Mid(strMessage, lngMessagePosition, intHTMLTagLength) 'Add the length of the HTML tag to the post message position variable lngMessagePosition = lngMessagePosition + intHTMLTagLength End If 'Loop through the search words to see if they are in the message post For intHighlightLoopCounter = 0 to UBound(sarySearchWord) 'If there is a search word in the array position check it If sarySearchWord(intHighlightLoopCounter) <> "" Then 'Get the length of the search word intSearchWordLength = Len(sarySearchWord(intHighlightLoopCounter)) 'If the next XX characters are the same as the search word then highlight them If LCase(Mid(strMessage, lngMessagePosition, intSearchWordLength)) = LCase(sarySearchWord(intHighlightLoopCounter)) Then 'Highlight the search word strTempMessage = strTempMessage & "" & Mid(strMessage, lngMessagePosition, intSearchWordLength) & "" 'Add the length of the replaced search word to the post message position variable lngMessagePosition = lngMessagePosition + intSearchWordLength - 1 'Set the changed boolean to true blnTempUpdate = True End If End If Next 'If a search word is not highlighted then add the character from the post message being checked to the temp variable If blnTempUpdate = False Then strTempMessage = strTempMessage & Mid(strMessage, lngMessagePosition, 1) End If Next 'Return the function searchHighlighter = strTempMessage End Function %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2010 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** 'Dimension variables Dim saryEmoticons(42,3) 'If you add more emoticons increase the first number to the number of emoticons you have in the array below saryEmoticons(1,1) = "Smile" 'Emoticon Name saryEmoticons(1,2) = "[:)]" 'Forum code saryEmoticons(1,3) = "smileys/smiley1.gif" 'URL/path to smiley saryEmoticons(2,1) = "Tongue" saryEmoticons(2,2) = "[:P]" saryEmoticons(2,3) = "smileys/smiley17.gif" saryEmoticons(3,1) = "Wink" saryEmoticons(3,2) = "[;)]" saryEmoticons(3,3) = "smileys/smiley2.gif" saryEmoticons(4,1) = "Cry" saryEmoticons(4,2) = "[:^(]" saryEmoticons(4,3) = "smileys/smiley19.gif" saryEmoticons(5,1) = "Big smile" saryEmoticons(5,2) = "[:D]" saryEmoticons(5,3) = "smileys/smiley4.gif" saryEmoticons(6,1) = "LOL" saryEmoticons(6,2) = "[LOL]" saryEmoticons(6,3) = "smileys/smiley36.gif" saryEmoticons(7,1) = "Dead" saryEmoticons(7,2) = "[xx(]" saryEmoticons(7,3) = "smileys/smiley11.gif" saryEmoticons(8,1) = "Embarrassed" saryEmoticons(8,2) = "[:$]" saryEmoticons(8,3) = "smileys/smiley9.gif" saryEmoticons(9,1) = "Confused" saryEmoticons(9,2) = "[:s]" saryEmoticons(9,3) = "smileys/smiley5.gif" saryEmoticons(10,1) = "Clap" saryEmoticons(10,2) = "[=D>]" saryEmoticons(10,3) = "smileys/smiley32.gif" saryEmoticons(11,1) = "Angry" saryEmoticons(11,2) = "[:x]" saryEmoticons(11,3) = "smileys/smiley7.gif" saryEmoticons(12,1) = "Ouch" saryEmoticons(12,2) = "[8(]" saryEmoticons(12,3) = "smileys/smiley18.gif" saryEmoticons(13,1) = "Star" saryEmoticons(13,2) = "[:*:]" saryEmoticons(13,3) = "smileys/smiley10.gif" saryEmoticons(14,1) = "Shocked" saryEmoticons(14,2) = "[:o]" saryEmoticons(14,3) = "smileys/smiley3.gif" saryEmoticons(15,1) = "Sleepy" saryEmoticons(15,2) = "[|)]" saryEmoticons(15,3) = "smileys/smiley12.gif" saryEmoticons(16,1) = "Unhappy" saryEmoticons(16,2) = "[:(]" saryEmoticons(16,3) = "smileys/smiley6.gif" saryEmoticons(17,1) = "Approve" saryEmoticons(17,2) = "[:^:]" saryEmoticons(17,3) = "smileys/smiley14.gif" saryEmoticons(18,1) = "Cool" saryEmoticons(18,2) = "[8D]" saryEmoticons(18,3) = "smileys/smiley16.gif" saryEmoticons(19,1) = "Clown" saryEmoticons(19,2) = "[:o)]" saryEmoticons(19,3) = "smileys/smiley8.gif" saryEmoticons(20,1) = "Evil Smile" saryEmoticons(20,2) = "[}:)]" saryEmoticons(20,3) = "smileys/smiley15.gif" saryEmoticons(21,1) = "Disapprove" saryEmoticons(21,2) = "[:V:]" saryEmoticons(21,3) = "smileys/smiley13.gif" saryEmoticons(22,1) = "Stern Smile" saryEmoticons(22,2) = "[:|]" saryEmoticons(22,3) = "smileys/smiley22.gif" saryEmoticons(23,1) = "Thumbs Up" saryEmoticons(23,2) = "[:Y:]" saryEmoticons(23,3) = "smileys/smiley20.gif" saryEmoticons(24,1) = "Thumbs Down" saryEmoticons(24,2) = "[:N:]" saryEmoticons(24,3) = "smileys/smiley21.gif" saryEmoticons(25,1) = "Geek" saryEmoticons(25,2) = "[:-B]" saryEmoticons(25,3) = "smileys/smiley23.gif" saryEmoticons(26,1) = "Ermm" saryEmoticons(26,2) = "[:[]" saryEmoticons(26,3) = "smileys/smiley24.gif" saryEmoticons(27,1) = "Question" saryEmoticons(27,2) = "[:?:]" saryEmoticons(27,3) = "smileys/smiley25.gif" saryEmoticons(28,1) = "Pinch" saryEmoticons(28,2) = "[><]" saryEmoticons(28,3) = "smileys/smiley26.gif" saryEmoticons(29,1) = "Heart" saryEmoticons(29,2) = "[L]" saryEmoticons(29,3) = "smileys/smiley27.gif" saryEmoticons(30,1) = "Broken Heart" saryEmoticons(30,2) = "[%(]" saryEmoticons(30,3) = "smileys/smiley28.gif" saryEmoticons(31,1) = "Wacko" saryEmoticons(31,2) = "[8-}]" saryEmoticons(31,3) = "smileys/smiley29.gif" saryEmoticons(32,1) = "Pig" saryEmoticons(32,2) = "[:@)]" saryEmoticons(32,3) = "smileys/smiley30.gif" saryEmoticons(33,1) = "Hug" saryEmoticons(33,2) = "[>:D<]" saryEmoticons(33,3) = "smileys/smiley31.gif" saryEmoticons(34,1) = "Censored" saryEmoticons(34,2) = "[XXX]" saryEmoticons(34,3) = "smileys/smiley35.gif" saryEmoticons(35,1) = "Ying Yang" saryEmoticons(35,2) = "[%]" saryEmoticons(35,3) = "smileys/smiley33.gif" saryEmoticons(36,1) = "Nuke" saryEmoticons(36,2) = "[!]" saryEmoticons(36,3) = "smileys/smiley34.gif" saryEmoticons(37,1) = "Exclamation" saryEmoticons(37,2) = "[!]" saryEmoticons(37,3) = "smileys/smiley37.gif" saryEmoticons(38,1) = "Lamp" saryEmoticons(38,2) = "[*]" saryEmoticons(38,3) = "smileys/smiley38.gif" saryEmoticons(39,1) = "Sick" saryEmoticons(39,2) = "[+o(]" saryEmoticons(39,3) = "smileys/smiley39.gif" saryEmoticons(40,1) = "Party" saryEmoticons(40,2) = "[<:o)]" saryEmoticons(40,3) = "smileys/smiley40.gif" saryEmoticons(41,1) = "Beer" saryEmoticons(41,2) = "[beer]" saryEmoticons(41,3) = "smileys/smiley41.gif" saryEmoticons(42,1) = "Handshake" saryEmoticons(42,2) = "[shake]" saryEmoticons(42,3) = "smileys/smiley42.gif" 'If you add more emoticons don't forget to increase the number in the Dim statement at the top! %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2010 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** Response.Buffer = True 'Make sure this page is not cached Response.Expires = -1 Response.ExpiresAbsolute = Now() - 2 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "No-Store" 'Dimension variables Dim sarryPosts 'Holds the posts recordset Dim strForumName 'Holds the forum name Dim intCatID 'Holds the cat ID Dim strCatName 'Holds the cat name Dim intMasterForumID 'Holds the main forum ID Dim strMasterForumName 'Holds the main forum name Dim lngTopicID 'Holds the topic number Dim strSubject 'Holds the topic subject Dim strUsername 'Holds the Username of the thread Dim lngUserID 'Holds the ID number of the user Dim dtmPostDate 'Holds the date the thread was made Dim strMessage 'Holds the post to display Dim strTopicIcon 'Holds the topic icon Dim lngMessageID 'Holds the message ID number Dim strAuthorHomepage 'Holds the homepage of the Username if it is given Dim strAuthorLocation 'Holds the location of the user if given Dim strAuthorAvatar 'Holds the authors avatar Dim strAuthorSignature 'Holds the authors signature Dim lngAuthorNumOfPosts 'Holds the number of posts the user has made to the forum Dim dtmAuthorRegistration 'Holds the registration date of the user Dim lngNumberOfViews 'Holds the number of times the topic has been viewed to save back to the database Dim intStatus 'Holds the users interger status Dim strStatus 'Holds the users status Dim strMode 'Holds the mode of the page that is being passed Dim intTopicPageNumber 'Holds the topic page position to link back to Dim blnIsModerator 'Set to true if the user who posted the message is a forum moderator Dim blnForumLocked 'Set to true if the forum is locked Dim blnTopicLocked 'set to true if the topic is locked Dim intThreadNo 'Holds the number of threads in the topic Dim intPriority 'Holds the priority level of the topic Dim intRecordPositionPageNum 'Holds the recorset page number to show the Threads for Dim lngTotalRecordsPages 'Holds the number of pages Dim intTopicPageLoopCounter 'Loop counter for other thread page link Dim lngTotalRecords 'Holds the total number of therads in this topic Dim strAuthorIP 'Holds the authors IP Dim strSearchKeywords 'Holds the keywords to search for Dim sarySearchWord 'Array to hold the search words Dim strGroupName 'Holds the authors group name Dim intRankStars 'Holds the number of stars for the group Dim strRankCustomStars 'Holds custom stars for the user group Dim lngPollID 'Holds the poll ID Dim blnPollNoReply 'Set to true if users can't reply to a poll Dim blnBannedIP 'Set to true if the user is using a banned IP Dim dtmLastEntryDate 'Holds the date of the last post entry to the topic Dim intIndexPosition 'Holds the idex poistion in the emiticon array Dim intNumberOfOuterLoops 'Holds the outer loop number for rows Dim intLoop 'Holds the loop index position Dim intInnerLoop 'Holds the inner loop number for columns Dim strMemberTitle 'Holds the members title Dim blnIsUserOnline 'Set to true if the user is online Dim blnHidePost 'Set to true if post is hidden Dim strPostTableRowClass 'Post row colour Dim intStartPosition 'Holds the start poition for records to be shown Dim intEndPosition 'Holds the end poition for records to be shown Dim intCurrentRecord 'Holds the current records for the posts Dim strGuestUsername 'Holds the Guest Username if it is a guest posting Dim blnHideTopic 'Set to true if topic is hidden Dim lngGetPostID 'Holds the post to go straight to Dim strSortBy 'Holds the direction the posts are listed in Dim strPostTableSideClass 'Holds the post message side column css class Dim strPostTableTopClass 'Holds the post table top details Dim dtmEventDate 'Holds the date if this is a calendar event Dim dtmEventDateEnd 'Holds the date if this is a calendar event Dim intPageLinkLoopCounter 'Loop counter for page links include Dim intPostRowsSpan 'Holds the rowspam number for post table formatting Dim strForumPassword 'Holds the forum password Dim intUnReadForumPostsLoop 'Loop counter for unread loop array Dim intAutoLockTopicsAmount 'Holds the amount topics are auto closed at Dim blnUnreadPost 'Set to true if the post is un-read Dim strMetaDescription 'Used for meta tags Dim lngAuthorNumOfPoints 'Number of points for each user Dim strSQLFromWhere 'Used for the From where clause Dim lngPrePostCount 'Used to count the number of posts before the post we want to display Dim dblTopicRating 'Holds the rating for a topic Dim lngTopicVotes 'Number of votes a topic receives Dim strDynamicKeywords 'Holds the keywords for the page Dim strPageQueryString 'Holds the querystring for the page Dim intUnReadPostCount 'Holds the unread post count Dim lngFirstUnreadPostID 'Holds the ID of the first unread post in the topic Dim strFormID 'Holds the form ID value Dim strCanonicalURL 'Initialise variables strMode = "reply" lngMessageID = 0 lngGetPostID = 0 intForumID = 0 lngTopicID = 0 intThreadNo = 0 blnIsModerator = False blnPollNoReply = False blnBannedIP = False blnHidePost = False intPriority = 0 blnHideTopic = False blnUnreadPost = False lngFirstUnreadPostID = 0 'Read in the querystrings for the page strPageQueryString = Request.QueryString() 'Read in the keywords if comming from a search strSearchKeywords = Trim(Mid(Request.QueryString("KW"), 1, 35)) strSearchKeywords = Replace(strSearchKeywords, ";", " ") 'Split up the keywords to be searched sarySearchWord = Split(Trim(strSearchKeywords), " ") 'Remove the page title from the querystring beofre doing the sql injection test If Request.QueryString("title") <> "" Then strPageQueryString = Replace(strPageQueryString, Request.QueryString("title"), "") 'Remove the keyword from the querystring before sql injection test For intLoop = 0 to UBound(sarySearchWord) strPageQueryString = Replace(strPageQueryString, sarySearchWord(intLoop), "") Next 'Test querystrings for any SQL Injection keywords Call SqlInjectionTest(strPageQueryString) 'See if the user is using a banned IP address If bannedIP() Then 'If the user is using a banned IP then set the banned IP variable to true and active member variable to false blnBannedIP = True End If 'If this is the first time the page is displayed then the Forum Thread record position is set to page 1 If isNumeric(Request.QueryString("PN")) = false Then intRecordPositionPageNum = 1 ElseIf Request.QueryString("PN") < 1 Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the Forum Thread record postion is set to the Record Position number Else intRecordPositionPageNum = IntC(Request.QueryString("PN")) End If 'Read in the Topic ID for the topic to display If isNumeric(Request.QueryString("TID")) Then lngTopicID = LngC(Request.QueryString("TID")) Else lngTopicID = 0 'If there is no Topic ID then redirect the user to the main forum page If lngTopicID = 0 Then 'Clean up Call closeDatabase() 'Redirect Response.Redirect("default.asp" & strQsSID1) End If 'Read in the post ID if we are going straight to a post If isNumeric(Request.QueryString("PID")) Then lngGetPostID = LngC(Request.QueryString("PID")) 'Fix for stupid IE 6 redirect bug (IE SUCKS!!!) MS have fixed this for IE7 If lngGetPostID = 0 AND Request.QueryString("PID") <> "" Then 'Remove the '#' hash anchor mark IE 6 includes in the string when doing a redirect (IE SUCKS!!) If InStr(Request.QueryString("PID"), "#") Then lngGetPostID = CLng(Mid(Request.QueryString("PID"), 1, InStr(Request.QueryString("PID"), "#")-1)) End If 'Sort the direction of db results from session If UCase(Request.QueryString("OB")) = "DESC" Then strSortBy = "DESC" ElseIf UCase(Request.QueryString("OB")) = "ASC" Then strSortBy = "ASC" ElseIf getSessionItem("OB") = "DESC" Then strSortBy = "DESC" Else strSortBy = "ASC" End If 'Save the sort results order to app session If Request.QueryString("OB") <> "" AND getSessionItem("OB") <> strSortBy Then Call saveSessionItem("OB", strSortBy) 'If this is a top priority post across all forums then read in the forum ID form the querystring and ingnore the real topic forum ID If Request.QueryString("PR") = "3" Then intForumID = IntC(Request.QueryString("FID")) strSQL = "" & _ "SELECT" & strDBTop1 & " " & strDbTable & "Category.Cat_ID, " & strDbTable & "Category.Cat_name, " & strDbTable & "Forum.Forum_ID AS ForumID, " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum2.Forum_name AS Main_forum, " & strDbTable & "Forum.Password, " & strDbTable & "Forum.Forum_code, " & strDbTable & "Forum.Locked AS forumLocked, " & strDbTable & "Topic.Poll_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Icon, " & strDbTable & "Topic.Locked AS topicLocked, " & strDbTable & "Topic.Priority, " & strDbTable & "Topic.No_of_views, " & strDbTable & "Topic.Hide, " & strDbTable & "Topic.Event_date, " & strDbTable & "Topic.Event_date_end, " & strDbTable & "Permissions.* " & _ "FROM " & strDbTable & "Category" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Forum AS " & strDbTable & "Forum2" & strDBNoLock & ", " & strDbTable & "Permissions" & strDBNoLock & ", " & strDbTable & "Topic" & strDBNoLock & " " & _ "WHERE " & strDbTable & "Category.Cat_ID = " & strDbTable & "Forum.Cat_ID " & _ "AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Permissions.Forum_ID " 'Get the forum ID from the topic table If intForumID = 0 Then strSQL = strSQL & _ "AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID " 'Else this is a priority post so get the forum ID from the querystring (security built in later to make sure the user is not trying to view a post they shouldn't) Else strSQL = strSQL & "" & _ "AND " & strDbTable & "Forum.Forum_ID = " & intForumID & " " End If strSQL = strSQL & "" & _ "AND (" & strDbTable & "Forum.Forum_ID = " & intForumID & " OR " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID) " & _ "AND (" & strDbTable & "Forum.Sub_ID = " & strDbTable & "Forum2.Forum_ID OR (" & strDbTable & "Forum.Sub_ID = 0 AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Forum2.Forum_ID)) " & _ "AND " & strDbTable & "Topic.Topic_ID = " & lngTopicID & " " & _ "AND (" & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & " OR " & strDbTable & "Permissions.Group_ID = " & intGroupID & ") " & _ "ORDER BY " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_Order, " & strDbTable & "Permissions.Author_ID DESC" & strDBLimit1 & ";" 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occurred write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occurred while executing SQL query on database.", "get_forum_data", "forum_posts.asp") 'Disable error trapping On Error goto 0 'If there is no record returended then set a message to say that If rsCommon.EOF Then 'If there are no thread's to display then display the appropriate error message strSubject = strTxtNoThreads 'Else get the details of the forum, permissions, and topic details Else 'Read in forum details from the database intForumID = Cint(rsCommon("ForumID")) intCatID = CInt(rsCommon("Cat_ID")) strCatName = rsCommon("Cat_name") strForumName = rsCommon("Forum_name") strMasterForumName = rsCommon("Main_forum") intMasterForumID = CLng(rsCommon("Sub_ID")) blnForumLocked = CBool(rsCommon("forumLocked")) blnHideTopic = CBool(rsCommon("Hide")) If isDate(rsCommon("Event_date")) Then dtmEventDate = CDate(rsCommon("Event_date")) If isDate(rsCommon("Event_date_end")) Then dtmEventDateEnd = CDate(rsCommon("Event_date_end")) 'Read in the forum permissions blnRead = CBool(rsCommon("View_Forum")) blnPost = CBool(rsCommon("Post")) blnReply = CBool(rsCommon("Reply_posts")) blnEdit = CBool(rsCommon("Edit_posts")) blnDelete = CBool(rsCommon("Delete_posts")) blnPriority = CBool(rsCommon("Priority_posts")) blnPollCreate = CBool(rsCommon("Poll_create")) blnVote = CBool(rsCommon("Vote")) blnModerator = CBool(rsCommon("Moderate")) blnCheckFirst = CBool(rsCommon("Display_post")) strForumPassword = rsCommon("Password") 'Read in the topic details lngPollID = CLng(rsCommon("Poll_ID")) strSubject = rsCommon("Subject") strTopicIcon = rsCommon("Icon") blnTopicLocked = CBool(rsCommon("topicLocked")) intPriority = CInt(rsCommon("Priority")) 'Get the keywords strDynamicKeywords = dynamicKeywords(strSubject) 'Clean up input to prevent XXS hack strSubject = formatInput(strSubject) 'If the user has no read writes then kick them out If blnRead = False Then 'Reset Server Objects rsCommon.Close Call closeDatabase() 'Redirect to a page asking for the user to enter the forum password Response.Redirect("insufficient_permission.asp" & strQsSID1) End If 'If the forum requires a password and a logged in forum code is not found on the users machine then send them to a login page If strForumPassword <> "" AND (getCookie("fID", "Forum" & intForumID) <> rsCommon("Forum_code") AND getSessionItem("FP" & intForumID) <> "1") Then 'Reset Server Objects rsCommon.Close Call closeDatabase() 'Redirect to a page asking for the user to enter the forum password Response.Redirect("forum_password_form.asp?RP=PT&FID=" & intForumID & "&TID=" & lngTopicID & strQsSID3) End If 'Update no. of views, if not a bot (bots can index a page 100's of times thus making the view count unreliable and lowering performance) If NOT strOSType = "Search Robot" AND NOT strOSType = "Unknown" Then 'Read in the number of views for the page form the database lngNumberOfViews = CLng(rsCommon("No_of_views")) 'Add 1 to the number of views the Topic has had lngNumberOfViews = lngNumberOfViews + 1 'Write the number of times the Topic has been viewed back to the database 'Initalise the strSQL variable with the SQL string strSQL = "UPDATE " & strDbTable & "Topic" & strRowLock & " " & _ "SET " & strDbTable & "Topic.No_of_views = " & lngNumberOfViews & " " & _ "WHERE (((" & strDbTable & "Topic.Topic_ID) = " & lngTopicID & "));" 'Set error trapping On Error Resume Next 'Write to the database adoCon.Execute(strSQL) 'If an error has occurred write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occurred while writing to the database.", "update_no._views", "forum_posts.asp") 'Disable error trapping On Error goto 0 End If End If 'clean up rsCommon.Close 'Securtiy check - if this isn't a Priority post and the user is just trying to view a post in a forum they don't have permission to 'then reload the page without the forum ID If Request.QueryString("PR") = "3" AND NOT intPriority = 3 Then 'Reset Server Objects Call closeDatabase() 'Redirect back to this page without the forum ID Response.Redirect("forum_posts.asp?TID=" & lngTopicID & strQsSID3) End If 'Use the application session to pass around what forum this user is within If IntC(getSessionItem("FID")) <> intForumID Then Call saveSessionItem("FID", intForumID) '******************************** '**** Get Topics SQL Query **** '******************************** 'Start with WHERE Cluases as these are used in both the count query and in the main query strSQLFromWhere = strSQLFromWhere & "" & _ "WHERE " & strDbTable & "Thread.Topic_ID = " & lngTopicID & " " 'If this isn't a moderator only display hidden posts if the user posted them If blnModerator = false AND blnAdmin = false Then strSQLFromWhere = strSQLFromWhere & "AND (" & strDbTable & "Thread.Hide = " & strDBFalse & " " 'Don't display hidden posts if guest If intGroupID <> 2 Then strSQLFromWhere = strSQLFromWhere & "OR " & strDbTable & "Thread.Author_ID = " & lngLoggedInUserID strSQLFromWhere = strSQLFromWhere & ") " End If 'Count the number of posts in this topic '*************************************** strSQL = "" & _ "SELECT Count(" & strDbTable & "Thread.Thread_ID) AS PostCount " & _ "FROM " & strDbTable & "Thread" & strDBNoLock & " " strSQL = strSQL & strSQLFromWhere & ";" 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occurred write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occurred while executing SQL query on database.", "post_count", "forum_posts.asp") 'Disable error trapping On Error goto 0 'Read in member count from database lngTotalRecords = CLng(rsCommon("PostCount")) 'Close recordset rsCommon.close 'Calculate what posts to get '*************************** 'Count the number of pages for the topics using '\' so that any fraction is omitted lngTotalRecordsPages = lngTotalRecords \ intThreadsPerPage 'If there is a remainder or the result is 0 then add 1 to the total num of pages If lngTotalRecords Mod intThreadsPerPage > 0 OR lngTotalRecordsPages = 0 Then lngTotalRecordsPages = lngTotalRecordsPages + 1 'Get the record poistion to display from 'If the page number to show from is higher than the last page number then the last page number is the highest page If (intRecordPositionPageNum > lngTotalRecordsPages) OR (Request.QueryString("get") = "last") Then 'Set the page position number to the highest page number intRecordPositionPageNum = lngTotalRecordsPages End If 'Jump straight to a post (eg. Get Post 35 (&PID=35#35)) '************************************************ 'If we need to jump straight to a particular post calculate which page to go to If lngGetPostID <> 0 AND lngTotalRecordsPages > 1 Then 'Count the number of posts before the post we want strSQL = "" & _ "SELECT Count(" & strDbTable & "Thread.Thread_ID) AS PrePostCount " &_ "FROM " & strDbTable & "Thread" & strDBNoLock & " " strSQL = strSQL & strSQLFromWhere & " " If strSortBy = "DESC" Then strSQL = strSQL &"AND " & strDbTable & "Thread.Thread_ID > " & lngGetPostID & ";" Else strSQL = strSQL &"AND " & strDbTable & "Thread.Thread_ID < " & lngGetPostID & ";" End If 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occurred write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occurred while executing SQL query on database.", "get_last_post_count", "forum_posts.asp") 'Disable error trapping On Error goto 0 'Read in member count from database lngPrePostCount = CLng(rsCommon("PrePostCount")) 'Close recordset rsCommon.close 'Calculate page number (use FIX to get the whole number) intRecordPositionPageNum = FIX(lngPrePostCount / intThreadsPerPage) + 1 End If 'Start position intStartPosition = ((intRecordPositionPageNum - 1) * intThreadsPerPage) 'Query to get Posts '****************** 'Intilise SQL query to get all the posts 'Use a LEFT JOIN for the Guest name as there may not be a Guest name and so we want to include null values strSQL = "" & _ "SELECT " 'If SQL server advanced paging If strDatabaseType = "SQLServer" AND blnSqlSvrAdvPaging Then strSQL = strSQL & " * " & _ "FROM (SELECT TOP " & intThreadsPerPage * intRecordPositionPageNum & " " End If 'SQL SELECT strSQL = strSQL & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message, " & strDbTable & "Thread.Message_date, " & strDbTable & "Thread.Show_signature, " & strDbTable & "Thread.IP_addr, " & strDbTable & "Thread.Hide, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Homepage, " & strDbTable & "Author.Location, " & strDbTable & "Author.No_of_posts, " & strDbTable & "Author.Join_date, " & strDbTable & "Author.Signature, " & strDbTable & "Author.Active, " & strDbTable & "Author.Avatar, " & strDbTable & "Author.Avatar_title, " & strDbTable & "Group.Name AS GroupName, " & strDbTable & "Group.Stars, " & strDbTable & "Group.Custom_stars, " & strDbTable & "GuestName.Name AS GuestName " 'If SQL Server advanced paging If strDatabaseType = "SQLServer" AND blnSqlSvrAdvPaging Then strSQL = strSQL & ", ROW_NUMBER() OVER (ORDER BY " & strDbTable & "Thread.Message_date " & strSortBy & ") AS RowNum " End If 'FROM Clause strSQL = strSQL & "FROM (" & strDbTable & "Group INNER JOIN (" & strDbTable & "Author INNER JOIN " & strDbTable & "Thread ON " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID) ON " & strDbTable & "Group.Group_ID = " & strDbTable & "Author.Group_ID) LEFT JOIN " & strDbTable & "GuestName ON " & strDbTable & "Thread.Thread_ID = " & strDbTable & "GuestName.Thread_ID " 'Get the FROM and WHERE cluases from earlier strSQL = strSQL & strSQLFromWhere 'If SQL Server advanced paging If strDatabaseType = "SQLServer" AND blnSqlSvrAdvPaging Then strSQL = strSQL & ") AS PagingQuery WHERE RowNum BETWEEN " & intStartPosition + 1 & " AND " & intStartPosition + intThreadsPerPage & " " 'Else Order by clause here Else strSQL = strSQL & "ORDER BY " & strDbTable & "Thread.Message_date " & strSortBy & " " End If 'mySQL limit operator If strDatabaseType = "mySQL" Then strSQL = strSQL & "LIMIT " & intStartPosition & ", " & intThreadsPerPage End If strSQL = strSQL & ";" 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occurred write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occurred while executing SQL query on database.", "get_topic_posts_data", "forum_posts.asp") 'Disable error trapping On Error goto 0 'If there is a topic in the database then get the post data If NOT rsCommon.EOF Then 'Read in the topic recordset into an array sarryPosts = rsCommon.GetRows() 'Clean up rsCommon.Close 'SQL Query Array Look Up table '0 = tblThread.Thread_ID, '1 = tblThread.Message, '2 = tblThread.Message_date, '3 = tblThread.Show_signature, '4 = tblThread.IP_addr, '5 = tblThread.Hide, '6 = tblAuthor.Author_ID, '7 = tblAuthor.Username, '8 = tblAuthor.Homepage, '9 = tblAuthor.Location, '10 = tblAuthor.No_of_posts, '11 = tblAuthor.Join_date, '12 = tblAuthor.Signature, '13 = tblAuthor.Active, '14 = tblAuthor.Avatar, '15 = tblAuthor.Avatar_title, '16 = tblGroup.Name, '17 = tblGroup.Stars, '18 = tblGroup.Custom_stars '19 = tblGuestName.Name 'If advanced paging then workout the end and start position differently If (strDatabaseType = "SQLServer" AND blnSqlSvrAdvPaging) OR strDatabaseType = "mySQL" Then 'End Position intEndPosition = Ubound(sarryPosts,2) + 1 'Get the start position intCurrentRecord = 0 'Else for slower paging for Access and SQL Server 2000 Else 'End Position intEndPosition = intStartPosition + intThreadsPerPage 'Get the start position intCurrentRecord = intStartPosition End If 'Get meta description strMetaDescription = Trim(removeHTML(sarryPosts(1,0), 100, true)) 'Get the author ID of the first post (this is used for checking if the topic is hidden) lngUserID = CLng(sarryPosts(6,0)) 'Else if no record is retuned we do not want to be displaying a foum title Else strSubject = "" rsCommon.Close End If 'Hidden Topic check (only display hidden tiopics to the admin/mods, or if the poster created the topic) If blnHideTopic AND blnModerator = false AND blnAdmin = false Then If lngUserID <> lngLoggedInUserID OR intGroupID = 2 Then strSubject = "" lngTotalRecords = 0 lngTotalRecordsPages = 0 End If End If 'If we have not yet checked for unread posts since last visit run it now If Session("dtmUnReadPostCheck") = "" Then Call UnreadPosts() 'Read in array if at application level ElseIf isArray(Application("sarryUnReadPosts" & strSessionID)) Then sarryUnReadPosts = Application("sarryUnReadPosts" & strSessionID) 'Read in the unread posts array ElseIf isArray(Session("sarryUnReadPosts")) Then sarryUnReadPosts = Session("sarryUnReadPosts") End If 'See if there are any unread posts in this topic If isArray(sarryUnReadPosts) Then For intUnReadForumPostsLoop = 0 to UBound(sarryUnReadPosts,2) 'If an unread post is found in this topic If CLng(sarryUnReadPosts(1,intUnReadForumPostsLoop)) = lngTopicID AND sarryUnReadPosts(3,intUnReadForumPostsLoop) = "1" Then 'Increament unread post count intUnReadPostCount = intUnReadPostCount + 1 'Get first unread post ID If lngFirstUnreadPostID = 0 Then lngFirstUnreadPostID = CLng(sarryUnReadPosts(0,intUnReadForumPostsLoop)) End If Next End If 'Page to link to for mutiple page (with querystrings if required) strLinkPage = "forum_posts.asp?TID=" & lngTopicID & "&" If Request.QueryString("KW") <> "" Then strLinkPage = strLinkPage & "KW=" & Server.URLEncode(Request.QueryString("KW")) & "&" If Request.QueryString("FID") <> "" Then strLinkPage = strLinkPage & "FID=" & intForumID & "&" If Request.QueryString("PR") <> "" Then strLinkPage = strLinkPage & "PR=" & CInt(Request.QueryString("PR")) & "&" strLinkPageTitle = SeoUrlTitle(strSubject, "&title=") 'If active users is enabled update the active users application array If blnActiveUsers Then 'If there are keywords this is a search If Request.QueryString("KW") <> "" Then 'Call active users function saryActiveUsers = activeUsers(strTxtViewingTopic & " " & strTxtSearchResults, strSubject, strLinkPage & "PN=" & intRecordPositionPageNum & SeoUrlTitle(strSubject, "&title="), intForumID) 'Else normal topic Else 'Call active users function saryActiveUsers = activeUsers(strTxtViewingTopic, strSubject, strLinkPage & "PN=" & intRecordPositionPageNum & SeoUrlTitle(strSubject, "&title="), intForumID) End If End If 'Get the session key strFormID = getSessionItem("KEY") 'If URL Rewriting is enabled create the canonical to the page for improved SEO If NOT Request.ServerVariables("HTTP_X_ORIGINAL_URL") = "" OR (NOT Request.ServerVariables("HTTP_X_REWRITE_URL") = "" AND InStr(Request.ServerVariables("HTTP_X_REWRITE_URL"), "&title=") = 0) Then If intRecordPositionPageNum = 1 Then strCanonicalURL = "" Else strCanonicalURL = "" End If 'Else canonical without URL rewriting Else If intRecordPositionPageNum = 1 Then strCanonicalURL = "" Else strCanonicalURL = "" End If End If 'Set bread crumb trail 'Display the category name strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & "" & strCatName & "" & strNavSpacer 'Display if there is a main forum to the sub forums name If intMasterForumID <> 0 Then strBreadCrumbTrail = strBreadCrumbTrail & "" & strMasterForumName & "" & strNavSpacer 'Display forum name If strForumName = "" Then strBreadCrumbTrail = strBreadCrumbTrail & strTxtNoForums Else strBreadCrumbTrail = strBreadCrumbTrail & "" & strForumName & "" 'Set the status bar tools 'Active Topics Links strStatusBarTools = strStatusBarTools & "   " & strTxtActiveTopics & "" 'If RSS XML enabled then display an RSS button to link to XML file If blnRSS AND (isNull(strForumPassword) OR strForumPassword = "") Then strStatusBarTools = strStatusBarTools & " " 'Write the HTML head of the page %> <% = strSubject & " - " & strMainForumName %><% If lngTotalRecordsPages > 1 Then Response.Write(" - " & strTxtPage & " " & intRecordPositionPageNum) %> <% 'No index if no post is availble If lngTotalRecords = 0 Then Response.Write(vbCrLf & "") 'Dynamic meta tags If blnDynamicMetaTags AND lngTotalRecords > 0 Then %> <% End If 'Display Canonical URL Meta tag If NOT strCanonicalURL = "" Then Response.Write(vbCrLf & strCanonicalURL) '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Response.Write(vbCrLf & vbCrLf & "" & vbCrLf) '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'If RSS Feed is enabled then have an alt link to the XML file for supporting browsers 'Only display if the last post was less than xx weeks ago, to reduce the amount of consumed bandwidth If blnRSS AND (isNull(strForumPassword) OR strForumPassword = "") Then Response.Write(vbCrLf & "") 'Display javascript for form checking If blnActiveMember AND blnForumLocked = false AND blnReply AND (intRecordPositionPageNum = lngTotalRecordsPages) Then %> <% End If %>

    <% 'If the forum is locked show a locked pad lock icon If blnForumLocked Then Response.Write ("") 'If the topic is locked then have a locked icon ElseIf blnTopicLocked Then Response.Write ("") End If 'If a calendar event then display so If isDate(dtmEventDate) Then Response.Write(strSubject & " - " & strTxtEventDate & ": " & stdDateFormat(dtmEventDate, False)) 'If over multiple dates If isDate(dtmEventDateEnd) Then Response.Write(" - " & stdDateFormat(dtmEventDateEnd, False)) Else Response.Write(strSubject) End If %>

     <% = strTxtPostReply %> <% = strTxtPostReply %>
    <% 'If there is a poll then display the poll include If lngPollID > 0 Then %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2010 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** 'Declare variables Dim strPollQuestion 'Holds the poll question Dim intPollChoiceNumber 'Holds the poll choice number Dim strPollChoice 'Holds the poll choice Dim lngPollChoiceVotes 'Holds the choice number of votes Dim lngTotalPollVotes 'Holds the total number of votes Dim dblPollVotePercentage 'Holds the vote percentage for the vote choice Dim blnAlreadyVoted 'Set to true if the user has already voted Dim blnMultipleVotes 'set to true if multiple votes are allowed Dim sarryPoll 'Array to hold the poll recordset Dim intPollCurrentRecord 'Hold the current postion in array 'Initlise variables blnAlreadyVoted = False intPollCurrentRecord = 0 'Get the poll from the database 'Initalise the strSQL variable with an SQL statement to query the database get the thread details strSQL = "SELECT " & strDbTable & "Poll.Poll_question, " & strDbTable & "Poll.Multiple_votes, " & strDbTable & "Poll.Reply, " & strDbTable & "PollChoice.Choice_ID, " & strDbTable & "PollChoice.Choice, " & strDbTable & "PollChoice.Votes " & _ "FROM " & strDbTable & "Poll" & strDBNoLock & ", " & strDbTable & "PollChoice" & strDBNoLock & " " & _ "WHERE " & strDbTable & "Poll.Poll_ID=" & strDbTable & "PollChoice.Poll_ID " & _ "AND " & strDbTable & "Poll.Poll_ID=" & lngPollID & ";" 'Query the database rsCommon.Open strSQL, adoCon 'If no record release rs If rsCommon.EOF Then 'Close recordsets rsCommon.Close 'If there is a poll then display it Else 'Read in the row from the db using getrows for better performance sarryPoll = rsCommon.GetRows() 'Close recordsets rsCommon.Close 'Initilise total votes lngTotalPollVotes = 0 'Read in the poll question strPollQuestion = sarryPoll(0,0) 'See if multiple votes are allowed blnMultipleVotes = CBool(sarryPoll(1,0)) 'See if this is a poll only blnPollNoReply = CBool(sarryPoll(2,0)) 'Loop through and get the total number of votes Do While intPollCurrentRecord < (UBound(sarryPoll,2) + 1) 'Get the total number of votes lngTotalPollVotes = lngTotalPollVotes + CLng(sarryPoll(5,intPollCurrentRecord)) 'Move to the next array position intPollCurrentRecord = intPollCurrentRecord + 1 Loop 'Reset array position intPollCurrentRecord = 0 'If multiple votes are not allowed see if the user has voted before If blnMultipleVotes = False Then 'Check the user has not already voted by reading in a cookie from there system 'Read in the Poll ID number of the last poll the user has voted in If CInt(getCookie("pID", "PID" & lngPollID)) = lngPollID OR CInt(getSessionItem("PID" & lngPollID)) = lngPollID Then blnAlreadyVoted = True End If %>
    <% 'Display the vote choice slection column if the user CAN vote in this poll If blnVote = True AND blnForumLocked = False AND blnTopicLocked = False AND blnActiveMember = True AND blnAlreadyVoted = False Then %> <% End If %> <% 'Loop through the Poll Choices 'Do....While Loop to loop through the recorset to display the Poll Choices Do While intPollCurrentRecord < (UBound(sarryPoll,2) + 1) 'Read in the poll details intPollChoiceNumber = Cint(sarryPoll(3,intPollCurrentRecord)) strPollChoice = sarryPoll(4,intPollCurrentRecord) lngPollChoiceVotes = CLng(sarryPoll(5,intPollCurrentRecord)) 'If there are no votes yet then format the percent by 0 otherwise an overflow error will happen If lngTotalPollVotes = 0 Then dblPollVotePercentage = FormatPercent(0, 2) 'Else read in the the percentage of votes cast for the vote choice Else dblPollVotePercentage = FormatPercent((lngPollChoiceVotes / lngTotalPollVotes), 2) End If %> ") Else Response.Write("class=""oddTableRow"">") 'Display the vote radio buttons if the user CAN vote in this poll If blnVote AND blnForumLocked = False AND blnTopicLocked = False AND blnActiveMember AND blnAlreadyVoted = False Then %> <% End If %> <% 'Move to the next record intPollCurrentRecord = intPollCurrentRecord + 1 Loop %>
    <% = strTxtPollQuestion %>: <% = strPollQuestion %>
    <% = strTxtVote %><% = strTxtPollChoice %> <% = strTxtVotes %> <% = strTxtPollStatistics %>
    <% = lngPollChoiceVotes %> " height="11" align="middle"> [<% = dblPollVotePercentage %>]
    <% 'Display either text msg if the user can NOT vote or a button if they can 'If the forum is locked display a locked forum meesage If blnForumLocked = True OR blnTopicLocked = True Then Response.Write(strTxtThisTopicIsClosedNoNewVotesAccepted) 'Else the user can not vote or they are not an active member of the forum ElseIf blnActiveMember = False OR blnVote = False OR blnBanned Then Response.Write(strsTxYouCanNotNotVoteInThisPoll) 'Else the user has already voted in this poll and multiple votes are not permitted ElseIf blnAlreadyVoted = True Then Response.Write(strTxtYouHaveAlreadyVotedInThisPoll) 'Else display vote button Else %> <% End If %>

    <% End If 'Display a msg letting the user know if there vote has been cast or not Select Case Request.QueryString("RN") Case "1" Response.Write("") Case "2" Response.Write("") Case "3" Response.Write("") End Select %><% End If 'If there are posts display them If lngTotalRecords > 0 Then %> <% 'Calculate the post number intThreadNo = (intRecordPositionPageNum - 1) * intThreadsPerPage 'Do....While Loop to loop through the recorset to display the topic posts Do While intCurrentRecord < intEndPosition 'If there are no post records left to display then exit loop If intCurrentRecord >= lngTotalRecords Then Exit Do 'Calculate the thread number intThreadNo = intThreadNo + 1 'Initliase the unread post variable blnUnreadPost = False 'SQL Query Array Look Up table '0 = tblThread.Thread_ID, '1 = tblThread.Message, '2 = tblThread.Message_date, '3 = tblThread.Show_signature, '4 = tblThread.IP_addr, '5 = tblThread.Hide, '6 = tblAuthor.Author_ID, '7 = tblAuthor.Username, '8 = tblAuthor.Homepage, '9 = tblAuthor.Location, '10 = tblAuthor.No_of_posts, '11 = tblAuthor.Join_date, '12 = tblAuthor.Signature, '13 = tblAuthor.Active, '14 = tblAuthor.Avatar, '15 = tblAuthor.Avatar_title, '16 = tblGroup.Name, '17 = tblGroup.Stars, '18 = tblGroup.Custom_stars '19 = tblGuestName.Name 'Read in threads details for the topic from the database lngMessageID = CLng(sarryPosts(0,intCurrentRecord)) strMessage = sarryPosts(1,intCurrentRecord) dtmPostDate = CDate(sarryPosts(2,intCurrentRecord)) strAuthorIP = sarryPosts(4,intCurrentRecord) blnHidePost = CBool(sarryPosts(5,intCurrentRecord)) lngUserID = CLng(sarryPosts(6,intCurrentRecord)) strUsername = sarryPosts(7,intCurrentRecord) strAuthorHomepage = sarryPosts(8,intCurrentRecord) strAuthorLocation = sarryPosts(9,intCurrentRecord) lngAuthorNumOfPosts = CLng(sarryPosts(10,intCurrentRecord)) dtmAuthorRegistration = CDate(sarryPosts(11,intCurrentRecord)) strAuthorSignature = sarryPosts(12,intCurrentRecord) strAuthorAvatar = sarryPosts(14,intCurrentRecord) strMemberTitle = sarryPosts(15,intCurrentRecord) strGroupName = sarryPosts(16,intCurrentRecord) intRankStars = CInt(sarryPosts(17,intCurrentRecord)) strRankCustomStars = sarryPosts(18,intCurrentRecord) strGuestUsername = sarryPosts(19,intCurrentRecord) 'If there is a newer post than the last time the unread posts array was initilised run it again If dtmPostDate > CDate(Session("dtmUnReadPostCheck")) Then Call UnreadPosts() 'Mark if this post has been read, if the unread posts array exists If isArray(sarryUnReadPosts) AND dtmPostDate > dtmLastVisitDate Then 'Loop through the unread posts array For intUnReadForumPostsLoop = 0 to UBound(sarryUnReadPosts,2) 'Mark the post as read If CLng(sarryUnReadPosts(0,intUnReadForumPostsLoop)) = lngMessageID Then If sarryUnReadPosts(3,intUnReadForumPostsLoop) = "1" Then blnUnreadPost = True 'mark post as read sarryUnReadPosts(3,intUnReadForumPostsLoop) = "0" 'save back to session 'Save the array at applicion level If isArray(Application("sarryUnReadPosts" & strSessionID)) Then Application.Lock Application("sarryUnReadPosts" & strSessionID) = sarryUnReadPosts Application.UnLock 'save the array at session level ElseIf isArray(Session("sarryUnReadPosts")) Then Session("sarryUnReadPosts") = sarryUnReadPosts End If 'Exit for to save some processing time Exit For End If Next End If 'Calculate the row colour If intCurrentRecord MOD 2 = 0 Then strPostTableRowClass = "msgEvenTableRow" strPostTableSideClass = "msgEvenTableSide" strPostTableTopClass = "msgEvenTableTop" Else strPostTableRowClass = "msgOddTableRow" strPostTableSideClass = "msgOddTableSide" strPostTableTopClass = "msgOddTableTop" End If 'If this is a hidden post then change the row colour to highlight it If blnHidePost Then strPostTableRowClass = "msgHiddenTableRow" 'If the poster is a guest see if they have entered their name in the GuestName table and get it If lngUserID = 2 AND strGuestUsername <> "" Then strUsername = strGuestUsername 'If the post contains a quote or code block then format it If InStr(1, strMessage, "[QUOTE=", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 Then strMessage = formatUserQuote(strMessage) If InStr(1, strMessage, "[QUOTE]", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 Then strMessage = formatQuote(strMessage) If InStr(1, strMessage, "[CODE]", 1) > 0 AND InStr(1, strMessage, "[/CODE]", 1) > 0 Then strMessage = formatCode(strMessage) 'If the Post or signature contains Flash or YouTube BBcodes then display them If blnFlashFiles Then 'Flash If InStr(1, strMessage, "[FLASH", 1) > 0 AND InStr(1, strMessage, "[/FLASH]", 1) > 0 Then strMessage = formatFlash(strMessage) If InStr(1, strAuthorSignature, "[FLASH", 1) > 0 AND InStr(1, strAuthorSignature, "[/FLASH]", 1) > 0 Then strAuthorSignature = formatFlash(strAuthorSignature) 'YouTube If InStr(1, strMessage, "[TUBE]", 1) > 0 AND InStr(1, strMessage, "[/TUBE]", 1) > 0 Then strMessage = formatYouTube(strMessage) If InStr(1, strAuthorSignature, "[TUBE]", 1) > 0 AND InStr(1, strAuthorSignature, "[/TUBE]", 1) > 0 Then strMessage = formatYouTube(strAuthorSignature) End If 'If the message has been edited parse the 'edited by' XML into HTML for the post If InStr(1, strMessage, "", 1) Then strMessage = editedXMLParser(strMessage) 'Call the function to highlight search words if coming froma search page If strSearchKeywords <> "" Then strMessage = searchHighlighter(strMessage, sarySearchWord) 'Calulate rowspan amount for table below side bar If CBool(sarryPosts(3,intCurrentRecord)) AND strAuthorSignature <> "" Then intPostRowsSpan = 3 Else intPostRowsSpan = 2 End If %> " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " <% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If intCurrentRecord = 0 AND (strInstallID = "Adware" OR strMyGoogleAdSenseID <> "pub-9026955576675812") Then strPostTableRowClass = "msgEvenTableRow" strPostTableSideClass = "msgEvenTableSide" strPostTableTopClass = "msgEvenTableTop" %> <% End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %> <% 'Move to the next record intCurrentRecord = intCurrentRecord + 1 Loop %>
    <% = strTxtAuthor %>
    <% = strTxtMessage %><% If strSortBy = "DESC" Then Response.Write(" ") %><% 'Display link to first unread post If intUnReadPostCount > 0 Then Response.Write(" / " & strTxtViewUnreadPost & "") End If %>
    <% 'Share Topic Drop Down Response.Write("   " & strTxtShareTopic & "" & _ "
    ") Response.Write("
    " & strTxtPrintVersion & "
    ") 'Email Topic Option If intGroupID <> 2 AND blnEmail AND blnActiveMember Then Response.Write("
    " & strTxtEmailTopic & "
    ") 'Social Bookmark links Response.Write(_ "
    Delicious
    " & _ "
    Digg
    " & _ "
    Facebook
    " & _ "
    Furl
    " & _ "
    Google Boomarks
    " & _ "
    Google Buzz
    " & _ "
    MySpace
    " & _ "
    Newsvine
    " & _ "
    reddit
    " & _ "
    StumbleUpon
    " & _ "
    " & strTxtTranslate & "
    " & _ "
    Twitter
    " & _ "
    Windows Live
    " & _ "
    Yahoo Bookmarks
    " & _ "
    ") 'Topic Search Link Response.Write ("   " & strTxtTopic & " " & strTxtSearch & "") 'Modertor Tools If blnAdmin OR blnModerator Then 'Moderator tools drop down Response.Write("   " & strTxtModeratorTools & "" & _ "
    " & _ "
    " & strTxtHiddenTopics & "
    " & _ "
    " & strTxtTopicAdmin & "
    ") 'Lock or un-lock forum if admin If blnTopicLocked Then Response.Write("
    " & strTxtUnLockTopic & "
    ") Else Response.Write("
    " & strTxtLockTopic & "
    ") End If 'Hide or show topic If blnHideTopic = false Then Response.Write("
    " & strTxtHideTopic & "
    ") Else Response.Write("
    " & strTxtShowTopic & "
    ") End If Response.Write("
    " & strTxtDeleteTopic & "
    ") Response.Write("
    ") End If 'Topic Options drop down Response.Write("   2 AND blnEmail AND blnLoggedInUserEmail AND blnActiveMember Then Response.Write("getAjaxData('ajax_email_notify.asp?TID=" & lngTopicID & "&PN=" & intRecordPositionPageNum & strQsSID2 & "', 'ajaxEmailSub');") Response.Write("showDropDown('topicOptions', 'optionsMenu', 122, 26);"" class=""dropDownPointer""> " & strTxtTopicOptions & "" & _ "
    " & _ "
    " & strTxtPostReply & "
    " & _ "
    " & strTxtCreateNewTopic & "
    ") If blnPollCreate Then Response.Write("
    " & strTxtCreateNewPoll & "
    ") 'Display option to subscribe or un-subscribe to topic If intGroupID <> 2 AND blnEmail AND blnLoggedInUserEmail AND blnActiveMember Then Response.Write("") %>
    <% = strUsername %> <% = strTxtViewDropDown %>
    <% = strGroupName %>
    " alt="<% = strGroupName %>" title="<% = strGroupName %>" />
    <% 'If the user has an avatar then display it If blnAvatar = True AND strAuthorAvatar <> "" Then Response.Write("") 'If there is a title for this member then display it If strMemberTitle <> "" Then Response.Write(vbCrLf & "
    " & strMemberTitle) 'If not a guest post then display some details If lngUserID <> 2 Then 'Show the joined date Response.Write(vbCrLf & "

    " & strTxtJoined & ": " & DateFormat(dtmAuthorRegistration)) 'If the is a location display it If strAuthorLocation <> "" Then Response.Write(vbCrLf & "
    " & strTxtLocation & ": " & strAuthorLocation) 'If active users is enabled see if the user is online If blnActiveUsers Then 'Display if the user is online blnIsUserOnline = False 'Loop through the active users array For intLoop = 1 To UBound(saryActiveUsers, 2) If saryActiveUsers(1, intLoop) = lngUserID Then blnIsUserOnline = True Next 'Display if the user is online If blnIsUserOnline Then Response.Write(vbCrLf & "
    " & strTxtOnlineStatus & ": " & strTxtOnLine2) Else Response.Write(vbCrLf & "
    " & strTxtOnlineStatus & ": " & strTxtOffLine) End If 'Display the num of posts Response.Write(vbCrLf & "
    " & strTxtPosts & ": " & lngAuthorNumOfPosts) End If %>
    <% 'Disply post options if there are any for this user If (blnTopicLocked = False) OR (blnAdmin OR blnModerator) Then Response.Write(vbCrLf & " ") 'If post is hidden display approved post option If blnHidePost AND (blnAdmin OR blnModerator) Then Response.Write(vbCrLf & " " & strTxtApprovePost & "  ") 'Moderator tools drop down Response.Write(vbCrLf & " " & strTxtPostOptions & "" & _ vbCrLf & "
    ") 'If the topic is not locked put in a link for someone to quote this message If blnTopicLocked = False AND blnPollNoReply = False AND blnHidePost = False Then Response.Write(vbCrLf & "
    " & strTxtPostReply & "
    " & _ vbCrLf & "
    " & strTxtQuote & " " & strUsername & "
    ") End If 'Display the report post feature if email is enabled. If blnEmail AND lngUserID <> lngLoggedInUserID AND blnActiveMember Then Response.Write(vbCrLf & "
    " & strTxtReportPost & "
    ") 'If the logged in user is the person who posted the message or the forum administrator/moderator then allow them to edit or delete the message If (lngLoggedInUserID = lngUserID AND blnForumLocked = False AND blnActiveMember AND blnTopicLocked = False) OR (blnAdmin OR blnModerator) Then 'Only let the user edit the post if they have edit rights If blnEdit OR blnAdmin Then Response.Write(vbCrLf & "
    " & strTxtEditPost & "
    ") End If 'Only let a normal user delete there post if someone hasn't posted a reply If (lngTotalRecords = intThreadNo) OR (blnAdmin OR blnModerator) Then 'Only let the user delete the post if they have delete rights If blnDelete OR blnAdmin Then Response.Write(vbCrLf & "
    " & strTxtDeletePost & "
    ") End If End If End If 'If the user is the forum admin or a moderator If blnAdmin OR blnModerator Then 'Let them hide the post If blnHidePost Then Response.Write(vbCrLf & "
    " & strTxtApprovePost & "
    ") Else Response.Write(vbCrLf & "
    " & strTxtHidePost & "
    ") End If 'Let them move the post to another forum Response.Write(vbCrLf & "
    " & strTxtMovePost & "
    ") 'Display the IP address for IP blocking to admin/moderators If strAuthorIP <> "" Then Response.Write(vbCrLf & "
    " & strTxtBlockUsersIP & "
    ") End If Response.Write(vbCrLf & "
    ") 'If the topic is not locked put in a link for someone to quote this message If blnTopicLocked = False AND blnPollNoReply = False AND blnHidePost = False Then Response.Write(vbCrLf & "    " & strTxtQuote & "  " & _ "" & strTxtReply & "") End If Response.Write(vbCrLf & "
    ") End If 'If unread post display an un-read post icon next to the post If blnUnreadPost Then Response.Write(vbCrLf & " ") 'Else display a bullet incon with direct link to post Else 'Display direct link to post Response.Write(vbCrLf & " ") End If 'If first record display topic title If intCurrentRecord = 0 Then Response.Write("") 'If a calendar event then display so If isDate(dtmEventDate) Then Response.Write(strTxtCalendarEvent & ": ") Else Response.Write(strTxtTopic & ": ") Response.Write(strSubject & "
        ") End If 'Display message post date and time Response.Write(strTxtPosted & " " & DateFormat(dtmPostDate) & " " & strTxtAt & " " & TimeFormat(dtmPostDate)) 'Display IP if admin or moderator If blnAdmin OR blnModerator Then Response.Write(" - " & strTxtIP & ": " & strAuthorIP) %>
    <% = strMessage %>
    <% 'If the user wants there signature the display it If CBool(sarryPosts(3,intCurrentRecord)) AND strAuthorSignature <> "" Then Response.Write(vbCrLf & "
    " & _ formatSignature(strAuthorSignature)) End If %>
    <% = strTxtBackToTop %>
    <% = strTxtSponsor %>
    <% If strInstallID = "Adware" Then Response.Write(strSponsor2) ElseIf strMyGoogleAdSenseID <> "pub-9026955576675812" Then Response.Write(strAdSenseCodePost) End If %>

    <% = strTxtBackToTop %>
    <% 'Else display there are no posts to display so display error message Else %>
    <% = strTxtError %> <% = strTxtError %>
    <% = strTxtNoThreads %>
    <% End If %>
     <% = strTxtPostReply %> <% = strTxtPostReply %> <% 'Display table for email and/or page links If lngTotalRecordsPages > 1 Then %><% End If %>
    <% 'Quick Reply !!!! If blnBannedIP = false AND blnActiveMember AND blnBanned = False AND blnForumLocked = false AND blnReply AND blnTopicLocked = false AND blnPollNoReply = false AND intRecordPositionPageNum = lngTotalRecordsPages Then 'Check to see if the user has email notification for this topic If blnEmail AND blnLoggedInUserEmail Then strSQL = "SELECT " & strDbTable & "EmailNotify.Author_ID " & _ "FROM " & strDbTable & "EmailNotify" & strRowLock & " " & _ "WHERE " & strDbTable & "EmailNotify.Author_ID = " & lngLoggedInUserID & " AND " & strDbTable & "EmailNotify.Topic_ID = " & lngTopicID & ";" 'Query the database rsCommon.Open strSQL, adoCon 'If a record is returned then users has email notification enabled If NOT rsCommon.EOF Then blnReplyNotify = True 'Close RS rsCommon.Close End If %><% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2010 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** Response.Write("
    " & _ vbCrLf & "
    " & _ vbCrLf & "" & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & "
    " & strTxtQuickReply& "
    " & _ vbCrLf & " ") 'If the poster is in a guest then get them to enter a name If lngLoggedInUserID = 2 AND (strMode <> "edit" AND strMode <> "editTopic" AND strMode <> "editPoll") Then Response.Write(vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " ") End If 'The message textarea Response.Write(vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " ") 'If signature of e-mail notify then display row to show If (blnLoggedInUserEmail = True AND blnEmail = True) OR blnLoggedInUserSignature = True Then Response.Write(vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " ") End If 'Display CAPTCHA images for Guest posting If blnGuestPostingCAPTCHA AND lngLoggedInUserID = 2 Then %> <% End If Response.Write(vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & "
    " & strTxtName & ":" & _ vbCrLf & " " & _ vbCrLf & "

    " & strTxtMessage & ":" & _ vbCrLf & "
    ") '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Response.Write(vbCrLf & vbCrLf & "") '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'Name of the HTML form the textarea is within Const strFormName = "frmMessageForm" 'ID tag name of HTML textarea being replaced Const strTextAreaName = "message" 'Load default CSS and Javascript Response.Write(vbCrLf & vbCrLf & " ") 'Javascript function to switch to full reply screen Response.Write(vbCrLf & " ") 'If this is an RTE enabled web browser load in the RTE content If RTEenabled() <> "false" AND blnRTEEditor AND blnWYSIWYGEditor Then 'Load in Javascript for RTE browsers Response.Write(vbCrLf & " ") 'Create IFrame with message for those with javascript disabled Response.Write(vbCrLf & " " & _ vbCrLf & " ") 'Create hidden inputs Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") 'If this is not an RTE enabled web browser load in the NON-RTE content Else 'Load in Javascript for non-RTE browsers Response.Write(vbCrLf & " ") 'Create Toolbar and Iframes Response.Write(vbCrLf & " ") 'Create the text area Response.Write(vbCrLf & " ") End If '******************************************************************** Response.Write(vbCrLf & "
      " & strTxtEnable & " " & strTxtForumCodes & " " & strTxtToFormatPosts & _ vbCrLf & "
     ") 'If the user has a signature offer them the chance to show it If blnLoggedInUserSignature Then Response.Write(vbCrLf & "  " & strTxtShowSignature & " ") End If 'Display e-mail notify of replies option If blnEmail AND blnLoggedInUserEmail Then Response.Write(vbCrLf & "  " & strTxtEmailNotify & " ") End If Response.Write(vbCrLf & "
    <% = strTxtUniqueSecurityCode %>: <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz CAPTCHA '** http://www.webwizCAPTCHA.com '** '** Copyright 2005-2008 Web Wiz(TM). All rights reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Response.Write(vbCrLf & vbCrLf & "") '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %> <% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If blnCAPTCHAabout Then Response.Write("") End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %>
    Code Image - Please contact webmaster if you have problems seeing this image code <% = strTxtLoadNewCode %>
    CAPTCHA Software by Web Wiz CAPTCHA version " & strCAPTCHAversion & "
    Copyright ©2005-2008 Web Wiz
    <% = strTxtEnterCAPTCHAcode %>
    ") Response.Write(vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & "
    " & _ vbCrLf & " " & _ vbCrLf & "
    ") Response.Write(vbCrLf & " "false" AND blnRTEEditor AND blnWYSIWYGEditor Then Response.Write("onclick=""document.getElementById('message').value=document.getElementById('WebWizRTE').contentWindow.document.body.innerHTML;""") End If Response.Write(" tabindex=""6"" />") Response.Write(vbCrLf & " "false" AND blnRTEEditor AND blnWYSIWYGEditor Then Response.Write("document.getElementById('pre').value=document.getElementById('WebWizRTE').contentWindow.document.body.innerHTML;") Else Response.Write("document.getElementById('pre').value=document.getElementById('message').value;") End If Response.Write(" OpenPreviewWindow(document.frmMessageForm);"" tabindex=""7"" />" & _ vbCrLf & " " & _ vbCrLf & "
    " & _ vbCrLf & "
    " & _ vbCrLf & "
    ") %><% End If %>

    <% 'Clear server objects Call closeDatabase() '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If blnLCode = True Then If blnTextLinks = True Then Response.Write("Bulletin Board Software by Web Wiz Forums® version " & strVersion & "") If blnACode Then Response.Write(" [Free Express Edition]") Else Response.Write("") If blnACode Then Response.Write("
    Powered by Web Wiz Forums Free Express Edition") End If Response.Write("
    Copyright ©2001-2010 Web Wiz") End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'Display the process time If blnShowProcessTime Then Response.Write("

    " & strTxtThisPageWasGeneratedIn & " " & FormatNumber(Timer() - dblStartTime, 3) & " " & strTxtSeconds & "
    ") Response.Write("
    ") 'Display an alert message if the user is watching this topic for email notification If Request.QueryString("EN") = "TS" Then Response.Write("") End If 'Display an alert message if the user is not watching this topic for email notification If Request.QueryString("EN") = "TU" Then Response.Write("") End If 'Display an alert message if the user is posting in a moderated forum If Request.QueryString("MF") = "Y" Then Response.Write("") End If %>