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

📄 admin_config_badwords.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 2 页
字号:
					"        <tr>" & vbNewLine & _
					"          <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
					"            <table border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td align=""center"" bgcolor=""" & strCategoryCellColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Edit Badword</b></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Badword</b></font></td>" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Replacement</b></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><input maxLength=""50"" name=""strBadword"" value=""" & TxtBadword & """ size=""12"" tabindex=""1""></td>" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><input maxLength=""50"" name=""strReplace"" value=""" & TxtReplace & """ size=""12"" tabindex=""2""></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""submit"" class=""button"" value=""Update"" id=""submit1"" name=""submit1"" tabindex=""3""> <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_badwords.asp"">Back To Badword Filter Configuration</font></a></p>" & vbNewLine
		end if
	Case Else
		'## Forum_SQL - Get Badwords from DB
		strSql = "SELECT B_ID, B_BADWORD, B_REPLACE " 
		strSql2 = " FROM " & strFilterTablePrefix & "BADWORDS "
		strSql3 = " ORDER BY B_BADWORD 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(B_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
					arrBadwordData = rs.GetRows(intGetRows)
					iBadwordCount = UBound(arrBadwordData, 2)
				rs.close
				set rs = nothing
			else
				iBadwordCount = ""
			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)
					arrBadwordData = rs.GetRows(strPageSize)
					iBadwordCount = UBound(arrBadwordData, 2)
				else
					iBadwordCount = ""
				end if
			rs.Close
			set rs = nothing
		end if

		Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><b>Bad Word Filter Configuration</b></font></p>" & vbNewLine
		Response.Write	"      <form action=""admin_config_badwords.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 & """>Badword</font></b></td>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strCategoryCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Replacement</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 iBadwordCount = "" then  '## No Badwords found in DB
			Response.Write	"              <tr>" & vbNewLine & _
        				"                <td bgcolor=""" & strForumFirstCellColor & """ colspan=""3""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """ valign=""top""><b>No Badwords Found</b></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine
		else
			bB_ID = 0
			bB_BADWORD = 1
			bB_REPLACE = 2

			rec = 1
			intI = 0

			for iBadword = 0 to iBadwordCount
				if (rec = strPageSize + 1) then exit for

				Badword_ID = arrBadwordData(bB_ID, iBadword)
				Badword_Badword = arrBadwordData(bB_BADWORD, iBadword)
				Badword_Replace = arrBadwordData(bB_REPLACE, iBadword)

				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 & """>" & Badword_Badword & "</font></td>" & vbNewLine & _
						"                <td bgcolor=""" & CColor & """ valign=""middle"" align=""center""><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & Badword_Replace & "</font></td>" & vbNewLine & _
						"                <td bgcolor=""" & CColor & """ valign=""middle"" align=""center"" nowrap><a href=""admin_config_badwords.asp?method=Edit&B_ID=" & Badword_ID & """>" & getCurrentIcon(strIconPencil,"Edit Badword","hspace=""0""") & "</a>&nbsp;<a href=""admin_config_badwords.asp?method=Delete&B_ID=" & Badword_ID & """>" & getCurrentIcon(strIconTrashcan,"Delete Badword","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 maxLength=""50"" name=""strBadword"" value=""" & TxtBadword & """ tabindex=""1"" size=""10""></td>" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """ align=""center""><input maxLength=""50"" name=""strReplace"" value=""" & TxtReplace & """ tabindex=""2"" size=""10""></td>" & vbNewLine & _
				"                <td bgcolor=""" & strPopUpTableColor & """ valign=""middle"" align=""center"" nowrap><input class=""button"" value=""Add"" type=""submit"" tabindex=""3""></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_badwords.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 chkBString(fString,fField_Type) '## Types - SQLString
	if fString = "" then
		fString = " "
	end if
	Select Case fField_Type
		Case "SQLString"
			fString = Replace(fString, "'", "''")
			if strDBType = "mysql" then
				fString = Replace(fString, "\0", "\\0")
				fString = Replace(fString, "\'", "\\'")
				fString = Replace(fString, "\""", "\\""")
				fString = Replace(fString, "\b", "\\b")
				fString = Replace(fString, "\n", "\\n")
				fString = Replace(fString, "\r", "\\r")
				fString = Replace(fString, "\t", "\\t")
				fString = Replace(fString, "\z", "\\z")
				fString = Replace(fString, "\%", "\\%")
				fString = Replace(fString, "\_", "\\_")
			end if
			fString = HTMLBEncode(fString)
			chkBString = fString
			exit function
	End Select
	chkBString = fString
end function

function HTMLBEncode(fString)
	if fString = "" or IsNull(fString) then fString = " "
	fString = replace(fString, ">", "&gt;")
	fString = replace(fString, "<", "&lt;")
	HTMLBEncode = fString
end function
%>

⌨️ 快捷键说明

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