Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Fix Active Topic Count
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

StephenD
Senior Member

Australia
1044 Posts

Posted - 28 August 2005 :  22:29:11  Show Profile  Send StephenD a Yahoo! Message
Can anyone fix this Mod so that it allows for Private Forums. This is the mod that shows the count() of active topics in the Navigation menu next to the Active link. This is the code out of inc_header.
dim ActiveTopicCount
ActiveTopicCount = -1
if IsEmpty(Session(strCookieURL & "last_here_date")) then
	Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
end if
if not IsNull(Session(strCookieURL & "last_here_date")) then 
	if not blnHiddenForums then

		'## Forum_SQL - Get ActiveTopicCount from DB
		strSql = "SELECT COUNT(" & strTablePrefix & "TOPICS.T_LAST_POST) AS NUM_ACTIVE "
		strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
		strSql = strSql & "WHERE (((" & strTablePrefix & "TOPICS.T_LAST_POST)>'"& Session(strCookieURL & "last_here_date") & "'))"
		strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_STATUS <= 1"

		set rs = my_Conn.Execute(strSql)
			
		if not rs.EOF then
			ActiveTopicCount = rs("NUM_ACTIVE")
		else
			ActiveTopicCount = 0
		end if
	end if
end if


And this is how it is called in subforumnavigation:
	if ActiveTopicCount > 0 then
	Response.Write  "          <a href=""active.asp?Group=1""" & dWStatus("See what topics have been active since your last visit...") & " tabindex=""-1""><acronym title=""See what topics have been active since your last visit..."">Active Topics </a></acronym>" & vbNewline & _
			" (<font color=""" & strDefaultFontColor & """>" & ActiveTopicCount & "</font>)" & vbNewline & _
			"          |" & vbNewline       	
	else
	 Response.Write  "          <a href=""active.asp?Group=1""" & dWStatus("See what topics have been active since your last visit...") & " tabindex=""-1""><acronym title=""See what topics have been active since your last visit..."">Active Topics</a></acronym>" & vbNewline & _
	   		"          |" & vbNewline 
	end if


Currently if a member logs in it will show a count of all active topics on the board regardless of their access and when they go to active.asp it will only show the topics they have access to.

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 29 August 2005 :  05:46:00  Show Profile
Stephen, if you have a search around on this going back a while, you'll find some discussions on the active topic count in the statistics sub of default.asp and why it's not displayed if private forums is turned on. Basically, the only way I can see of doing it is grabbing all the forums from the database, looping through each one to check if the member has access and adding the FORUM_ID to a comma seperated string. Then, in the SQL statement you have above, add a new clause to check if TOPICS.FORUM_ID IN ("&thestring&"). Actually, when I type it out like that, it doesn't seem so complicated, I've obviously missed out something there but no harm in giving it a whirl to see if it works.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.37 seconds. Powered By: Snitz Forums 2000 Version 3.4.07