%@ LANGUAGE=VBScript %>
<%Response.Buffer=TRUE
'' Basic viewing screen.
'' Changed cInt to Int. It broke on MID = 33123 (over the cInt limit!) -- JKAG 5/9/05
'' The OLEDB switchover -- JKAG 2/23/2006
''**WEB DESIGN VARIABLES**
''Set the Width of the tables with this variable (by percentage)
Dim TableWidth
TableWidth=75
''Parameter explanation
'' MID is the MID of the message to currently view
'' mMID is the master MID, the top most level MID viewed. It is needed to make sure that the
'' thread tree continues to display all items in the thread.
%>
<%
Sub TopTree(inDBConn0, inMID)
Dim srs0, sSQLText0
''Open Recordset and check for MID exsistence
Set srs0 = Server.CreateObject("ADODB.Recordset")
sSQLText0 = "SELECT Subject, Fwd, Handle, TimeStamp, MID FROM Messages WHERE Forum = '" & Request.QueryString("Forum") & "' and MID = " & inMID
srs0.Open sSQLText0, inDBConn0
If srs0.EOF Then
Exit Sub
End If
''Setup table
Response.Write "
| "
''Indent properly - not needed here, no indent for top line
''fill in data
%>
&MID=<%=Request.QueryString("mMID")%>&mMID=<%=Request.QueryString("mMID")%>">
<%
''If CInt(srs0("MID")) = CInt(Request.QueryString("MID")) Then
If Int(srs0("MID")) = Int(Request.QueryString("MID")) Then
Response.Write ""
Response.Write srs0("Subject")&" | "
Else
Response.Write srs0("Subject")&""
End If
Response.Write " "& _
srs0("Handle")&" | "
Response.Write " "& _
NiceTimeStamp(srs0("TimeStamp"))&" |
"
'''If there are replies to this message, then recurse - nope, we're at the top
srs0.Close
Set srs0 = Nothing
End Sub '' end TopTree
Sub GenTree(inDBConn, inMID, inStep)
Dim srs, sSQLText, temp
''Open Recordset and check for MID exsistence
Set srs = Server.CreateObject("ADODB.Recordset")
sSQLText = "SELECT Subject, Fwd, Handle, TimeStamp, MID FROM Messages WHERE Forum = '" & Request.QueryString("Forum") & "' and Re = " & inMID
srs.Open sSQLText, inDBConn
If srs.EOF Then
Exit Sub
End If
While Not(srs.EOF)
''Setup table
Response.Write "| "
''Indent properly
temp=1
While temp < inStep
Response.Write " "
temp=temp+1
Wend
''fill in data
%>
&MID=<%=srs("MID")%>&mMID=<%=Request.QueryString("mMID")%>">
<%
'' If CInt(srs("MID")) = CInt(Request.QueryString("MID")) Then
If Int(srs("MID")) = Int(Request.QueryString("MID")) Then
Response.Write ""
Response.Write srs("Subject")&" | "
Else
Response.Write srs("Subject")&""
End If
Response.Write " "& _
srs("Handle")&" | "
Response.Write " "& _
NiceTimeStamp(srs("TimeStamp"))&" |
"
''If there are replies to this message, then recurse
If srs("Fwd") <> 0 Then
GenTree inDBConn, srs("MID"), (inStep+1)
End If
srs.MoveNext
Wend
srs.Close
Set srs = Nothing
End Sub ''' end Gentree
Sub DisplayText(inStr)
Dim x, currChar
''Response.Write "String: " & inStr & "
"
''Response.Write "x: " & x & "
Len: " & Len(inStr)
if isNull (inStr) then
Response.Write "[Null]"
else
For x = 0 To Len(inStr)
currChar = Left(Right(inStr,(Len(inStr)-x)),2)
If currChar = (Chr(13) & Chr(10)) Then
Response.Write "
"
x = x + 1
Else
Response.Write Left(currChar,1)
End if
Next
end if
End Sub
''Check for QueryString, and bounce back if no string is given
If Request.QueryString("MID") = "" Then
Response.Redirect("forum_main.asp?Forum=" & Request.QueryString("Forum") & "")
End If
If Request.QueryString("Forum") = "" Then
Response.Redirect("forum.asp")
End If
Dim DBConn, rs, temprs, CurrThreadLevel, SQLText, DBPath
''Intialize the Database connection -- the OLEDB switchover -- JKAG 2/23/2006
Set DBConn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
DBPath = Server.MapPath("../Database/forum_i2k.mdb")
DBConn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & DBPath
'' WAS before the OLEDB switchover -- JKAG 2/23/2006
''Intialize the Database connection
''Set DBConn=Server.CreateObject("ADODB.Connection")
''DBConn.Open "Forum_i2k_dsn"
''Set rs=Server.CreateObject("ADODB.Recordset")
SQLText = "SELECT * FROM Messages WHERE Forum = '" & Request.QueryString("Forum") & "' and MID = " & Request.QueryString("MID")
rs.Open SQLText, DBConn
If rs.EOF Then
'Message not found, bounce back
Response.Redirect("forum_main.asp?Forum=" & Request.QueryString("Forum") & "")
End If
Dim Message
Message = rs("Text")
%>