<% ' Our include files. A trimmer version of adovbs.inc and our config file. %> <% ' GLOBAL VAR!!! Dim cnnForumDC ' Our Data Connection used throughout '== BEGIN PROCESSOR ============================================================ ' This is the processing controller for all pages! Sub ProcessForumPage(bOpenConnection) ' Speed timer for testing - see bottom of function as well 'Dim PageSpeedTimer 'PageSpeedTimer = Timer() ' Show the pre-forum HTML Call ShowHeader ' If a Data Connection is requested then provide one If bOpenConnection Then Set cnnForumDC = Server.CreateObject("ADODB.Connection") cnnForumDC.CommandTimeout = 30 cnnForumDC.ConnectionTimeout = 20 cnnForumDC.Open DB_CONNECTIONSTRING, DB_USERNAME, DB_PASSWORD End If Call Main ' If a Data Connection was used then tear it down If bOpenConnection Then cnnForumDC.Close Set cnnForumDC = Nothing End If ' Show the post-forum HTML Call ShowFooter ' Speed timer for testing - see top of function as well 'Response.Write "

" & Response.Buffer & "
" 'Response.Write Timer() - PageSpeedTimer If Response.Buffer Then Response.Flush End Sub '== END PROCESSOR ============================================================== '== BEGIN UTILITIES ============================================================ Sub WriteLine(strText) Response.Write strText & vbCrLf End Sub Function Lineify(strInput) Dim strTemp strTemp = Server.HTMLEncode(strInput) strTemp = Replace(strTemp, " ", "       ", 1, -1, 1) strTemp = Replace(strTemp, " ", "      ", 1, -1, 1) strTemp = Replace(strTemp, " ", "     ", 1, -1, 1) strTemp = Replace(strTemp, " ", "    ", 1, -1, 1) strTemp = Replace(strTemp, " ", "   ", 1, -1, 1) strTemp = Replace(strTemp, vbTab, "     ", 1, -1, 1) strTemp = Replace(strTemp, vbCrLf, "
" & vbCrLf, 1, -1, 1) Lineify = strTemp End Function Function FormatTimestampDB(dTimestampToFormat) ' Formats to "m/d/yyyy h:mm:ss AM" format ' Change as appropriate to match your DB Dim strMonth, strDay, strYear Dim strHour, strMinute, strSecond Dim strAMPM strMonth = Month(dTimestampToFormat) strDay = Day(dTimestampToFormat) strYear = Year(dTimestampToFormat) 'strYear = Right(Year(dTimestampToFormat), 2) strHour = Hour(dTimestampToFormat) Mod 12 If strHour = 0 Then strHour = 12 If Hour(dTimestampToFormat) < 12 Then strAMPM = "AM" Else strAMPM = "PM" End If strMinute = Minute(dTimestampToFormat) If Len(strMinute) = 1 Then strMinute = "0" & strMinute strSecond = Second(dTimestampToFormat) If Len(strSecond) = 1 Then strSecond = "0" & strSecond ' "d/m/yyyy h:mm:ss AM" for all those who have had problems. 'FormatTimestampDB = strDay & "/" & strMonth & "/" & strYear & " " & strHour & ":" & strMinute & ":" & strSecond & " " & strAMPM FormatTimestampDB = strMonth & "/" & strDay & "/" & strYear & " " & strHour & ":" & strMinute & ":" & strSecond & " " & strAMPM End Function Function FormatTimestampDisplay(dTimestampToFormat) ' Formats to "m/d/yyyy h:mm:ss AM" format ' Change as appropriate to match your display wishes Dim strMonth, strDay, strYear Dim strHour, strMinute, strSecond Dim strAMPM strMonth = Month(dTimestampToFormat) strDay = Day(dTimestampToFormat) strYear = Year(dTimestampToFormat) 'strYear = Right(Year(dTimestampToFormat), 2) strHour = Hour(dTimestampToFormat) Mod 12 If strHour = 0 Then strHour = 12 If Hour(dTimestampToFormat) < 12 Then strAMPM = "AM" Else strAMPM = "PM" End If strMinute = Minute(dTimestampToFormat) If Len(strMinute) = 1 Then strMinute = "0" & strMinute strSecond = Second(dTimestampToFormat) If Len(strSecond) = 1 Then strSecond = "0" & strSecond ' "d/m/yyyy h:mm:ss AM" for all those who have had problems. 'FormatTimestampDB = strDay & "/" & strMonth & "/" & strYear & " " & strHour & ":" & strMinute & ":" & strSecond & " " & strAMPM FormatTimestampDisplay = strMonth & "/" & strDay & "/" & strYear & " " & strHour & ":" & strMinute & ":" & strSecond & " " & strAMPM End Function '== END UTILITIES ============================================================== '== BEGIN DATABASE ============================================================= Function GetRecordset(sRSSource) Dim objRSGetRecordset Set objRSGetRecordset = Server.CreateObject("ADODB.RecordSet") objRSGetRecordset.Open sRSSource, cnnForumDC, adOpenStatic, adLockReadOnly Set GetRecordset = objRSGetRecordset 'objRSGetRecordset.Close Set objRSGetRecordset = Nothing End Function '== END DATABASE =============================================================== '== BEGIN DISPLAY ============================================================== Sub ShowForumLine(iId, sFolderStatus, sName, sDescription, iMessageCount) Dim strOutput strOutput = "" strOutput = strOutput & " " strOutput = strOutput & "" & sName & "" strOutput = strOutput & " -- " strOutput = strOutput & sDescription If iMessageCount <> 0 Then strOutput = strOutput & " (" strOutput = strOutput & iMessageCount strOutput = strOutput & " messages)" End If WriteLine strOutput & "
" End Sub Sub ShowPeriodLine(iForumId, strPeriodType, iPeriodsAgo, iMessageCount) Dim strOutput strOutput = strOutput & "" strOutput = strOutput & "" If strPeriodType = "7days" Then Select Case iPeriodsAgo Case 0 strOutput = strOutput & "Last 7 Days" Case 1 strOutput = strOutput & "8 to 14 Days Ago" Case 2 strOutput = strOutput & "15 to 21 Days Ago" Case Else strOutput = strOutput & "" & MonthName(Month(DateAdd("m", -(iPeriodsAgo - 3), Date()))) & "'s Posts" End Select Else strOutput = strOutput & "" & MonthName(Month(DateAdd("m", -iPeriodsAgo, Date()))) & "'s Posts" End If If iMessageCount <> 0 Then strOutput = strOutput & " (" strOutput = strOutput & iMessageCount strOutput = strOutput & " messages)" End If WriteLine strOutput & "
" End Sub Sub ShowMessageLine(iDepth, iId, sSubject, sAuthor, sEmail, sTime, iReplyCount, sPageType, iActiveMessageId) Dim strOutput Dim I strOutput = "" For I = 0 to iDepth - 1 strOutput = strOutput & "" Next 'I If sPageType = "message" Then If iActiveMessageId = iId Then strOutput = strOutput & "" Else strOutput = strOutput & "" End If Else strOutput = strOutput & "" End If strOutput = strOutput & "" strOutput = strOutput & " " strOutput = strOutput & "" & Server.HTMLEncode(sSubject) & "" strOutput = strOutput & " by " strOutput = strOutput & "" & Server.HTMLEncode(sAuthor) & "" If sPageType = "message" And sEmail <> "" Then strOutput = strOutput & " " End If strOutput = strOutput & " " strOutput = strOutput & sTime If sPageType = "forum" Then strOutput = strOutput & " (" strOutput = strOutput & iReplyCount strOutput = strOutput & " replies)" End If strOutput = strOutput & "" WriteLine strOutput & "
" End Sub Sub ShowSearchForm() %>

Search the forums for a keyword:
New features... AND it's faster than ever!
<% End Sub '== END DISPLAY ================================================================ %>