I AM NOT claiming this, this is AznKnights script, I just switched a thing or two around so it'd work with the normal layout.
Add the below to the VERY BOTTOM of inc_top.asp
<%
Sub ATCount()
'### Added by Da_Stimulator
'## Forum_SQL - Get ActiveTopicCount from DB
strSql = "SELECT COUNT(" & strTablePrefix & "TOPICS.T_LAST_POST) AS NUM_ACTIVE"
strSql = strSql & " FROM " & strTablePrefix & "TOPICS inner join " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " ON " & strTablePrefix & "TOPICS.T_LAST_POST > " & strMemberTablePrefix & "MEMBERS.M_LASTHEREDATE "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS." & Strdbntsqlname & " = '" & strDBNTUserName & "' "
dim rsActive
set rsActive = server.CreateObject("adodb.recordset")
set rsActive = my_Conn.Execute(strSql)
if not rsActive.EOF then
ActiveTopicCount = rsActive("NUM_ACTIVE")
else
ActiveTopicCount = 0
end if
Response.Write "(" & ActiveTopicCount & ")"
rsActive.Close
set rsActive = nothing
'### End added
End Sub
%>
Then all you do is add a little '<%Call ATCount()%>' where you want the number of active topics to appear... Mine looks like the below
|
<a href="active.asp"><acronym title="See what topics have been active since your last visit...">Active Topics<%Call ATCount()%></acronym></a>
|
You can view mine at http://www.stormwhispers.com/snitz_testing/
Again this is Aznknights code.
----
Da_Stimulator
Snitz Forums Dev Team Member
http://stimmy.cfm-resources.com/forum - my testing forums.