📄 admin_config_badwords.asp
字号:
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.05
'#################################################################################
'## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header_short.asp" -->
<%
if Session(strCookieURL & "Approval") <> "15916941253" then
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login_short.asp?target=" & scriptname(ubound(scriptname))
end if
strRqMethod = trim(chkString(Request.QueryString("method"),"SQLString"))
intBadwordID = trim(chkString(Request.QueryString("B_ID"),"SQLString"))
if intBadwordID <> "" then
if isNumeric(intBadwordID) <> True then intBadwordID = "0"
end if
strPageSize = 10
mypage = trim(chkString(request("whichpage"),"SQLString"))
if ((mypage = "") or (IsNumeric(mypage) = FALSE)) then mypage = 1
mypage = cLng(mypage)
Response.Write " <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
" <!-----" & vbNewLine & _
" function jumpToPage(s) {location.href = s.options[s.selectedIndex].value}" & vbNewLine & _
" // -->" & vbNewLine & _
" </script>" & vbNewLine
Select Case strRqMethod
Case "Add"
if Request.Form("Method_Type") = "Write_Configuration" then
Err_Msg = ""
txtBadword = chkBString(Request.Form("strBadword"),"SQLString")
txtReplace = chkBString(Request.Form("strReplace"),"SQLString")
if txtBadword = " " then
Err_Msg = Err_Msg & "<li>You Must Enter a Badword.</li>"
end if
if txtBadword = "" then
Err_Msg = Err_Msg & "<li>You Must Enter a Badword.</li>"
end if
if (Instr(txtBadword, " ") > 0 ) then
Err_Msg = Err_Msg & "<li>Two or more consecutive spaces are not allowed in the Badword.</li>"
end if
if txtReplace = " " then
Err_Msg = Err_Msg & "<li>You Must Enter a Replacement word for the Badword.</li>"
end if
if txtReplace = "" then
Err_Msg = Err_Msg & "<li>You Must Enter a Replacement word for the Badword.</li>"
end if
if (Instr(txtReplace, " ") > 0 ) then
Err_Msg = Err_Msg & "<li>Two or more consecutive spaces are not allowed in the Replacement word.</li>"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "INSERT INTO " & strFilterTablePrefix & "BADWORDS ("
strSql = strSql & "B_BADWORD"
strSql = strSql & ", B_REPLACE"
strSql = strSql & ") VALUES ("
strSql = strSql & "'" & txtBadword & "'"
strSql = strSql & ", '" & txtReplace & "'"
strSql = strSql & ")"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Application.Lock
Application(strCookieURL & "STRBADWORDWORDS") = ""
Application(strCookieURL & "STRBADWORDREPLACE") = ""
Application.UnLock
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Badword Added!</font></p>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""1; URL=admin_config_badwords.asp"">" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Congratulations!</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_badwords.asp"">Back To Badword Filter Configuration</font></a></p>" & vbNewLine
else
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
" <table align=""center"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
end if
end if
Case "Delete"
if Request.Form("Method_Type") = "Delete_Badword" then
'## Forum_SQL - Delete badword from Badwords table
strSql = "DELETE FROM " & strFilterTablePrefix & "BADWORDS "
strSql = strSql & " WHERE B_ID = " & Request.Form("B_ID")
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Application.Lock
Application(strCookieURL & "STRBADWORDWORDS") = ""
Application(strCookieURL & "STRBADWORDREPLACE") = ""
Application.UnLock
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><b>Badword Deleted!</b></font></p>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""1; URL=admin_config_badwords.asp"">" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_badwords.asp"">Back To Badword Filter Configuration</font></a></p>" & vbNewLine
else
Response.Write " <form action=""admin_config_badwords.asp?method=Delete"" method=""post"" id=""UpdateBWord"" name=""UpdateBWord"">" & vbNewLine & _
" <input type=""hidden"" name=""Method_Type"" value=""Delete_Badword"">" & vbNewLine & _
" <input type=""hidden"" name=""B_ID"" value=""" & intBadwordID & """>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><b>Are you sure?</b></font></p>" & vbNewLine & _
" <p align=""center""><input type=""submit"" class=""button"" value=""Yes"" id=""submit1"" name=""submit1""> <input type=""button"" class=""button"" value="" No "" onClick=""history.go(-1);""></p>" & vbNewLine & _
" </form>" & vbNewLine
end if
Case "Edit"
if Request.Form("Method_Type") = "Write_Configuration" then
txtBadword = chkBString(Request.Form("strBadword"),"SQLString")
txtReplace = chkBString(Request.Form("strReplace"),"SQLString")
if txtBadword = " " then
Err_Msg = Err_Msg & "<li>You Must Enter a Badword.</li>"
end if
if (Instr(txtBadword, " ") > 0 ) then
Err_Msg = Err_Msg & "<li>Two or more consecutive spaces are not allowed in the Badword.</li>"
end if
if txtReplace = " " then
Err_Msg = Err_Msg & "<li>You Must Enter a Replacement word for the Badword.</li>"
end if
if (Instr(txtReplace, " ") > 0 ) then
Err_Msg = Err_Msg & "<li>Two or more consecutive spaces are not allowed in the Replacement word.</li>"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strFilterTablePrefix & "BADWORDS "
strSql = strSql & " SET B_BADWORD = '" & txtBadword & "'"
strSql = strSql & ", B_REPLACE = '" & txtReplace & "'"
strSql = strSql & " WHERE B_ID = " & Request.Form("B_ID")
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Application.Lock
Application(strCookieURL & "STRBADWORDWORDS") = ""
Application(strCookieURL & "STRBADWORDREPLACE") = ""
Application.UnLock
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Badword Filter Updated!</font></p>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""1; URL=admin_config_badwords.asp"">" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Congratulations!</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_badwords.asp"">Back To Badword Filter Configuration</font></a></p>" & vbNewLine
else
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
" <table align=""center"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
end if
else
'## Forum_SQL - Get Badword/Replacement word from DB
strSql = "SELECT B_ID, B_BADWORD, B_REPLACE "
strSql = strSql & " FROM " & strFilterTablePrefix & "BADWORDS "
strSql = strSql & " WHERE B_ID = " & intBadwordID
set rs = my_Conn.Execute (strSql)
TxtBadword = rs("B_BADWORD")
TxtReplace = rs("B_REPLACE")
intB_ID = rs("B_ID")
rs.close
set rs = nothing
Response.Write " <form action=""admin_config_badwords.asp?method=Edit"" method=""post"" id=""UpdateBWord"" name=""UpdateBWord"">" & vbNewLine & _
" <input type=""hidden"" name=""Method_Type"" value=""Write_Configuration"">" & vbNewLine & _
" <input type=""hidden"" name=""B_ID"" value=""" & intB_ID & """>" & vbNewLine & _
" <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -