strSql = "SELECT "
strSql = strSql & "T.TOPIC_ID, "
strSql = strSql & "T.T_SUBJECT, "
strSql = strSql & "T.T_MESSAGE, "
strSql = strSql & "T.T_DATE, "
strSql = strSql & "T.T_AUTHOR, "
strSql = strSql & "M.MEMBER_ID, "
strSql = strSql & "M.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM F "
strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS T ON "
strSql = strSql & "F.FORUM_ID = T.FORUM_ID) "
strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS M ON "
strSql = strSql & "T.T_AUTHOR = M.MEMBER_ID) "
'I added the "F.F_PRIVATEFORUMS = 0" so that private forums wouldn't be displaid
If SlashForumID <> "ANY" Then
strSql = strSql & " WHERE T.FORUM_ID = " & SlashForumID & " AND F.F_PRIVATEFORUMS = 0"
Else
strSql = strSql & " WHERE F.F_PRIVATEFORUMS = 0"
End If
strSql = strSql & " AND T.FORUM_ID <> " & intFPTestForum
strSql = strSql & " AND T.FORUM_ID <> " & intFPNewsForum
strSql = strSql & " ORDER BY T.T_DATE DESC"
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnString
Set objRS = objConn.Execute(TopSql(strSQL,SlashCount))
Use the TopSql() function. The
above shows how to use it. The function is in forum file "inc_func_common"
I used AnonJrs' code here so dont copy and paste. Just use the first and last lines.
<