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

📄 functions_filters.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 3 页
字号:
	'then repleace <br /> tags with carridge returns that get changed back to <br /> tags once
	'the HTML has been striped

	'If leaving in <br /> tags
	If blnRemoveBRtags = false Then
		'Remove null chars from string before the next step
		strMessageInput = Replace(strMessageInput, vbNullChar, "", 1, -1, 1)

		'Change <br /> tags into nulls so they are not striped and can be changed back later
		strMessageInput = Replace(strMessageInput, "<br />", vbNullChar, 1, -1, 1)
		strMessageInput = Replace(strMessageInput, "<br>", vbNullChar, 1, -1, 1)
	End If



	'Create regular experssions object
	Set objRegExp = New RegExp

	'Tell the regular experssions object to look for tags <xxxx>
	With objRegExp
		.Pattern = "<[^>]+>"
		.IgnoreCase = True
		.Global = True
	End With

	'Strip HTML
	strMessageInput = objRegExp.Replace(strMessageInput, "")


	'Tell the regular experssions object to look for BB forum codes [xxxx]
	With objRegExp
		.Pattern = "\[[^\]]+\]"
		.IgnoreCase = True
		.Global = True
	End With

	'Strip BB forum codes
	strMessageInput = objRegExp.Replace(strMessageInput, "")

	'Distroy regular experssions object
	Set objRegExp = nothing


	'Replace a few characters in the remaining text
	strMessageInput = Replace(strMessageInput, "<", "&lt;", 1, -1, 1)
	strMessageInput = Replace(strMessageInput, ">", "&gt;", 1, -1, 1)
	strMessageInput = Replace(strMessageInput, "'", "&#039;", 1, -1, 1)
	strMessageInput = Replace(strMessageInput, """", "&#034;", 1, -1, 1)
	strMessageInput = Replace(strMessageInput, "&nbsp;", "", 1, -1, 1)

	'If the length of the text is longer than the max then cut it and place '...' at the end
	strMessageInput = TrimString(strMessageInput, lngReturnLength)
	

	'Remove new lines as it's better for display as link titles
	strMessageInput = Replace(strMessageInput, vbCrLf, " ", 1, -1, 1)

	'Place back in <br /> tags
	If blnRemoveBRtags = false Then strMessageInput = Replace(strMessageInput, vbNullChar, vbCrLf & "       <br />", 1, -1, 1)

	'Return the function
	removeHTML = strMessageInput
End Function







'*********************************************
'*** Decode HTML encoding for plain text *****
'*********************************************

'Decode encoded strings
Private Function decodeString(ByVal strInputEntry)

	'Prevent errors
	If isNull(strInputEntry) Then strInputEntry = ""

	'Decode HTML character entities
	
	strInputEntry = Replace(strInputEntry, "&#065;", "A", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#066;", "B", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#067;", "C", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#068;", "D", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#069;", "E", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#070;", "F", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#071;", "G", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#072;", "H", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#073;", "I", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#074;", "J", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#075;", "K", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#076;", "L", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#077;", "M", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#078;", "N", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#079;", "O", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#080;", "P", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#081;", "Q", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#082;", "R", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#083;", "S", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#084;", "T", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#085;", "U", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#086;", "V", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#087;", "W", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#088;", "X", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#089;", "Y", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#090;", "Z", 1, -1, 0)

	strInputEntry = Replace(strInputEntry, "&#097;", "a", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#098;", "b", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#099;", "c", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#100;", "d", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#101;", "e", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#102;", "f", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#103;", "g", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#104;", "h", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#105;", "i", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#106;", "j", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#107;", "k", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#108;", "l", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#109;", "m", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#110;", "n", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#111;", "o", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#112;", "p", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#113;", "q", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#114;", "r", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#115;", "s", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#116;", "t", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#117;", "u", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#118;", "v", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#119;", "w", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#120;", "x", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#121;", "y", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#122;", "z", 1, -1, 0)


	strInputEntry = Replace(strInputEntry, "&#048;", "0", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#049;", "1", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#050;", "2", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#051;", "3", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#052;", "4", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#053;", "5", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#054;", "6", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#055;", "7", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#056;", "8", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#057;", "9", 1, -1, 0)


	'Non aplha numeric characters
	strInputEntry = Replace(strInputEntry, "&amp;", "&", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#039;", "'", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#39;", "'", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#061;", "=", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#61;", "=", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#091;", "[", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#91;", "[", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#092;", "\", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#92;", "\", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#093;", "]", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#93;", "]", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#146;", "'", 1, -1, 1)
	
	
	'Decode other entities
	strInputEntry = Replace(strInputEntry, "&amp;", "&", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&lt;", "<", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&gt;", ">", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#039;", "'", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&quot;", """", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#092;", "\", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#091;", "[", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&#093;", "]", 1, -1, 1)


	'Return
	decodeString = strInputEntry
End Function









'*********************************************
'***  	   Remove HTML encoding		 *****
'*********************************************

'Remove HTML encoding of ASCII characters A-z 0-10
Private Function removeHTMLencoding(ByVal strInputEntry)

	'Prevent errors
	If isNull(strInputEntry) Then strInputEntry = ""

	'Decode HTML character entities
	
	strInputEntry = Replace(strInputEntry, "&#065;", "A", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#066;", "B", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#067;", "C", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#068;", "D", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#069;", "E", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#070;", "F", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#071;", "G", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#072;", "H", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#073;", "I", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#074;", "J", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#075;", "K", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#076;", "L", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#077;", "M", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#078;", "N", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#079;", "O", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#080;", "P", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#081;", "Q", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#082;", "R", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#083;", "S", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#084;", "T", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#085;", "U", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#086;", "V", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#087;", "W", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#088;", "X", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#089;", "Y", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#090;", "Z", 1, -1, 0)

	strInputEntry = Replace(strInputEntry, "&#097;", "a", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#098;", "b", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#099;", "c", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#100;", "d", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#101;", "e", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#102;", "f", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#103;", "g", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#104;", "h", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#105;", "i", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#106;", "j", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#107;", "k", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#108;", "l", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#109;", "m", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#110;", "n", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#111;", "o", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#112;", "p", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#113;", "q", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#114;", "r", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#115;", "s", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#116;", "t", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#117;", "u", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#118;", "v", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#119;", "w", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#120;", "x", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#121;", "y", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#122;", "z", 1, -1, 0)


	strInputEntry = Replace(strInputEntry, "&#048;", "0", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#049;", "1", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#050;", "2", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#051;", "3", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#052;", "4", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#053;", "5", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#054;", "6", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#055;", "7", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#056;", "8", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#057;", "9", 1, -1, 0)
	
	'Repeat with 0
	strInputEntry = Replace(strInputEntry, "&#65;", "A", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#66;", "B", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#67;", "C", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#68;", "D", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#69;", "E", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#70;", "F", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#71;", "G", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#72;", "H", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#73;", "I", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#74;", "J", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#75;", "K", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#76;", "L", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#77;", "M", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#78;", "N", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#79;", "O", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#80;", "P", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#81;", "Q", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#82;", "R", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#83;", "S", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#84;", "T", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#85;", "U", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#86;", "V", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#87;", "W", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#88;", "X", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#89;", "Y", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#90;", "Z", 1, -1, 0)

	strInputEntry = Replace(strInputEntry, "&#97;", "a", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#98;", "b", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#99;", "c", 1, -1, 0)


	strInputEntry = Replace(strInputEntry, "&#48;", "0", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#49;", "1", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#50;", "2", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#51;", "3", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#52;", "4", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#53;", "5", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#54;", "6", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#55;", "7", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#56;", "8", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&#57;", "9", 1, -1, 0)

	'Return
	removeHTMLencoding = strInputEntry
End Function


%>

⌨️ 快捷键说明

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