⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_config_namefilter.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'#################################################################################
'## 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"))
intUsernameID = trim(chkString(Request.QueryString("N_ID"),"SQLString"))

if intUsernameID <> "" then
	if isNumeric(intUsernameID) <> True then intUsernameID = "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 = ""

			if not IsValidString(trim(Request.Form("strUserName"))) then
				Err_Msg = Err_Msg & "<li>None of the following characters can be used in the username  !#$%^&*()=+{}[]|\;:/?>,<' </li>"
			end if

			txtUserName = chkString(Request.Form("strUserName"),"SQLString")
	
			if txtUserName = " " then 
				Err_Msg = Err_Msg & "<li>You Must Enter a UserName to filter.</li>"
			end if

			if (Instr(txtUserName, "  ") > 0 ) then
				Err_Msg = Err_Msg & "<li>Two or more consecutive spaces are not allowed in the UserName.</li>"
			end if

			if Err_Msg = "" then
				'## Forum_SQL - Do DB Update
				strSql = "INSERT INTO " & strFilterTablePrefix & "NAMEFILTER ("
				strSql = strSql & "N_NAME"
				strSql = strSql & ") VALUES ("
				strSql = strSql & "'" & txtUserName & "'"
				strSql = strSql & ")"

				my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

				Application.Lock
				Application(strCookieURL & "STRFILTERUSERNAMES") = ""
				Application.UnLock

				Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>UserName Added!</font></p>" & vbNewLine & _
						"      <meta http-equiv=""Refresh"" content=""1; URL=admin_config_namefilter.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_namefilter.asp"">Back To UserName 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_UserName" then
			'## Forum_SQL - Delete UserName from NameFilter table
			strSql = "DELETE FROM " & strFilterTablePrefix & "NAMEFILTER "
			strSql = strSql & " WHERE N_ID = " & Request.Form("N_ID")

               		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

			Application.Lock
			Application(strCookieURL & "STRFILTERUSERNAMES") = ""
			Application.UnLock

			Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><b>UserName Deleted!</b></font></p>" & vbNewLine & _
					"      <meta http-equiv=""Refresh"" content=""1; URL=admin_config_namefilter.asp"">" & vbNewLine & _
					"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_namefilter.asp"">Back To UserName Filter Configuration</font></a></p>" & vbNewLine
		else
			Response.Write	"      <form action=""admin_config_namefilter.asp?method=Delete"" method=""post"" id=""DeleteUserName"" name=""DeleteUserName"">" & vbNewLine & _
					"      <input type=""hidden"" name=""Method_Type"" value=""Delete_UserName"">" & vbNewLine & _
					"      <input type=""hidden"" name=""N_ID"" value=""" & intUsernameID & """>" & 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"">&nbsp;<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
			Err_Msg = ""

			if not IsValidString(trim(Request.Form("strUserName"))) then
				Err_Msg = Err_Msg & "<li>None of the following characters can be used in the username  !#$%^&*()=+{}[]|\;:/?>,<' </li>"
			end if

			txtUserName = chkString(Request.Form("strUserName"),"SQLString")

			if txtUserName = " " then 
				Err_Msg = Err_Msg & "<li>You Must Enter a UserName.</li>"
			end if

			if (Instr(txtUserName, "  ") > 0 ) then
				Err_Msg = Err_Msg & "<li>Two or more consecutive spaces are not allowed in the UserName.</li>"
			end if

			if Err_Msg = "" then
				'## Forum_SQL - Do DB Update
				strSql = "UPDATE " & strFilterTablePrefix & "NAMEFILTER "
				strSql = strSql & " SET N_NAME = '" & txtUserName & "'"
				strSql = strSql & " WHERE N_ID = " & Request.Form("N_ID")

				my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

				Application.Lock
				Application(strCookieURL & "STRFILTERUSERNAMES") = ""
				Application.UnLock

				Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>UserName Filter Updated!</font></p>" & vbNewLine & _
						"      <meta http-equiv=""Refresh"" content=""1; URL=admin_config_namefilter.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_namefilter.asp"">Back To UserName 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 UserName from DB
			strSql = "SELECT N_ID, N_NAME "
			strSql = strSql & " FROM " & strFilterTablePrefix & "NAMEFILTER "
			strSql = strSql & " WHERE N_ID = " & intUsernameID

			set rs = my_Conn.Execute (strSql)

		        TxtUserName = rs("N_NAME")
		        intN_ID = rs("N_ID")

			rs.close
			set rs = nothing

			Response.Write	"      <form action=""admin_config_namefilter.asp?method=Edit"" method=""post"" id=""UpdateUserName"" name=""UpdateUserName"">" & vbNewLine & _
					"      <input type=""hidden"" name=""Method_Type"" value=""Write_Configuration"">" & vbNewLine & _
					"      <input type=""hidden"" name=""N_ID"" value=""" & intN_ID & """>" & vbNewLine & _
					"      <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
					"        <tr>" & vbNewLine & _
					"          <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
					"            <table border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td align=""center"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Edit UserName</b></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -