This mod shows the latest x postings and can be placed in the default.
1:
Copy the following text and save this as mod_latest_posts.asp in the includes.
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td colspan="4">Recente berichten</td>
</tr>
<tr class="tableSubLedger">
<td width="40%"><% = strTxtTopics %></td>
<td width="20%" align="center"><% = strTxtForum %></td>
<td width="20%" align="center"><% = strTxtAuthor %></td>
<td width="20%" align="center"><% = strTxtDatePosted %></td>
</tr>
<%
'Mod by Venky, http://venki.seccomnetworks.net, hrvojevencl@gmail.com
'reset some variavles
intTempRecord = 0
intTotalRecords = 0
strSQL = "SELECT "
If strDatabaseType = "SQLServer" OR strDatabaseType = "Access" Then strSQL = strSQL & " TOP 15 "
strSQL = strSQL & strDbTable & "Thread.Thread_ID, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Thread.Message, " & strDbTable & "Topic.Subject, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Author.Username, " & strDbTable & "Forum.Forum_name " & _
"FROM " & strDbTable & "Topic" & strDBNoLock & ", " & strDbTable & "Thread" & strDBNoLock & ", " & strDbTable & "Author" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Permissions " & strDBNoLock & " " & _
"WHERE " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID " & _
"AND " & strDbTable & "Topic.Topic_ID = " & strDbTable & "Thread.Topic_ID " & _
"AND " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID " & _
"AND " & strDbTable & "Topic.Last_Thread_ID = " & strDbTable & "Thread.Thread_ID " & _
"AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Permissions.Forum_ID " & _
"AND ((" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ") AND " & strDbTable & "Permissions.View_Forum = " & strDBTrue & ") " & _
"AND (" & strDbTable & "Forum.Password = '' OR " & strDbTable & "Forum.Password Is Null) AND (" & strDbTable & "Topic.Hide = " & strDBFalse & " AND " & strDbTable & "Thread.Hide = " & strDBFalse & ") "
'Order by cluase
strSQL = strSQL & " ORDER BY " & strDbTable & "Thread.Message_date DESC "
If strDatabaseType = "mySQL" Then strSQL = strSQL & " LIMIT 15 "
strSQL = strSQL & ";"
'Set error trapping
On Error Resume Next
'Query the database
rsCommon.Open strSQL, adoCon
'If an error has occured write an error to the page
If Err.Number <> 0 Then Call errorMsg("An error has occured while executing SQL query on database.", "get_last_USR_+_count", "default.asp")
'Disable error trapping
On Error goto 0
'Place the recordset into an array
If NOT rsCommon.EOF Then
'Read the recordset into an array
saryLastPosts = rsCommon.GetRows()
'read total records
intTotalRecords = Ubound(saryLastPosts,2) + 1
End If
'Close recordset
rsCommon.close
'saryMembersToday(2, intTempRecord)
'display
if intTotalRecords = 0 then
Response.Write("<tr class=""tableRow""><td colspan=""3"">" & strTxtNoForumPostMade & "</td></tr>")
else
Do While intTempRecord < intTotalRecords
saryLastPosts(2, intTempRecord) = removeHTML(saryLastPosts(2, intTempRecord), 150, true)
Response.Write "<tr class=""tableRow""><td><a href=""forum_posts.asp?TID=" & saryLastPosts(1, intTempRecord) & """><img border=""0"" src=""" & strImagePath & "right_arrow.gif"" /></a> <a href=""forum_posts.asp?TID=" & saryLastPosts(1, intTempRecord) & "&get=last#" & saryLastPosts(0, intTempRecord) & """ title=""" & formatInput(saryLastPosts(2, intTempRecord)) & """>" & formatInput(saryLastPosts(3, intTempRecord)) & "</a></td><td align=""center"">" & saryLastPosts(7, intTempRecord) & "</td><td align=""center""><a href=""member_profile.asp?PF=" & saryLastPosts(4, intTempRecord) & """ oncontextmenu=""ShowUserMenu('" & saryLastPosts(4, intTempRecord) & "', '" & saryLastPosts(6, intTempRecord) & "'); return false;"">" & saryLastPosts(6, intTempRecord) & "</a></td><td align=""center"">" & DateFormat(saryLastPosts(5, intTempRecord)) & " - " & TimeFormat(saryLastPosts(5, intTempRecord)) & "</td></tr>"
'Move to next record
intTempRecord = intTempRecord + 1
Loop
End if
%>
</table>