<table width=100% cellspacing=1 cellpadding=1 border=0>
<tr class="tableSubLedger">
<td colspan="2"><%="Latest Forum Posts"%></td>
</tr>
<tr class="tableRow">
<td> </td>
<td><table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<% If strDatabaseType = "Access" Then %>
<tr class="tableSubLedger">
<td width="38%" align="center" style="color:#FFA1C1">Topic</td>
<td width="19%" align="center" style="color:#FFA1C1">Forum</td>
<td width="15%" align="center" style="color:#FFA1C1">Author</td>
<td width="21%" align="center" style="color:#FFA1C1">Date</td>
<td width="7%" align="center" style="color:#FFA1C1">Views</td>
</tr>
<%
Dim intSay
Dim rsLatestPosts2
Dim sql2
Dim rsLatestPosts
Dim strTopicSubject
Dim strTopicSubjectOrj
Dim NumberOfPosts
Dim strFirstPostMsg
Dim LastLatestPostsDateTime
Dim LastLatestPostsDate
Dim LastLatestPostsTime
Set rsLatestPosts = Server.CreateObject("ADODB.Recordset")
strSql = "Select " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Topic.Last_Thread_ID, " & strDbTable & "Topic.No_of_views "
strSql = strSql & "From " & strDbTable & "Topic, " & strDbTable & "Forum Where " & strDbTable & "Topic.Hide = False And " & strDbTable & "Topic.Forum_ID = " & strDbTable & "Forum.Forum_ID Order By " & strDbTable & "Topic.Last_Thread_ID desc"
rsLatestPosts.Open strSQL, adoCon
If rsLatestPosts.EOF Then
Response.Write "<tr class=""tableRow""><td colspan=5>No recent posts. Please check back later.</td></tr>"
Else
For intSay = 1 to 100
if rsLatestPosts.Eof Then Exit For
Set rsLatestPosts2 = Server.CreateObject("ADODB.Recordset")
sql2 = "SELECT tblThread.Thread_ID, tblThread.Topic_ID, tblThread.Message_date, tblAuthor.Username, tblAuthor.Author_ID FROM (tblAuthor INNER JOIN tblThread ON tblAuthor.Author_ID = tblThread.Author_ID) WHERE tblThread.Hide = False And Topic_ID= " & rsLatestPosts("Topic_ID") & " order by Message_date desc"
rsLatestPosts2.Open sql2, adoCon
LastLatestPostsDateTime = rsLatestPosts2("Message_date")
LastLatestPostsDate = DateFormat(LastLatestPostsDateTime)
LastLatestPostsTime = TimeFormat(LastLatestPostsDateTime)
intForumColourNumber = intForumColourNumber + 1
Response.Write(vbCrLf & " <tr ")
If (intForumColourNumber MOD 2 = 0 ) Then Response.Write("class=""evenTableRow"">") Else Response.Write("class=""oddTableRow"">")
Response.Write("<td>")
Response.Write "<a class=""smLink"" href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & "&get=last#" & rsLatestPosts("Last_Thread_ID") & """ title="""">" & rsLatestPosts("Subject") & "</a></td><td><a class=""smLink"" href=""forum_topics.asp?FID=" & rsLatestPosts("Forum_ID") & """>" & rsLatestPosts("Forum_name") & "</a></td><td align=""center""><span class=""smText"">"&rsLatestPosts2("Username") &"</span></td><td align=""center""><span class=""smText"">" & LastLatestPostsDate & "-" & LastLatestPostsTime & "</span></td><td align=""center""><span class=""smText"">" & rsLatestPosts("No_of_views") & "</span></td></tr>"
rsLatestPosts.MoveNext
Next
end if
end if
'Clean up
Call closeDatabase()
%>
</table></td>
</tr>
</table>