here is the code:
if intgroupid<>2 then
%><table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td colspan="5">Last Topics</td>
</tr>
<tr class="tableSubLedger">
<td width="30%" align="center">Forum</td>
<td width="40%" align="center">Topic</td>
<td width="10%" align="center">User</td>
<td width="10%" align="center">Reply</td>
<td width="10%" align="center">Read</td>
</tr>
<%
Dim intcount
strSql = "Select tblTopic.Subject, tblTopic.Topic_ID, tblForum.Forum_ID, tblForum.Forum_name, tblTopic.Last_Thread_ID, tblTopic.No_of_views, tbltopic.no_of_replies, tblAuthor.Author_ID, tblAuthor.Username "
strSql = strSql & "From tblTopic, tblForum, tblthread, tblAuthor Where tblTopic.Hide = 0 And tblTopic.Forum_ID = tblForum.Forum_ID AND tblthread.thread_ID =tblTopic.Last_Thread_ID AND tblAuthor.Author_ID =tblthread.Author_ID Order By tblTopic.Last_Thread_ID desc"
rscommon.Open strSQL, adoCon
For intcount = 1 to 10
if rscommon.Eof Then Exit For
Response.Write "<tr class=""tableRow""><td><a href=""forum_topics.asp?FID=" & rsCommon("Forum_ID") & """ title=""Main forum page"">" & rsCommon("Forum_name") & "</a></td><td><a href=""forum_posts.asp?TID=" & rsCommon("Topic_ID") & """><img border=""0"" src=""" & strImagePath & "right_arrow.gif"" alt=""Last message"" /></a> <a href=""forum_posts.asp?TID=" & rsCommon("Topic_ID") & "&get=last#" & rsCommon("Last_Thread_ID") & """ title=""Show Topic"">" & rsCommon("Subject") & "</a></td><td align=""center""><a href=""member_profile.asp?PF=" & rsCommon("Author_ID") & """ title=""User"">" & rsCommon("username") & "</a></td><td align=""center"">" & rsCommon("no_of_replies") & "</td><td align=""center"">" & rsCommon("No_of_views") & "</td></tr>"
rsCommon.MoveNext
Next
rscommon.close
%></table>
else
response.write("You have not permission to see last ten posts!")
end if