Here's my quick and very dirty workaround for the subforum column headers being displayed in the parent forum when all the subforums are invisible to the user. The right way is of course to rewrite the sub ListSubForums so that it doesn't write the column headers right off the bat, only if there's at least one subforum visible to the user.
I didn't want to rewrite the entire ListSubForums sub so I just wrote a function to check to see if there are any subforums visible to the user and if not to exit that sub.
Function OneVisibleForum(FORUM_ID)
' Is there at least one visible forum under this parent?
OneVisibleForum = false
strSQL = "SELECT F.FORUM_ID, F.F_PRIVATEFORUMS, F.F_PASSWORD_NEW " & _
"FROM " & strTablePrefix & "FORUM F " & _
"WHERE F.F_PARENT = " & FORUM_ID & " AND F.F_TYPE = 0;"
set rs = my_Conn.Execute(strSQL)
if not rs.eof then
do until rs.eof
intPrivateForum = rs("F_PRIVATEFORUMS")
strPasswordNew = rs("F_PASSWORD_NEW")
intForumID = rs("FORUM_ID")
intMemberID = getMemberID(strDBNTUserName)
if intMemberID = 0 then intMemberID = -1
if chkDisplayForum(intPrivateForum, strPasswordNew, intForumID, intMemberID) then
OneVisibleForum = true
exit do
end if
rs.movenext
loop
end if
set rs = nothing
end Function
Then I use this like so
sub ListSubForums(FORUM_ID)
If Not OneVisibleForum(FORUM_ID) then Exit Sub
etc., etc.<