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

📄 admin_config_namefilter.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 2 页
字号:
					"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Username</b></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><input size=""25"" maxLength=""25"" name=""strUserName"" value=""" & TxtUserName & """ tabindex=""1""></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><input type=""submit"" class=""button"" value=""Update"" id=""submit1"" name=""submit1"" tabindex=""2""> <input type=""reset"" class=""button"" value=""Reset"" id=""reset1"" name=""reset1""></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"            </table>" & vbNewLine & _
					"          </td>" & vbNewLine & _
					"        </tr>" & vbNewLine & _
					"      </table>" & vbNewLine & _
					"      </form>" & vbNewLine & _
					"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_namefilter.asp"">Back To UserName Filter Configuration</font></a></p>" & vbNewLine
		end if
	Case Else
		'## Forum_SQL - Get UserNames from DB
		strSql = "SELECT N_ID, N_NAME " 
		strSql2 = " FROM " & strFilterTablePrefix & "NAMEFILTER "
		strSql3 = " ORDER BY N_NAME ASC "

		if strDBType = "mysql" then 'MySql specific code
			if mypage > 1 then 
				OffSet = cLng((mypage - 1) * strPageSize)
				strSql4 = " LIMIT " & OffSet & ", " & strPageSize & " "
			end if

			'## Forum_SQL - Get the total pagecount 
			strSql1 = "SELECT COUNT(N_ID) AS PAGECOUNT "

			set rsCount = my_Conn.Execute(strSql1 & strSql2)
			iPageTotal = rsCount(0).value
			rsCount.close
			set rsCount = nothing

			If iPageTotal > 0 then
				maxpages = (iPageTotal \ strPageSize )
				if iPageTotal mod strPageSize <> 0 then
					maxpages = maxpages + 1
				end if
				if iPageTotal < (strPageSize + 1) then
					intGetRows = iPageTotal
				elseif (mypage * strPageSize) > iPageTotal then
					intGetRows = strPageSize - ((mypage * strPageSize) - iPageTotal)
				else
					intGetRows = strPageSize
				end if
			else
				iPageTotal = 0
				maxpages = 0
			end if 

			if iPageTotal > 0 then
				set rs = Server.CreateObject("ADODB.Recordset")
				rs.open strSql & strSql2 & strSql3 & strSql4, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
					arrUsernameData = rs.GetRows(intGetRows)
					iUsernameCount = UBound(arrUsernameData, 2)
				rs.close
				set rs = nothing
			else
				iUsernameCount = ""
			end if
 
		else 'end MySql specific code

			set rs = Server.CreateObject("ADODB.Recordset")
			rs.cachesize = strPageSize
			rs.open strSql & strSql2 & strSql3, my_Conn, adOpenStatic
				If not (rs.EOF or rs.BOF) then
					rs.movefirst
					rs.pagesize = strPageSize
					rs.absolutepage = mypage '**
					maxpages = cLng(rs.pagecount)
					arrUsernameData = rs.GetRows(strPageSize)
					iUsernameCount = UBound(arrUsernameData, 2)
				else
					iUsernameCount = ""
				end if
			rs.Close
			set rs = nothing
		end if

		Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><b>UserName Filter Configuration</b></font></p>" & vbNewLine
		Response.Write	"      <form action=""admin_config_namefilter.asp?method=Add"" method=""post"" id=""Add"" name=""Add"">" & vbNewLine & _
				"      <input type=""hidden"" name=""Method_Type"" value=""Write_Configuration"">" & vbNewLine & _
				"      <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
				"        <tr>" & vbNewLine & _
				"          <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
				"            <table width=""100%"" align=""center"" border=""0"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
				"              <tr>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strCategoryCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>UserName</font></b></td>" & vbNewLine
		if maxpages > 1 then
			Call DropDownPaging()
		else
			Response.Write	"                <td align=""center"" bgcolor=""" & strCategoryCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>&nbsp;</font></b></td>" & vbNewLine
		end if
		Response.Write	"              </tr>" & vbNewLine

		if iUsernameCount = "" then  '## No Badwords found in DB
			Response.Write	"              <tr>" & vbNewLine & _
        				"                <td bgcolor=""" & strForumFirstCellColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """ valign=""top""><b>No UserNames Found</b></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine
		else
			nN_ID = 0
			nN_NAME = 1

			rec = 1
			intI = 0

			for iUsername = 0 to iUsernameCount
				if (rec = strPageSize + 1) then exit for

				Username_ID = arrUsernameData(nN_ID, iUsername)
				Username_Name = arrUsernameData(nN_NAME, iUsername)

				if intI = 1 then 
					CColor = strAltForumCellColor
				else
					CColor = strForumCellColor
				end if

				Response.Write	"              <tr>" & vbNewLine & _
						"                <td bgcolor=""" & CColor & """ valign=""middle"" align=""center""><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & Username_Name & "</font></td>" & vbNewLine & _
						"                <td bgcolor=""" & CColor & """ valign=""middle"" align=""center"" nowrap><a href=""admin_config_namefilter.asp?method=Edit&N_ID=" & Username_ID & """>" & getCurrentIcon(strIconPencil,"Edit UserName","hspace=""0""") & "</a>&nbsp;<a href=""admin_config_namefilter.asp?method=Delete&N_ID=" & Username_ID & """>" & getCurrentIcon(strIconTrashcan,"Delete UserName","hspace=""0""") & "</a></td>" & vbNewLine & _
						"              </tr>" & vbNewLine
				rec = rec + 1
				intI = intI + 1
				if intI = 2 then
					intI = 0
				end if
			next
		end if

		Response.Write	"              <tr valign=""middle"">" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><input size=""25"" maxLength=""25"" name=""strUserName"" value=""" & TxtUserName & """ tabindex=""1""></td>" & vbNewLine & _
				"                <td bgcolor=""" & strPopUpTableColor & """ valign=""middle"" align=""center"" nowrap><input class=""button"" value=""Add"" type=""submit"" tabindex=""2""></a></td>" & vbNewLine & _
				"              </tr>" & vbNewLine & _
				"            </table>" & vbNewLine & _
				"          </td>" & vbNewLine & _
				"        </tr>" & vbNewLine & _
				"      </table>" & vbNewLine & _
				"      </form>" & vbNewLine
End Select
WriteFooterShort
Response.End

sub DropDownPaging()
	if maxpages > 1 then
		if mypage = "" then
			pge = 1
		else
			pge = mypage
		end if
		Response.Write	"                <td valign=""middle"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strCategoryFontColor & """>" & vbNewLine & _
				"                <b>Page</b>&nbsp;<select style=""font-size:9px"" name=""whichpage"" size=""1"" onchange=""jumpToPage(this)"">" & vbNewLine
		for counter = 1 to maxpages
			ref = "admin_config_namefilter.asp?whichpage=" & counter 
			if counter <> cLng(pge) then
				Response.Write	"                	<option value=""" & ref & """>" & counter & "</option>" & vbNewLine
			else
				Response.Write	"                	<option value=""" & ref & """ selected>" & counter & "</option>" & vbNewLine
			end if
		next
		Response.Write	"                </select>&nbsp;<b>of " & maxpages & "</b></font></td>" & vbNewLine
	end if
end sub 

Function IsValidString(sValidate)
	Dim sInvalidChars
	Dim bTemp
	Dim i 
	' Disallowed characters
	sInvalidChars = "!#$%^&*()=+{}[]|\;:/?>,<'"
	for i = 1 To Len(sInvalidChars)
		if InStr(sValidate, Mid(sInvalidChars, i, 1)) > 0 then bTemp = True
		if bTemp then Exit For
	next
	for i = 1 to Len(sValidate)
		if Asc(Mid(sValidate, i, 1)) = 160 then bTemp = True
		if bTemp then Exit For
	next

	' extra checks
	' no two consecutive dots or spaces
	if not bTemp then
		bTemp = InStr(sValidate, "..") > 0
	end if
	if not bTemp then
		bTemp = InStr(sValidate, "  ") > 0
	end if
	if not bTemp then
		bTemp = (len(sValidate) <> len(Trim(sValidate)))
	end if 'Addition for leading and trailing spaces

	' if any of the above are true, invalid string
	IsValidString = Not bTemp
End Function
%>

⌨️ 快捷键说明

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