<% ' CheckforUnmoderatedPosts - This function will check for unmoderated posts by ' Board, Category or Forum function CheckForUnmoderatedPosts(CType, CatID, ForumID, TopicID) Dim PostCount PostCount = 0 if strModeration > 0 then ' Check the Topics Table first StrSql = "Select Count(*) as PostCount" StrSql = StrSql & " FROM " & strTablePrefix & "TOPICS T" if CType = "CAT" then StrSql = StrSql & " WHERE T.CAT_ID = " & CatID & " AND T.T_STATUS > 1 " elseif CType = "FORUM" then StrSql = StrSql & " WHERE T.FORUM_ID = " & ForumID & " AND T.T_STATUS > 1 " elseif CType = "TOPIC" then StrSql = StrSql & " WHERE T.TOPIC_ID = " & TopicID & " AND T.T_STATUS > 1 " elseif CType = "POSTAUTHOR" then postcount = 0 StrSql = StrSql & " WHERE T.T_AUTHOR = " & MemberID & " AND T.T_STATUS > 1 AND T.TOPIC_ID = " & TopicID end if if CType = "BOARD" then StrSql = StrSql & ", " & strTablePrefix & "CATEGORY C" StrSql = StrSql & ", " & strtablePrefix & "FORUM F" ' This line makes sure that moderation is still set in the Category StrSql = StrSql & " WHERE T.CAT_ID = C.CAT_ID AND C.CAT_MODERATION > 0" ' This line makes sure that moderation is still set to all posts or topic in the Forum StrSql = StrSql & " AND T.FORUM_ID = F.FORUM_ID AND F.F_MODERATION in (1,2)" & " AND T.T_STATUS > 1 " end if set rsCheck = my_Conn.Execute(strSql) if not rsCheck.EOF then PostCount = rsCheck("PostCount") else PostCount = 0 end if if PostCount = 0 then ' If no unmoderated posts are found on the topic table, check the replies..... StrSql = "Select Count(*) as PostCount" StrSql = StrSql & " FROM " & strTablePrefix & "REPLY R" if CType = "CAT" then StrSql = StrSql & " WHERE R.CAT_ID = " & CatID & " AND R.R_STATUS > 1 " elseif CType = "FORUM" then StrSql = StrSql & " WHERE R.FORUM_ID = " & ForumID & " AND R.R_STATUS > 1 " elseif CType = "TOPIC" then StrSql = StrSql & " WHERE R.TOPIC_ID = " & TopicID & " AND R.R_STATUS > 1 " elseif cType = "POSTAUTHOR" then StrSql = StrSql & " WHERE R.R_AUTHOR = " & MemberID & " AND R.R_STATUS > 1 AND R.TOPIC_ID = " & TopicID end if if CType = "BOARD" then StrSql = StrSql & ", " & strTablePrefix & "CATEGORY C" StrSql = StrSql & ", " & strtablePrefix & "FORUM F" ' This line makes sure that moderation is still set in the Category StrSql = StrSql & " WHERE R.CAT_ID = C.CAT_ID AND C.CAT_MODERATION > 0" ' This line makes sure that moderation is still set to all posts or reply in the Forum StrSql = StrSql & " AND R.FORUM_ID = F.FORUM_ID AND F.F_MODERATION in (1,3)" & " AND R.R_STATUS = 2 " end if set rsCheck = my_Conn.Execute(strSql) if not rsCheck.EOF then PostCount = rsCheck("PostCount") else PostCount = 0 end if end if rsCheck.close set rsCheck = nothing end if CheckForUnModeratedPosts = PostCount end function %>