OK, I cracked it. This is my sub now:sub DisplayActiveTopics(byval Width, byval Count)
dim strSql
dim rsActive
dim Topic_ID,strSubject,Topic_Replies,Topic_Last_Post_Reply_ID
Call StartTable(Width, "Active Topics")
strSql = "SELECT"
strSql = strSql & " T.TOPIC_ID,"
strSql = strSql & " T.T_REPLIES,"
strSql = strSql & " T.T_SUBJECT,"
strSql = strSql & " T.T_LAST_POST,"
strSql = strSql & " T.T_LAST_POST_AUTHOR,"
strSql = strSql & " T.T_LAST_POST_REPLY_ID"
strSql = strSql & " FROM " & strTablePrefix & "TOPICS T," & strTablePrefix & "FORUM F"
strSql = strSql & " WHERE T.FORUM_ID = F.FORUM_ID"
'strSql = strSql & " AND F.F_PRIVATEFORUMS = 0"
strSql = strSql & " AND T.T_STATUS = 1"
strSql = strSql & " ORDER BY T_LAST_POST DESC"
Set rsActive = my_conn.Execute(TopSQL(strSql, Count))
If NOT rsActive.EOF Then
Do While NOT rsActive.EOF
Response.Write("<DIV class=""listitem2"">" & getCurrentIcon(strIconArrows,"Jump to Topic","") & " " & "<a href=""topic.asp?TOPIC_ID="& rsActive.fields("TOPIC_ID").value &""">"& rsActive.fields("T_SUBJECT").value & "</a>")
Response.Write("<br /><i>" & "Last Post by " & getMemberName(rsActive.fields("T_LAST_POST_AUTHOR").value) & " on " & RemoveYear(ChkDate(rsActive.Fields("T_LAST_POST").Value,"",true)) & " " & DoLastPostLink & "</i></DIV><br />")
rsActive.MoveNext
Loop
End If
rsActive.Close
Set rsActive = Nothing
Response.Write "<a href=""xyzrssfeed.asp"" tabindex=""-1"" target=""_blank"">" & getCurrentIcon(strIconXML,"Active Topics RSS Feed","align=""right""")& "</a>" &vbCrLf
Call EndTable()
end sub
I had to include the DoLastPostLink function at the end of portal.asp.
This is what it outputs now:
For those that are interested I've got a function that strips the year out of the long date format:Function RemoveYear(pString)
fString = trim(pString)
fString = Replace(fString, "2004", "")
fString = Replace(fString, "2005", "")
fString = Replace(fString, "2006", "")
RemoveYear = fString
end Function
Many hours trial and error guys...