Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Mod Request: Latest 5-10 posts
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mod Request: Latest 5-10 posts

 Post Reply Post Reply Page  <12
Author
Epperson View Drop Down
Newbie
Newbie


Joined: 08 November 2003
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote Epperson Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2006 at 4:49am

 

Line 781 after the </tr> paste this code
 
 
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
 <% If strDatabaseType = "Access" Then %>
<tr class="tableLedger">
  <td colspan="5">Latest Posts</td>
 </tr>
 <tr class="tableSubLedger">
    <td width="38%" align="center">Topic</td>
    <td width="19%" align="center">Forum</td>
    <td width="15%" align="center">Author</td>
    <td width="21%" align="center">Date</td>
    <td width="7%" align="center">Views</td>
  </tr>
<%
Dim rsLatestPosts
Dim intSay
Dim rsLatestPosts2
Dim sql2
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


For intSay = 1 to 5
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)


Response.Write "<tr class=""tableRow""><td><a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & """><img border=""0"" src=""" & strImagePath & "right_arrow.gif"" /></a>&nbsp;<a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & "&get=last#" & rsLatestPosts("Last_Thread_ID") & """>" & rsLatestPosts("Subject") & "</a></td><td><a href=""forum_topics.asp?FID=" & rsLatestPosts("Forum_ID") & """>" & rsLatestPosts("Forum_name") & "</a></td><td align=""center"">"&rsLatestPosts2("Username") &"</td><td align=""center"">" & LastLatestPostsDate & "-" & LastLatestPostsTime & "</td><td align=""center"">" & rsLatestPosts("No_of_views") & "</td></tr>"

rsLatestPosts.MoveNext
Next
end if

'Clean up
Call closeDatabase()

%>

Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2006 at 6:42am
Any reason why you are creating two completely unnecessary Recordsets?
Back to Top
Epperson View Drop Down
Newbie
Newbie


Joined: 08 November 2003
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote Epperson Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2006 at 7:21pm
I have no clue, it just worked.
I have very little knowledge in this other than copy and paste:)
 
I would change it if I could.
Back to Top
bims View Drop Down
Groupie
Groupie
Avatar

Joined: 03 May 2004
Location: United Kingdom
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote bims Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2006 at 10:34pm
Would love to know how to include this in other areas of my site.

Back to Top
oguzhanosman View Drop Down
Newbie
Newbie


Joined: 31 August 2005
Location: Turkey
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote oguzhanosman Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2006 at 6:11pm
Thanks Epperson..Smile
İt is very good.
Heart
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.