Forum Diskusi di Internet

Forum Diskusi adalah salah satu kegiatan Internet, dimana kita dapat melakukan interaksi dengan beberapa netters yang lain. Dapat dikenal juga sebagai message board, atau papan pesan di Internet. Aktifitas yang dilakukan adalah kita melakukan posting message menurut topic yang kita inginkan. Setelah posting kita disubmit, pesan kita akan dapat dibaca semua orang di Internet, selanjutnya mereka akan me-reply pesan kita sesuai dengan topic yang ada. Demikian seterusnya. Jadi dapat disimpulkan bahwa kegiatan forum diskusi adalah kegiatan komunikasi dua arah atau lebih yang dapat melibatkan beberapa orang untuk membahas suatu topic tertentu.

Persiapan Database

Untuk penggunaan Database, kita akan memakai Database Microsoft Access 2000, karena program Forum Diskusi ini akan dikembangkan dengan ASP. Adapun Himpunan Entitas beserta Atribut yang digunakan dalam perancangan forum diskusi adalah sebagai berikut :

Himpunan Entitas Forums
Daftar Atribut yang dimiliki :
ForumID, yaitu id untuk forum yang merupakan primary key
Forum, yaitu atribut untuk mencatat judul dan jenis forum.
Description, yaitu atribut untuk mencatat deskripsi dari forum.
Posts, yaitu atribut yang mencatat jumlah posting
Last Post, tanggal terakhir posting

Himpunan Entitas Messages
Daftar Atribut yang dimiliki :
MessageID, yaitu id dari setiap pesan yang merupakan primary key.
ForumID, yaitu id dari forum untuk memilah-milah pesan yang diposting.
InReplyTo, yaitu kode untuk mencatat posting reply.
PostedBy, yaitu untuk mencatat nama yang melakukan posting.
Email, yaitu email yang melakukan posting.
Subject, yaitu subject dari setiap posting.
Body, yaitu untuk mencatat isi dari pesan yang diposting.
Data, mencatat tanggal posting.

Listing Program

adovbs.inc
<%
‘——————————————————————–
‘ Microsoft ADO

‘ (c) 1996 Microsoft Corporation. All Rights Reserved.



‘ ADO constants include file for VBScript

‘——————————————————————–

‘—- CursorTypeEnum Values —-
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3

‘—- CursorOptionEnum Values —-
Const adHoldRecords = &H00000100
Const adMovePrevious = &H00000200
Const adAddNew = &H01000400
Const adDelete = &H01000800
Const adUpdate = &H01008000
Const adBookmark = &H00002000
Const adApproxPosition = &H00004000
Const adUpdateBatch = &H00010000
Const adResync = &H00020000
Const adNotify = &H00040000

‘—- LockTypeEnum Values —-
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4

‘—- ExecuteOptionEnum Values —-
Const adRunAsync = &H00000010

‘—- ObjectStateEnum Values —-
Const adStateClosed = &H00000000
Const adStateOpen = &H00000001
Const adStateConnecting = &H00000002
Const adStateExecuting = &H00000004

‘—- CursorLocationEnum Values —-
Const adUseServer = 2
Const adUseClient = 3

‘—- DataTypeEnum Values —-
Const adEmpty = 0
Const adTinyInt = 16
Const adSmallInt = 2
Const adInteger = 3
Const adBigInt = 20
Const adUnsignedTinyInt = 17
Const adUnsignedSmallInt = 18
Const adUnsignedInt = 19
Const adUnsignedBigInt = 21
Const adSingle = 4
Const adDouble = 5
Const adCurrency = 6
Const adDecimal = 14
Const adNumeric = 131
Const adBoolean = 11
Const adError = 10
Const adUserDefined = 132
Const adVariant = 12
Const adIDispatch = 9
Const adIUnknown = 13
Const adGUID = 72
Const adDate = 7
Const adDBDate = 133
Const adDBTime = 134
Const adDBTimeStamp = 135
Const adBSTR = 8
Const adChar = 129
Const adVarChar = 200
Const adLongVarChar = 201
Const adWChar = 130
Const adVarWChar = 202
Const adLongVarWChar = 203
Const adBinary = 128
Const adVarBinary = 204
Const adLongVarBinary = 205

‘—- FieldAttributeEnum Values —-
Const adFldMayDefer = &H00000002
Const adFldUpdatable = &H00000004
Const adFldUnknownUpdatable = &H00000008
Const adFldFixed = &H00000010
Const adFldIsNullable = &H00000020
Const adFldMayBeNull = &H00000040
Const adFldLong = &H00000080
Const adFldRowID = &H00000100
Const adFldRowVersion = &H00000200
Const adFldCacheDeferred = &H00001000

‘—- EditModeEnum Values —-
Const adEditNone = &H0000
Const adEditInProgress = &H0001
Const adEditAdd = &H0002
Const adEditDelete = &H0004

‘—- RecordStatusEnum Values —-
Const adRecOK = &H0000000
Const adRecNew = &H0000001
Const adRecModified = &H0000002
Const adRecDeleted = &H0000004
Const adRecUnmodified = &H0000008
Const adRecInvalid = &H0000010
Const adRecMultipleChanges = &H0000040
Const adRecPendingChanges = &H0000080
Const adRecCanceled = &H0000100
Const adRecCantRelease = &H0000400
Const adRecConcurrencyViolation = &H0000800
Const adRecIntegrityViolation = &H0001000
Const adRecMaxChangesExceeded = &H0002000
Const adRecObjectOpen = &H0004000
Const adRecOutOfMemory = &H0008000
Const adRecPermissionDenied = &H0010000
Const adRecSchemaViolation = &H0020000
Const adRecDBDeleted = &H0040000

‘—- GetRowsOptionEnum Values —-
Const adGetRowsRest = -1

‘—- PositionEnum Values —-
Const adPosUnknown = -1
Const adPosBOF = -2
Const adPosEOF = -3

‘—- enum Values —-
Const adBookmarkCurrent = 0
Const adBookmarkFirst = 1
Const adBookmarkLast = 2

‘—- MarshalOptionsEnum Values —-
Const adMarshalAll = 0
Const adMarshalModifiedOnly = 1

‘—- AffectEnum Values —-
Const adAffectCurrent = 1
Const adAffectGroup = 2
Const adAffectAll = 3

‘—- FilterGroupEnum Values —-
Const adFilterNone = 0
Const adFilterPendingRecords = 1
Const adFilterAffectedRecords = 2
Const adFilterFetchedRecords = 3
Const adFilterPredicate = 4

‘—- SearchDirection Values —-
Const adSearchForward = 1
Const adSearchBackward = -1

‘—- ConnectPromptEnum Values —-
Const adPromptAlways = 1
Const adPromptComplete = 2
Const adPromptCompleteRequired = 3
Const adPromptNever = 4

‘—- ConnectModeEnum Values —-
Const adModeUnknown = 0
Const adModeRead = 1
Const adModeWrite = 2
Const adModeReadWrite = 3
Const adModeShareDenyRead = 4
Const adModeShareDenyWrite = 8
Const adModeShareExclusive = &Hc
Const adModeShareDenyNone = &H10

‘—- IsolationLevelEnum Values —-
Const adXactUnspecified = &Hffffffff
Const adXactChaos = &H00000010
Const adXactReadUncommitted = &H00000100
Const adXactBrowse = &H00000100
Const adXactCursorStability = &H00001000
Const adXactReadCommitted = &H00001000
Const adXactRepeatableRead = &H00010000
Const adXactSerializable = &H00100000
Const adXactIsolated = &H00100000

‘—- XactAttributeEnum Values —-
Const adXactCommitRetaining = &H00020000
Const adXactAbortRetaining = &H00040000

‘—- PropertyAttributesEnum Values —-
Const adPropNotSupported = &H0000
Const adPropRequired = &H0001
Const adPropOptional = &H0002
Const adPropRead = &H0200
Const adPropWrite = &H0400

‘—- ErrorValueEnum Values —-
Const adErrInvalidArgument = &Hbb9
Const adErrNoCurrentRecord = &Hbcd
Const adErrIllegalOperation = &Hc93
Const adErrInTransaction = &Hcae
Const adErrFeatureNotAvailable = &Hcb3
Const adErrItemNotFound = &Hcc1
Const adErrObjectInCollection = &Hd27
Const adErrObjectNotSet = &Hd5c
Const adErrDataConversion = &Hd5d
Const adErrObjectClosed = &He78
Const adErrObjectOpen = &He79
Const adErrProviderNotFound = &He7a
Const adErrBoundToCommand = &He7b
Const adErrInvalidParamInfo = &He7c
Const adErrInvalidConnection = &He7d
Const adErrStillExecuting = &He7f
Const adErrStillConnecting = &He81

‘—- ParameterAttributesEnum Values —-
Const adParamSigned = &H0010
Const adParamNullable = &H0040
Const adParamLong = &H0080

‘—- ParameterDirectionEnum Values —-
Const adParamUnknown = &H0000
Const adParamInput = &H0001
Const adParamOutput = &H0002
Const adParamInputOutput = &H0003
Const adParamReturnValue = &H0004

‘—- CommandTypeEnum Values —-
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004

‘—- SchemaEnum Values —-
Const adSchemaProviderSpecific = -1
Const adSchemaAsserts = 0
Const adSchemaCatalogs = 1
Const adSchemaCharacterSets = 2
Const adSchemaCollations = 3
Const adSchemaColumns = 4
Const adSchemaCheckConstraints = 5
Const adSchemaConstraintColumnUsage = 6
Const adSchemaConstraintTableUsage = 7
Const adSchemaKeyColumnUsage = 8
Const adSchemaReferentialContraints = 9
Const adSchemaTableConstraints = 10
Const adSchemaColumnsDomainUsage = 11
Const adSchemaIndexes = 12
Const adSchemaColumnPrivileges = 13
Const adSchemaTablePrivileges = 14
Const adSchemaUsagePrivileges = 15
Const adSchemaProcedures = 16
Const adSchemaSchemata = 17
Const adSchemaSQLLanguages = 18
Const adSchemaStatistics = 19
Const adSchemaTables = 20
Const adSchemaTranslations = 21
Const adSchemaProviderTypes = 22
Const adSchemaViews = 23
Const adSchemaViewColumnUsage = 24
Const adSchemaViewTableUsage = 25
Const adSchemaProcedureParameters = 26
Const adSchemaForeignKeys = 27
Const adSchemaPrimaryKeys = 28
Const adSchemaProcedureColumns = 29
%>

config.inc
<% Option Explicit %>
<!– #INCLUDE FILE=”adovbs.inc” –>
<%
Response.Buffer = True
Response.Expires = -1000

Const ForumMDB = “/candrawhykey/db/forum.mdb”
Const SiteTitle = “Orient Express Tour & Travel”

Public Sub ShowError(Err)
If CStr(Err) <> “” Then
Response.Write “<PError””>” + CStr(Err) + “</P>”
End If
End Sub

Function Connect (Path2DB)
Dim DB
Set DB = Server.CreateObject(“ADODB.Connection”)
DB.Mode = adModeReadWrite ‘Since we will be adding entries.
DB.Open (“PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=” + Server.MapPath(Path2DB))
Set Connect = DB
End Function

Function Escape(sz)
Escape = Replace(sz, “‘”, “””)
End Function

Public Function ShortDate(dtDate)
If Not IsNull (dtDate) Then
ShortDate = Day(dtDate) & ” ” & Left(MonthName (Month(dtDate)), 3) & “, ” & Year(dtDate)
Else
ShortDate = dtDate
End If
End Function
%>

forum.css
body, p, td, li
{font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; }
H1
{font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-style: italic; font-weight: normal}
H6
{font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: bold}
.Error
{font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; color: #FF0000; }
.Small
{font-family: Arial, Helvetica, sans-serif; font-size: 8pt}

topic.asp
<!– #INCLUDE FILE=”config.inc”–>
<HTML>
<HEAD>
<TITLE>Discussion Forums : Orient Express Tour & Travel</TITLE>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=iso-8859-1″>
<!–LINK REL=”stylesheet” HREF=”forum.css”–>
</HEAD>
<BODY BGCOLOR=”#FFFFFF” LEFTMARGIN=”0″ TOPMARGIN=”0″ MARGINWIDTH=”0″ MARGINHEIGHT=”0″>
<br>
<TABLE WIDTH=”100%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”2″ BGCOLOR=”#F0F0FF”>
<TR>
<TD ALIGN=”center”><b>Discussion Forums – <%= SiteTitle %></b></TD>
</TR>
</TABLE><br>
<TABLE WIDTH=”90%” BORDER=”0″ CELLSPACING=”1″ CELLPADDING=”12″ ALIGN=”CENTER”>
<TR ALIGN=”LEFT” VALIGN=”TOP” BGCOLOR=”#FFFFFF”><TD colspan=”2″>
<%
Dim rsForums
Set rsForums = Connect (ForumMDB).Execute (“SELECT * FROM Forums ORDER BY Forum ASC”)
rsForums.MoveFirst
%>
<table width=”100%” align=”center” cellspacing=”0″ cellpadding=”6″ border=”1″>
<tr><td width=”60%” bgcolor=”F0FFF0″><p><b>Forums</b></tr>
<%While Not rsForums.EOF%>
<tr>
<td><a href=”forum.asp?ForumID=<%= rsForums(“ForumID”) %>”><B><%= rsForums(“Forum”) %></B></a><BR>
<BLOCKQUOTE>
<%= rsForums (“Description”)%><BR>
<SMALL>[Total Posts: <%= rsForums(“Posts”) %>] [Last Post on <%= rsForums(“LastPost”) %>]</SMALL>
</BLOCKQUOTE></tr>
<%
rsForums.MoveNext
Wend
rsForums.Close
%>
</table></TD></TR></TABLE>
<center><font face=”Verdana” size=”2″>
<a href=”http://www.orientexpress.co.id”>Back to Orient Express’ Site</a></font></center><BR></center></BODY></HTML>

forum.asp
<!– #INCLUDE FILE=”config.inc” –>
<HTML>
<HEAD>
<TITLE>Discussion Forum : Orient Express Tour & Travel</TITLE>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=iso-8859-1″>
<!–LINK REL=”stylesheet” HREF=”forum.css”–>
</HEAD>
<BODY BGCOLOR=”#FFFFFF” LEFTMARGIN=”0″ TOPMARGIN=”0″ MARGINWIDTH=”0″ MARGINHEIGHT=”0″>
<br>
<TABLE WIDTH=”100%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”2″ BGCOLOR=”#F0F0FF”>
<TR>
<TD ALIGN=”center”><b>Discussion Forums – <%= SiteTitle %></b></TD>
</TR></TABLE><br>
<%
Public Sub treeMessage_Build(MessageID, Level)
Dim rsMessages
Set rsMessages = DB.Execute (“SELECT * FROM Messages WHERE ForumID = ” & ForumID & ” ORDER BY Date DESC”)
rsMessages.Filter = “MessageID = ” & MessageID
%>
<TR>
<TD WIDTH=”60%” ALIGN=”left”><font face=”verdana” size=”2″><IMG SRC=”spacer.gif” WIDTH=”<%= Level * 20 %>” HEIGHT=”1″><IMG SRC=”message.gif” WIDTH=”24″ HEIGHT=”19″ ALIGN=”absmiddle” HSPACE=”4″><A HREF=”message.asp?MessageID=<%= rsMessages (“MessageID”) %>”><%= rsMessages (“Subject”) %></a>
<TD WIDTH=”20%” ALIGN=”left”><font face=”verdana” size=”2″><IMG SRC=”face.gif” WIDTH=”18″ HEIGHT=”25″ ALT=”” ALIGN=”absmiddle” HSPACE=”4″><A HREF=”mailto:<%= rsMessages (“Email”)%>”><%= rsMessages (“PostedBy”) %></A>
<TD WIDTH=”20%” ALIGN=”right”><font face=”verdana” size=”2″><%= ShortDate(rsMessages (“Date”)) %></TR>
<%
rsMessages.Filter = “InReplyTo = ” & MessageID
If Not (rsMessages.EOF And rsMessages.BOF) Then
rsMessages.MoveFirst
While Not rsMessages.EOF
treeMessage_Build rsMessages(“MessageID”), Level+1
rsMessages.MoveNext
Wend
End If
End Sub
%>
<%
If Request (“ForumID”) = “” Then
‘ We don’t have a valid ForumID, so go back to the main page.
Response.Redirect “http://www.orientexpress.co.id”
End If
Dim ForumID
ForumID = Request(“ForumID”)
Dim DB, rsForum, rsMessages, rsThreads
Set DB = Connect (ForumMDB)
Set rsForum = DB.Execute (“SELECT * FROM Forums WHERE ForumID = ” & ForumID)
Set rsMessages = DB.Execute (“SELECT * FROM Messages WHERE ForumID = ” & ForumID & ” ORDER BY Date DESC”)
Set rsThreads = DB.Execute (“SELECT * FROM Messages WHERE ForumID = ” & ForumID & ” AND InReplyTo = 0 ORDER BY Date DESC”)

If rsThreads.BOF And rsThreads.EOF Then
ShowError (“<P ALIGN=””center””>There are no messages in this forum.</P>”)
%>
<P ALIGN=”center”><B><A HREF=”post.asp?ForumID=<%= ForumID%>”>Post a New Message</A></B></P>
<%
Else
rsThreads.MoveFirst
%>
<TABLE WIDTH=”90%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”0″ ALIGN=”CENTER”>
<TR ALIGN=”LEFT” VALIGN=”TOP” BGCOLOR=”#FFFFFF”><TD colspan=”2″>
<H1><%= rsForum(“Forum”)%></H1>
<P><B><%= rsForum(“Description”)%></b></P>
<P align=”center”><A HREF=”post.asp?ForumID=<%= ForumID %>”><B><font face=”Verdana” size=”-1″>Post a Message</font></B></A></P>
<table width=”100%” align=”center” cellpadding=”6″ cellspacing=”0″ border=”1″>
<tr>
<td width=”60%” align=”left” valign=”top”><font face=”Verdana” size=”-1″><b>Subject</b></font></td>
<td width=”20%” align=”center” valign=”top”><font face=”Verdana” size=”-1″><b>Posted By</b></font></td>
<td width=”20%” align=”center” valign=”top”><font face=”Verdana” size=”-1″><b>Date</b></font></td>
</tr>
<tr><td COLSPAN=”3″ align=”left” valign=”top”>
<TABLE WIDTH=”100%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”0″>
<%
While Not rsThreads.EOF
treeMessage_Build rsThreads(“MessageID”), 0
rsThreads.MoveNext
Wend
%>
</TABLE></tr></table>
<P align=”center”><A HREF=”post.asp?ForumID=<%= ForumID %>”><B><font face=”Verdana” size=”-1″>Post a Message</font></B></A></P>
<HR></TD></TR></TABLE>
<% End If %>
<BR></center></BODY></HTML>

post.asp
<!– #INCLUDE FILE=”config.inc” –>
<HTML>
<HEAD>
<TITLE>Discussion Forum : by Manas Tungare</TITLE>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=iso-8859-1″>
<!–LINK REL=”stylesheet” HREF=”forum.css”–>
</HEAD>
<BODY BGCOLOR=”#FFFFFF” LEFTMARGIN=”0″ TOPMARGIN=”0″ MARGINWIDTH=”0″ MARGINHEIGHT=”0″>
<br>
<TABLE WIDTH=”100%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”2″ BGCOLOR=”#F0F0FF”>
<TR>
<TD ALIGN=”center”><b>Discussion Forums – <%= SiteTitle %></b></TD>
</TR></TABLE><br>
<%
Dim DB, InReplyTo, rsInReplyTo, IsAReply
Set DB = Connect (ForumMDB)
If Request (“Action”) = “Send Message” Then
Dim rsMessage
Set rsMessage = Server.CreateObject (“ADODB.Recordset”)
rsMessage.Open “Messages”, DB, adOpenStatic, adLockPessimistic
rsMessage.AddNew
rsMessage (“ForumID”) = Request (“ForumID”)
rsMessage (“PostedBy”) = Request (“PostedBy”)
rsMessage (“Email”) = Request (“Email”)
rsMessage (“Subject”) = Request (“Subject”)
rsMessage (“Body”) = Request (“Body”)
rsMessage (“InReplyTo”) = Request (“InReplyTo”)
rsMessage (“Date”) = Now
rsMessage.Update
Dim rsForum
Set rsForum = Server.CreateObject (“ADODB.Recordset”)
rsForum.Open “SELECT Posts, LastPost FROM Forums WHERE ForumID = ” & Request (“ForumID”), DB, adOpenStatic, adLockPessimistic
rsForum (“Posts”) = rsForum (“Posts”) + 1
rsForum (“LastPost”) = Now
rsForum.Update
Response.Cookies (SiteTitle)(“PostedBy”) = Request(“PostedBy”)
Response.Cookies (SiteTitle)(“Email”) = Request(“Email”)
Response.Redirect “forum.asp?ForumID=” & Request (“ForumID”)
Else
InReplyTo = Request (“InReplyTo”)
If InReplyTo <> 0 And InReplyTo <> “” Then
IsAReply = True
Set rsInReplyTo = DB.Execute (“SELECT * FROM Messages WHERE MessageID = ” & InReplyTo)
End If
If Not IsAReply And (Request (“ForumID”) = “” Or Request (“ForumID”) = 0) Then
Response.Redirect “forum.asp”
End If
%>
<TABLE WIDTH=”90%” BORDER=”1″ CELLSPACING=”0″ CELLPADDING=”8″ ALIGN=”CENTER”>
<TR ALIGN=”LEFT” VALIGN=”TOP” BGCOLOR=”#FFFFFF”>
<TD COLSPAN=”2″>
<font face=”Verdana” size=”-1″>
Post a Message
</font>
<% If IsAReply Then Response.Write ” in reply to <B>” & rsInReplyTo(“Subject”) & “</B> by <B>” & rsInReplyTo (“PostedBy”) & “</B>”%></TD>
</TR>
<TR ALIGN=”LEFT” VALIGN=”TOP” BGCOLOR=”#FFFFFF”>
<TD COLSPAN=”2″>
<FORM ACTION=”<%= Request.ServerVariables (“PATH_INFO”) %>”>
<INPUT TYPE=”hidden” NAME=”ForumID” VALUE=”<% If IsAReply Then Response.Write rsInReplyTo (“ForumID”) Else Response.Write Request (“ForumID”) %>”>
<INPUT TYPE=”hidden” NAME=”InReplyTo” VALUE=”<% If InReplyTo = “” Then Response.Write “0” Else Response.Write InReplyTo %>”>
<TABLE WIDTH=”100%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”4″ ALIGN=”CENTER”>
<TR ALIGN=”LEFT” VALIGN=”TOP”>
<TD WIDTH=”20%” ALIGN=”RIGHT”>
<font face=”Verdana” size=”-1″>
From:</font></TD>
<TD WIDTH=”80%”>
<INPUT TYPE=”text” NAME=”PostedBy” SIZE=”60″ MAXLENGTH=”50″ VALUE=”<%= Request.Cookies (SiteTitle)(“PostedBy”) %>”>
</TD></TR>
<TR ALIGN=”LEFT” VALIGN=”TOP”><TD WIDTH=”20%” ALIGN=”RIGHT”>
<font face=”Verdana” size=”-1″>
Email Address:</font></TD>
<TD WIDTH=”80%”>
<INPUT TYPE=”text” NAME=”Email” SIZE=”60″ MAXLENGTH=”100″ VALUE=”<%= Request.Cookies (SiteTitle)(“Email”) %>”></TD></TR>
<TR ALIGN=”LEFT” VALIGN=”TOP”><TD WIDTH=”20%” ALIGN=”RIGHT”>
<font face=”Verdana” size=”-1″>
Subject:</font></TD>
<TD WIDTH=”80%”>
<INPUT TYPE=”text” NAME=”Subject” SIZE=”60″ MAXLENGTH=”100″ VALUE=”<% If IsAReply Then Response.Write “Re: ” & rsInReplyTo (“Subject”)%>”>
</TD></TR>
<TR ALIGN=”LEFT” VALIGN=”TOP”><TD WIDTH=”20%” ALIGN=”RIGHT”>
<font face=”Verdana” size=”-1″>
Message:</font></TD>
<TD WIDTH=”80%”>
<TEXTAREA NAME=”Body” COLS=”50″ ROWS=”12″><% If IsAReply Then Response.Write “> ” & (Replace (rsInReplyTo(“Body”), vbCrLf, vbCrLf + “> “))%></TEXTAREA></TD></TR>
<TR ALIGN=”LEFT” VALIGN=”TOP”><TD WIDTH=”20%” ALIGN=”RIGHT”>&nbsp;</TD>
<TD WIDTH=”80%”><INPUT TYPE=”submit” NAME=”Action” VALUE=”Send Message”></TD></TR></TABLE></FORM></TD></TR></TABLE>
<%End If%></center></BODY></HTML>

message.asp
<!– #INCLUDE FILE=”config.inc” –>
<HTML>
<HEAD>
<TITLE>Discussion Forum : Orient Express Tour & Travel</TITLE>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=iso-8859-1″>
<!–LINK REL=”stylesheet” HREF=”forum.css”–>
</HEAD>
<BODY BGCOLOR=”#FFFFFF” LEFTMARGIN=”0″ TOPMARGIN=”0″ MARGINWIDTH=”0″ MARGINHEIGHT=”0″>
<br>
<TABLE WIDTH=”100%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”2″ BGCOLOR=”#F0F0FF”>
<TR>
<TD ALIGN=”center”><b>Discussion Forums – <%= SiteTitle %></b></TD>
</TR>
</TABLE>
<br>
<%
If Request(“MessageID”) = “” Then
Response.Redirect “default.asp”
End If
Dim DB, rsMessage, rsInReply, rsReplies
Set DB = Connect (ForumMDB)
Set rsMessage = DB.Execute (“SELECT * FROM Messages WHERE MessageID = ” & Request (“MessageID”))
If rsMessage.EOF And rsMessage.BOF Then
ShowError “Invalid Message Identifier. Please re-login to continue.”
End If
rsMessage.MoveFirst
If rsMessage(“InReplyTo”) <> 0 Then
Set rsInReply = DB.Execute (“SELECT * FROM Messages WHERE MessageID = ” & rsMessage(“InReplyTo”))
End If
Set rsReplies = DB.Execute (“SELECT * FROM Messages WHERE InReplyTo = ” & rsMessage(“MessageID”))
%>
<BR>
<TABLE WIDTH=”90%” BORDER=”1″ CELLSPACING=”0″ CELLPADDING=”8″ ALIGN=”CENTER”>
<TR ALIGN=”LEFT” VALIGN=”MIDDLE”>
<TD BGCOLOR=”#F0F0F0″ WIDTH=”75%” VALIGN=”MIDDLE”><B><A HREF=”post.asp?InReplyTo=<%= rsMessage (“MessageID”) %>”><IMG SRC=”reply.gif” WIDTH=”59″ HEIGHT=”40″ ALIGN=”LEFT” ALT=”Reply” HSPACE=”8″ VSPACE=”2″ BORDER=”0″></A><%= rsMessage(“Subject”) %></B></TD> <TD WIDTH=”25%” VALIGN=”MIDDLE”><B><IMG SRC=”face.gif” WIDTH=”18″ HEIGHT=”25″ ALIGN=”ABSMIDDLE” HSPACE=”4″></B>From:<BR>
<B><%= rsMessage(“PostedBy”) %></B></TD>
</TR>
<TR ALIGN=”LEFT” VALIGN=”TOP”>
<TD COLSPAN=”2″ BGCOLOR=”#FFFFFF”>
<P><IMG SRC=”message.gif” WIDTH=”24″ HEIGHT=”19″ ALIGN=”LEFT” HSPACE=”4″><%= Replace(Server.HTMLEncode(rsMessage(“Body”)), vbCrLf, “<BR>” + vbCrLf) %></P>
</TD>
</TR>
<% If rsMessage(“InReplyTo”) <> 0 Then %>
<TR ALIGN=”LEFT” VALIGN=”TOP”>
<TD COLSPAN=”2″>This message is a Reply to: <A HREF=”message.asp?MessageID=<%= rsInReply(“MessageID”) %>”><%= rsInReply(“Subject”) %></A>
from <%= rsInReply(“PostedBy”) %></TD>
</TR>
<% End If %>
<TR ALIGN=”LEFT” VALIGN=”TOP”>
<TD COLSPAN=”2″>
<P><B>Replies to this message:</B><BR>
<%
If (rsReplies.BOF And rsReplies.EOF) Then
Response.Write “-None-“
Else
rsReplies.MoveFirst
Response.Write “<UL>”
While Not rsReplies.EOF
Response.Write “<LI><IMG SRC=””message.gif”” WIDTH=””24″” HEIGHT=””19″” ALIGN=””absmiddle”” HSPACE=””4″”><A HREF=””message.asp?MessageID=” & rsReplies(“MessageID”) & “””>” & rsReplies(“Subject”) & “</A>” & ” by ” & rsReplies(“PostedBy”)
rsReplies.MoveNext
Wend
Response.Write “</UL>”
End If
%>
</TD></TR></TABLE></center></BODY></HTML>