Mod : User Level Moderation
Author: Rakesh Jain (GauravBhabu)
Posted: November 29, 2002
Updates:- December 01, 2002 07:40:00
- December 30, 2002
- (To use the intRankLevel0 for Moderation instead of intRankLevel1)
Current Options for Forum Level Moderation:
No Moderation for this forum - Value = 0
All Posts Moderated - value = 1
Original Posts Only Moderated- value = 2
Replies Only Moderated - value = 3
This Mod adds another level for Moderation as below.
The value of 9 is being assigned for this Moderation level.
Moderate New User Posts Only - value = 9
Mod Feature:
With this modification the Admins will be able to set the Forum moderation so that the posts made by new users only will need to be modearated.
Installation Notes:
Modification is required in following files:
- admin_config_ranks.asp - New! Added on 12/30/2002
- inc_header.asp
- inc_func_common.asp
- post.asp
- post_info.asp - Modified! 12/30/2002
- pop_help.asp
Instructions:
Step: 1
File: admin_config_ranks.asp
lines 194-195
Find the following statements
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Number:</b> </font><input type=""text"" name=""intRankLevel0"" size=""5"" value=""0"" readonly>" & vbNewLine & _
" " & getCurrentIcon(strIconSmileQuestion,"(Member who has less than Member Level 1 but more than Starting Member Level posts)","") & "</td>" & vbNewLine & _
Modify the above statements as shown below (Changes are shown in red).
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Number:</b> </font><input type=""text"" name=""intRankLevel0"" size=""5"" value=""" & chkExistElse(intRankLevel0,0) & """>" & vbNewLine & _
" " & getCurrentIcon(strIconSmileQuestion,"(Member who has less than Member Level 1 posts)","") & "</td>" & vbNewLine & _
lines 84-86
Find the following statements
if Request.Form("strRankLevel5") = "" then
Err_Msg = Err_Msg & "<li>You Must Enter a Value for Member Level 5 Name</li>"
end if
Add the following statements below the above statements
numRanklLevel0 = clng(Request.Form("intRankLevel0"))
if (numRanklLevel0) > cLng(Request.Form("intRankLevel1")) then
Err_Msg = Err_Msg & "<li>Rank Level 0 can not be higher than 1</li>"
elseif (numRanklLevel0) > cLng(Request.Form("intRankLevel2")) then
Err_Msg = Err_Msg & "<li>Rank Level 0 can not be higher than 2</li>"
elseif (numRanklLevel0) > cLng(Request.Form("intRankLevel3")) then
Err_Msg = Err_Msg & "<li>Rank Level 0 can not be higher than 3</li>"
elseif (numRanklLevel0) > cLng(Request.Form("intRankLevel4")) then
Err_Msg = Err_Msg & "<li>Rank Level 0 can not be higher than 4</li>"
elseif (numRanklLevel0) > cLng(Request.Form("intRankLevel5")) then
Err_Msg = Err_Msg & "<li>Rank Level 0 can not be higher than 5</li>"
end if
Step: 2
File: inc_header.asp
lines 39-41
Find the following statement
%>
<!--#INCLUDE FILE="inc_func_common.asp" -->
<%
Add the statements in red as shown below:
%>
<!--#INCLUDE FILE="inc_func_common.asp" -->
<%
dim numMPostCount
numMPostCount = 0
Step: 3
File: inc_func_common.asp
Lines: 877-919
Modify/Add the statements within the following function as shown in red.
function chkUser(fName, fPassword, fAuthor)
dim rsCheck
dim strSql
'## Forum_SQL
strSql = "SELECT MEMBER_ID, M_LEVEL, M_NAME, M_PASSWORD, M_POSTS "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(fName, "SQLString") & "' "
if strAuthType="db" then
strSql = strSql & " AND M_PASSWORD = '" & ChkString(fPassword, "SQLString") &"'"
End If
strSql = strSql & " AND M_STATUS = " & 1
Set rsCheck = my_Conn.Execute(strSql)
if rsCheck.BOF or rsCheck.EOF or not(ChkQuoteOk(fName)) or not(ChkQuoteOk(fPassword)) then
MemberID = -1
chkUser = 0 '## Invalid Password
if strDBNTUserName <> "" and chkCookie = 1 then
Call ClearCookies()
strDBNTUserName = ""
end if
else
numMPostCount = rsCheck("M_POSTS")
MemberID = rsCheck("MEMBER_ID")
if (rsCheck("MEMBER_ID") & "" = fAuthor & "") and (cLng(rsCheck("M_LEVEL")) <> 3) then
chkUser = 1 '## Author
else
select case cLng(rsCheck("M_LEVEL"))
case 1
chkUser = 2 '## Normal User
case 2
chkUser = 3 '## Moderator
case 3
chkUser = 4 '## Admin
case else
chkUser = cLng(rsCheck("M_LEVEL"))
end select
end if
end if
rsCheck.close
set rsCheck = nothing
end function
Step: 4
File: post.asp
Lines 1037-1040
Find the following statements:
if ForumModeration = 3 then
Response.Write " selected "
end if
Response.Write " value=""3"">Replies Only Moderated</option>" & vbNewLine
Add the following statements just below the above statements
Response.Write " <option"
if ForumModeration = 9 then
Response.Write " selected "
end if
Response.Write " value=""9"">Moderate New User Posts Only </option>" & vbNewLine
Step: 5
File: post_info.asp
Lines 308-322
Add the satements on in red as shown below:
if MethodType <> "Forum" then
'## Moderators and Admins are not subject to Moderation
if (strModeration = 0) or (mlev = 4) or _
(chkForumModerator(Forum_ID, strDBNTUserName) = "1") then
Moderation = "No"
'## Is Moderation allowed on the category?
elseif CatModeration = 1 then
'## if this is a topic, is forum moderation set to all posts or topic?
if (ForumModeration = 1 or ForumModeration = 2) and (MethodType = "Topic") then
Moderation = "Yes"
'## if this is a reply, is forum moderation set to all posts or reply?
elseif (ForumModeration = 1 or ForumModeration = 3) and (MethodType <> "Topic") then
Moderation = "Yes"
elseif (ForumModeration = 9) and (numMPostCount <= clng(intRankLevel0)) then
Moderation = "Yes"
end if
end if
end if
Step: 6
File: pop_help.asp
Lines 131
Find the following statement
" <b>Replies Only Moderated:</b> This option allows you to moderate only the replies that are posted to the forum. New topics are not moderated.<br /><br />" & vbNewLine & _
Add the following statement just below the above statement:
" <b>Moderate New User Posts Only:</b> With this option, the posts made by New Members only will need to be moderated.<br /><br />" & vbNewLine & _
Note: Make sure the above statement is on one line only.
Post help questions in the help forums - Help: Mod user Level Moderation