HELP!!!!!!
I have a problem in useing the following script, that displays the latest topics on any page on my website - regarding the 7.0 Beta 3 version
The problem is, that I only want it to display newest topics, but as it is now, it jumpes for topics to topic, every time some one replies to the topic!!! Even though the topic i months old!!!!
Want do I need to chance in the script, to make it ONLY display the new topics???
Please help!!!
The script:
<%
Dim rsLastestPosts
Dim strPosts
Dim adoCon
Dim strCon
Dim strSQL
'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Database connection info and driver
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=; DBQ=" & Server.MapPath("../forum/admin/database/XXX.mdb")
'Set an active connection to the Connection object
adoCon.Open strCon
Set rsLastestPosts = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT Top 15 tblTopic.*, tblForum.* "
strSQL = strSQL & "FROM tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID "
strSQL = strSQL & "WHERE ((tblForum.Password) Is Null) "
strSQL = strSQL & "ORDER BY tblTopic.Last_entry_date DESC;"
rsLastestPosts.Open strSQL, strCon
If rsLastestPosts.EOF Then Response.Write "Ingen nye indlęg"
Do while NOT rsLastestPosts.EOF
If len(rsLastestPosts("Subject"))>14 then
strPosts = left(rsLastestPosts("Subject"),14) & "... "
Else
strPosts = rsLastestPosts("Subject")
End If
%>
<a href="forum_posts.asp?TID=<% = rsLastestPosts("Topic_ID") %>" target="_self"><% = strPosts %></a>
<%
rsLastestPosts.MoveNext
Loop
rsLastestPosts.Close
Set rsLastestPosts = Nothing
adoCon.Close
Set adoCon = Nothing
Set strCon = Nothing
%>
Thank you for helping! :O)
Edited by klr3