<%@ LANGUAGE="VBScript" %> <% Option Explicit Dim sDbLocation, sConnection, sSiteName, sHomeURL ' The following are some variables that have to be ' individually customized for this website sSiteName = "Hopenet Forums" sHomeURL = "http://www.hopenetworks.org/" sDbLocation = Server.MapPath("forum.mdb") sConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & sDbLocation & ";" 'ConnectDB: a simple function to make database connections FUNCTION ConnectDb () Dim conForum SET conForum = Server.CreateObject("ADODB.Connection") conForum.Open sConnection Set ConnectDb = conForum conForum.Close SET conForum = NOTHING END FUNCTION 'InputFix: Prepares Text in the proper format for inserting ' into the database. FUNCTION InputFix(strInput) Dim strTemp strTemp = Replace(strInput, "'", "`") InputFix = strTemp END FUNCTION 'OutputFix: Prepares Text in the proper format for inserting ' into the html code of a page. FUNCTION OutputFix(strInput) Dim strTemp strTemp= Replace(strInput, vbcrlf, "
") strTemp = Replace(strTemp, "`", "'") OutputFix = strTemp END FUNCTION %> <% Dim ThreadID Dim ForumID, ForumName Dim strSQL Dim rstThread, rstForumName Dim conForum ThreadID = Request.QueryString("thread_id") ForumID = Request.QueryString("forum_id") if ThreadID = "" or ForumID = "" then Response.Redirect "default.asp" Set conForum = Server.CreateObject("ADODB.Connection") conForum.Open sConnection strSQL = "SELECT * FROM tblMessages WHERE forum_id=" & ForumID &_ " AND thread_id=" & ThreadID & " ORDER BY message_timestamp;" Set rstThread = conForum.Execute(strSQL) 'Get the forum Name Set rstForumName = conForum.Execute("Select * From tblForums Where forum_id=" & ForumID & ";") ForumName = rstForumName("ForumName") rstForumName.Close Set rstForumName = NOTHING %> forums

<%=sSiteName%> > <%=ForumName%> > <%=rstThread("message_subject")%>

Post a Reply
Subject: <%=rstThread("message_subject")%>
<% rstThread.MoveFirst Do UNTIL rstThread.EOF %> ">
Author: <%=rstThread("message_author")%>

Email:

"><%=rstThread("author_email")%>
Date: <%=rstThread("message_timestamp")%>
Message: <%=OutputFix(rstThread("message_body"))%>
<% If Session("authorized") = 1 Then %> Admin: &f_id=<%=ForumID%>&t_id=<%=ThreadID%>">Remove Message
<% end if %>
<% rstThread.MoveNext LOOP %> <% If Session("authorized") = 1 Then %> <% end if %>
Back To Thread List  |  Post a Reply
 
Admin: Remove Thread
<% rstThread.Close Set rstThread = NOTHING conForum.Close Set conForum = NOTHING %>
Search the forums for a keyword: