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

📄 ubbcode.asp

📁 割自ro-blog v2.0
💻 ASP
📖 第 1 页 / 共 2 页
字号:
			strContent=Replace(strContent,"[/color]","</font>")
			re.Pattern="\[align=([^<>\]]*?)\]"
			strContent=re.Replace(strContent,"<div align=""$1"">")
			strContent=Replace(strContent,"[/align]","</div>")
			re.Pattern="\[size=(\d*?)\]"
			strContent=re.Replace(strContent,"<font size=""$1"">")
			strContent=Replace(strContent,"[/size]","</font>")
		End IF

		re.Pattern = "\[down=(.[^\]]*)\](.[^\[]*)\[\/down]"
		strContent = re.Replace(strContent,"<img src=""images/download.gif"" align=""absmiddle"" /> <a href=""$1"" target=""_blank"">$2</a>")

		re.Pattern="\[code\](.*?)\[\/code\]"
		Set strMatchs=re.Execute(strContent)
		For Each strMatch in strMatchs
			RAndomize
			rndID=Int(100000 * Rnd)
			tmpStr1=strMatch.SubMatches(0)
			strContent= Replace(strContent,strMatch.Value,"<script type=""text/javascript"">window.attachEvent(""onload"",function (){AutoSizeDIV('CODE_"&RNDid&"')})</script><table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""code_head""><tr><td>程序代码:</td><td align=""right""><a href=""javascript:CopyText(document.all.CODE_"&RNDid&");"">[ 复制代码 ]</a> <a href=""javascript:runit(document.all.CODE_"&RNDid&");"">[ 运行代码 ]</a></td></tr></table><div class=""code"" id=""CODE_"&RNDid&""" style=""overflow-y:auto;overflow-x:hidden;height:150px;"">"&tmpStr1&"</div>")
        Next
		Set strMatchs=nothing

		re.Pattern="\[quote\](.*?)\[\/quote\]"
		Set strMatchs=re.Execute(strContent)
		For Each strMatch in strMatchs
			RAndomize
			rndID=Int(100000 * Rnd)
			tmpStr1=strMatch.SubMatches(0)
			strContent= Replace(strContent,strMatch.Value,"<script type=""text/javascript"">window.attachEvent(""onload"",function (){AutoSizeDIV('CODE_"&RNDid&"')})</script><table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""code_head""><tr><td>引用内容:</td><td align=""right""><a href=""javascript:CopyText(document.all.CODE_"&RNDid&");"">[ 复制代码 ]</a> </td></tr></table><div class=""code"" id=""CODE_"&RNDid&""" style=""overflow-y:auto;overflow-x:hidden;height:150px;"">"&tmpStr1&"</div>")
        Next
		Set strMatchs=nothing
		re.Pattern="\[html\](.*?)\[\/html\]"
		Set strMatchs=re.Execute(strContent)
		For Each strMatch in strMatchs
			RAndomize
			rndID="temp"&Int(100000 * Rnd)
			strContent=Replace(strContent,strMatch.Value,"<div style=""background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/news_bullet.gif""> HTML代码</div><div style=""padding:6px""><TEXTAREA  rows=""8"" style=""width:100%"" id="""&rndID&""">"&HTMLDecode(strMatch.SubMatches(0)) & "</TEXTAREA><br/><INPUT onclick=""runEx('"&rndID&"')""  type=""button"" value=""运行此代码""/> <INPUT onclick=""doCopy("&rndID&")""  type=""button"" value=""复制此代码""/> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]</div></div>",1,-1,1)
		Next
		Set strMatchs=nothing
	
		IF Not DisSM=1 Then
			dim log_Smilies,log_SmiliesContent
			For Each log_Smilies IN Arr_Smilies
				log_SmiliesContent=Split(log_Smilies,"|")
				strContent=Replace(strContent,log_SmiliesContent(2)," <img src=""images/smilies/"&log_SmiliesContent(1)&""" border=""0"" align=""absmiddle"" />")
			Next
		End IF

		IF AutoKEY=1 Then
			dim log_Keywords,log_KeywordsContent
			For Each log_Keywords IN Arr_Keywords
				log_KeywordsContent=Split(log_Keywords,"$|$")
				IF log_KeywordsContent(3)<>"None" Then
					strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""&log_KeywordsContent(2)&""" target=""_blank""><img src=""images/keywords/"&log_KeywordsContent(3)&""" border=""0"" align=""absmiddle""> "&log_KeywordsContent(1)&"</a>")
				Else
					strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""&log_KeywordsContent(2)&""" target=""_blank"">"&log_KeywordsContent(1)&"</a>")
				End IF
			Next
		End IF

		Set re=Nothing

		UBBCode=strContent
	End IF
End Function

Rem  过滤脚本
Function Filter_Script(strContent)
    If isEmpty(strContent) Or isNull(strContent) Then
        Exit Function
    Else
    	Dim re
		Set re=new RegExp
		re.IgnoreCase =True
		re.Global=True
    	're.Pattern="(&#)"
    	'strContent=re.Replace(strContent,"&amp;#")
    	re.Pattern="(var )"
    	strContent=re.Replace(strContent,"var..")
    	re.Pattern="(function )"
    	strContent=re.Replace(strContent,"function..")
    	re.Pattern="(meta )"
    	strContent=re.Replace(strContent,"meta..")
    	're.Pattern="(button )"
    	'strContent=re.Replace(strContent,"button..")
    	're.Pattern="(window)"
    	'strContent=re.Replace(strContent,"..window")
    	re.Pattern="(script)"
    	strContent=re.Replace(strContent,"script..")
    	re.Pattern="(js:)"
    	strContent=re.Replace(strContent,"..js:")
    	're.Pattern="(value)"
    	'strContent=re.Replace(strContent,"..value")
    	re.Pattern="(about:)"
    	strContent=re.Replace(strContent,"..about:" )
    	re.Pattern="(file:)"
    	strContent=re.Replace(strContent,"..file:")
    	re.Pattern="(Document.cookie)"
    	strContent=re.Replace(strContent,"..Document.cookie" )
    	re.Pattern="(vbs:)"
    	strContent=re.Replace(strContent,"..vbs:" )
    	re.Pattern="((ifr|fr)ame)"
    	strContent=re.Replace(strContent,"$2ame" &chr(30))
    	re.Pattern="(on(mouse|Exit|error|click|key|load))"
    	strContent=re.Replace(strContent,"on..$2")
    	Filter_Script=strContent
    End If
End Function
%>

⌨️ 快捷键说明

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