| Author |
Topic Search Topic Options
|
feed2cats
Newbie
Joined: 15 February 2003
Location: New Zealand
Status: Offline
Points: 5
|
Post Options
Thanks(0)
Quote Reply
Topic: How to display the latest forum topics? Posted: 15 February 2003 at 9:32pm |
Hi, guys
How to display the latest forum topics on my web page?
Please give me the asp code sample.
Thank you guys
|
 |
TYSON
Groupie
Joined: 18 August 2002
Location: Australia
Status: Offline
Points: 142
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 February 2003 at 11:20pm |
|
For which version of the Forum?
|
|
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 February 2003 at 11:24pm |
<%'Create your connection to the database here strSQL="select TOP 5 Subject, Last_Entry_Date from tblTopic GROUP BY Subject, Last_Entry_Date ORDER BY Last_Entry_Date DESC" Set RS = strConn.Execute(strSQL) IF RS.BOF OR RS.EOF THEN Response.Write("There have been no forum posts made yet.") ELSE WHILE NOT RS.EOF Response.Write rs("Subject") & "<br>" RS.MoveNext WEND END IF 'Close your connection cleanup etc. %>
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 February 2003 at 11:24pm |
|
This example is for the 6.x version. For the 7.x would be similar (don't have the field names in front of me right now.)
|
 |
feed2cats
Newbie
Joined: 15 February 2003
Location: New Zealand
Status: Offline
Points: 5
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 February 2003 at 3:34am |
Hi, michael Thank you for your reply, well, how can I insert your code into a HTML file? my web site structure is:
http://www.mysite.com/main.asp
http://www.mysite.com/forum
So, I want the main.asp shows the the latest 8 posts from every forums, how I can do this?
Thank you so much
|
 |
dolby71
Senior Member
Joined: 27 October 2002
Location: Israel
Status: Offline
Points: 203
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 February 2003 at 3:46pm |
Just doing this:
<%'Create your connection to the database here strSQL="select TOP 5 Subject, Last_Entry_Date from tblTopic GROUP BY Subject, Last_Entry_Date ORDER BY Last_Entry_Date DESC" Set RS = strConn.Execute(strSQL) IF RS.BOF OR RS.EOF THEN Response.Write("There have been no forum posts made yet.") ELSE WHILE NOT RS.EOF Response.Write rs("Subject") & "<br>" RS.MoveNext WEND END IF 'Close your connection cleanup etc. %>
Wherever you wanna show it..
|
 |
serac
Newbie
Joined: 08 July 2003
Location: Antarctica
Status: Offline
Points: 4
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 July 2003 at 10:44am |
Very nice, but anybody know how to create connection to the database and how to close?
'Create your connection to the database here
'Close your connection cleanup etc.
|
 |
MadDog
Mod Builder Group
Joined: 01 January 2002
Status: Offline
Points: 3008
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 July 2003 at 1:33pm |
|
feed2cats, look in the mods forum and you will find a mod for displaying the lastest forum posts on your site.
|
|
|
 |