That was a lot of calls to the DB. And a very good progress on reducing that. I do not use 3.3 but this is the kind of logic I have on 3.2x
if rs.EOF or rs.BOF then
Rem -No Active Topics Found
else
Rem -Get The List of Moded Forums if Moderator
strModedForumList = ""
if cint(mlev) = 3 then
if strDBNTUserName <> "" then 'not likely though
strModedForumList = GetModedForumList(strDBNTUserName)
elseif Session(strCookieURL & "username")<> "" then
strModedForumList = GetModedForumList(strDBNTUserName)
end if
end if
currTopic = 0
currForum = 0
fDisplayCount = 0
do until rs.EOF
if currTopic <> rs("TOPIC_ID") then
if currForum <> rs("FORUM_ID") then
AdminAllowed = 0
blnPrivateForumAllowed = false
Rem -Display if Admin or Forum Modeartor
if mLev = 4 or ((mLev = 3) and Instr(1, strModedForumList, "," & rs("FORUM_ID") & ",", 1) > 0) then
AdminAllowed = 1 : blnPrivateForumAllowed = true
Rem -Not a Private Forum so display
elseif rs("F_PRIVATEFORUMS")= 0 then
blnPrivateForumAllowed = true
Rem -Private Forum so Check authorization
elseif ChkDisplayPrivateForum(rs("FORUM_ID")) then
blnPrivateForumAllowed = true
end if
end if
Rem -Display the forum Title only if different Forum
if currForum <> rs("FORUM_ID") and blnPrivateForumAllowed then
fDisplayCount = fDisplayCount + 1
Rem -BEGIN Display the Forum Title
if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then
Rem -Display Admin Options
elseif (mLev = 3) then
Rem -Display No Admin Options
end if
end if
Rem -END Display the Forum Title
if blnPrivateForumAllowed then
Rem -Display all the details
----
----
Rem -Reset the variable
currForum = rs("FORUM_ID")
currTopic = (rs("TOPIC_ID"))
end if
end if
Rem -Next Record
rs.MoveNext
loop
if fDisplayCount = 0 then
Rem -No Active Topics Found
end if
end if
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Edited by - GauravBhabu on 25 March 2002 09:45:22