<% '**************************************************************************************** '** Copyright Notice '** '** Scotty32 '** http://www.s2h.co.uk/" rel="nofollow - http://www.s2h.co.uk/ '** '** Copyright (C) 2008-2009 S2H.co.uk. All Rights Reserved. '** '**************************************************************************************** '** '** Latest Topics '** --------------- '** '** Version: 1.2.0 '** Author: Scotty32 '** Website: http://www.s2h.co.uk/wwf/latest-topics/" rel="nofollow - http://www.s2h.co.uk/wwf/latest-topics/ '** Support: http://www.s2h.co.uk/forum/" rel="nofollow - http://www.s2h.co.uk/forum/ '** '**************************************************************************************** '** '** Latest Topics Options '** intS2HLTLimit = 10 ' Change the value to incease the limit
' Powered By Link '===================== ' To remove the powered by link you must first purchese a license: ' http://www.s2h.co.uk/wwf/latest-topics/link-removal.asp" rel="nofollow - http://www.s2h.co.uk/wwf/latest-topics/link-removal.asp
strS2HLTSerialNumber = "" ' Enter your Link Removal Serial Number here
'****************************************************************************************
Dim saryS2HLTRecords Dim blnS2HLTNoPosts
Dim iS2HLTLoop
Dim intS2HLTFirst Dim intS2HLTLast
Dim intS2HLTForumID Dim strS2HLTForumName Dim lngS2HLTTopicID Dim strS2HLTTopicTitle Dim lngS2HLTMessageID Dim dtmS2HLTMessageDate Dim intS2HLTAuthorID Dim strS2HLTAuthorName Dim intS2HLTLimit Dim strS2HLTForumPath Dim strS2HLTSerialNumber
strSQL = "SELECT " if strDatabaseType = "Access" or strDatabaseType = "SQLServer" then strSQL = strSQL & "TOP " & intS2HLTLimit end if strSQL = strSQL & " " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Thread.Message " & _ "FROM " & strDbTable & "Forum, " & strDbTable & "Topic, " & strDbTable & "Author, " & strDbTable & "Thread " & _ "WHERE " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID " & _ "AND " & strDbTable & "Topic.Last_Thread_ID = " & strDbTable & "Thread.Thread_ID " & _ "AND " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID " & _ "AND (" & strDbTable & "Topic.Forum_ID " & _ "IN (" & _ "SELECT " & strDbTable & "Permissions.Forum_ID " & _ "FROM " & strDbTable & "Permissions" & strDBNoLock & " " & _ "WHERE (" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ") " & _ "AND " & strDbTable & "Permissions.View_Forum = " & strDBTrue & _ ")" & _ ")" strSQL = strSQL & "AND (" & strDbTable & "Forum.Password = '' OR " & strDbTable & "Forum.Password Is Null) " strSQL = strSQL & "AND (" & strDbTable & "Topic.Hide = " & strDBFalse & " AND " & strDbTable & "Thread.Hide = " & strDBFalse & ") " & _ "ORDER BY " & strDbTable & "Thread.Thread_ID DESC" if strDatabaseType = "mySQL" then strSQL = strSQL & " LIMIT " & intS2HLTLimit end if rsCommon.Open strSQL, adoCon if NOT rsCommon.EOF or NOT rsCommon.BOF then
saryS2HLTRecords = rsCommon.GetRows()
intS2HLTFirst = LBound(saryS2HLTRecords, 2) intS2HLTLast = UBound(saryS2HLTRecords, 2)
end if rsCommon.Close
%>
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center"> <tr class="tableLedger"> <td colspan="5"><span style="float: left;"><%=strTxtS2HLTHeader%></span> </td> </tr><tr class="tableSubLedger"> <td><%=strTxtS2HLTTitleTopic%></td> <td><%=strTxtS2HLTTitleAuthor%></td> <td><%=strTxtS2HLTTitleForum%></td> <td><%=strTxtS2HLTTitleDate%></td> <td><%=DateFormat(dtmS2HLTMessageDate) & " " & strTxtAt & " " & TimeFormat(dtmS2HLTMessageDate)%></td> </tr><% If isArray(saryS2HLTRecords) Then
for iS2HLTLoop = intS2HLTFirst to intS2HLTLast
'RS array lookup table '0 = tblForum.Forum_name '1 = tblTopic.Topic_ID '2 = tblTopic.Subject '3 = tblThread.Thread_ID '4 = tblThread.Message_date '5 = tblAuthor.Author_ID '6 = tblAuthor.Username '7 = tblThread.Message
'Read in db details for RSS feed intS2HLTForumID = saryS2HLTRecords(0, iS2HLTLoop) strS2HLTForumName = saryS2HLTRecords(1, iS2HLTLoop) lngS2HLTTopicID = CLng(saryS2HLTRecords(2, iS2HLTLoop)) strS2HLTTopicTitle = saryS2HLTRecords(3, iS2HLTLoop) lngS2HLTMessageID = CLng(saryS2HLTRecords(4, iS2HLTLoop)) dtmS2HLTMessageDate = CDate(saryS2HLTRecords(5, iS2HLTLoop)) intS2HLTAuthorID = CLng(saryS2HLTRecords(6, iS2HLTLoop)) strS2HLTAuthorName = saryS2HLTRecords(7, iS2HLTLoop)
strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username FROM " & strDbTable & "Thread, " & strDbTable & "Author WHERE " & strDbTable & "Thread.Topic_ID = " & lngS2HLTTopicID & " AND " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID ORDER BY " & strDbTable & "Thread.Thread_ID ASC" rsCommon.Open strSQL, adoCon if NOT rsCommon.EOF or NOT rsCommon.BOF then intS2HLTAuthorID = rsCommon("Author_ID") strS2HLTAuthorName = rsCommon("Username") End if rsCommon.Close
%><tr class="tableRow"> <td><a href="<%=strS2HLTForumPath & "forum_posts.asp?TID=" & lngS2HLTTopicID & "&PID=" & lngS2HLTMessageID & strQsSID2 & SeoUrlTitle(strS2HLTTopicTitle, "&title=") & "#" & lngS2HLTMessageID %>"><%=strS2HLTTopicTitle%></a></td> <td><a rel="nofollow" href="<%=strS2HLTForumPath & "member_profile.asp?PF=" & intS2HLTAuthorID & strQsSID2%>"><%=strS2HLTAuthorName%></a></td> <td><a href="<%=strS2HLTForumPath & "forum_topics.asp?FID=" & intS2HLTForumID & strQsSID2 & SeoUrlTitle(strS2HLTForumName, "&title=") %>"><%=strS2HLTForumName%></a></td> <td><%=DateFormat(dtmS2HLTMessageDate) & " " & strTxtAt & " " & TimeFormat(dtmS2HLTMessageDate)%></td> <td><%=strS2HLTAuthorName%></td> </tr><%
next else %><tr class="tableRow"> <td colspan="5"><%=strTxtS2HLTNoPosts%></td> </tr><% end if %><tr class="tableBottomRow"> <td colspan="5" align="right"><a href="<%=strS2HLTForumPath & "active_topics.asp" & strQsSID1%>"><%=strTxtS2HLTViewNewPosts%></a></td> </tr> </table>
<!-- S2H: "Latest Topics V1.2.0" Modification - http://www.s2h.co.uk/wwf/" rel="nofollow - www.s2h.co.uk/wwf/ -->
|