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

📄 ubb.asp

📁 机票订票系统,使用ASP
💻 ASP
字号:
<%
'以下部分代码来自动网BBS的ubb.asp文件
function mfk(text)
text=trim(text)
if not isnull(text) then
    text = replace(text, ">", "&gt;")
    text = replace(text, "<", "&lt;")
    text = Replace(text, CHR(32), "<I></I>&nbsp;")
    text = Replace(text, CHR(9), "&nbsp;")
    text = Replace(text, CHR(34), "&quot;")
    text = Replace(text, CHR(39), "&#39;")
    text = Replace(text, CHR(13), "")
    text = Replace(text, CHR(10) & CHR(10), "</P><P> ")
    text = Replace(text, CHR(10), "<BR> ")
    mfk=text
end if
end function

function UBBCode(strContent)
	
	dim re,i
	strContent=mfk(strContent)

	UbbCode=strContent
	if (instr(strContent,"[")=0 or instr(strContent,"]")=0) and instr(strContent,"http://")=0 then
		exit function
	end if
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	
	'过滤script事件
	if instr(1,strContent,"on",1)>0 then
		re.Pattern="on(\w+)="
		strContent=re.Replace(strContent,"on_$1=")
	end if
	strContent=Replace(strContent,"file:","file :")
	strContent=Replace(strContent,"files:","files :")
	strContent=Replace(strContent,"script:","script :")
	strContent=Replace(strContent,"js:","js :")
	
	
	if instr(1,strContent,"[IMG]",1)>0 then
		re.Pattern="(\[IMG\])(.[^\[]*)(\[\/IMG\])"
			strContent=re.Replace(strContent,"<a href=""$2"" target=_blank><IMG SRC=""$2"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>400)this.width=400""></a> ")
	end if
	
	if instr(1,strContent,"[/url]",1)>0 then
		re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
		strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
		re.Pattern="(\[URL=(.[^\]]*)\])(.[^\[]*)(\[\/URL\])"
		strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$3</A>")
	end if
	
	if instr(1,strContent,"[/email]",1)>0 then
		re.Pattern="(\[EMAIL\])(.[^\[]*)(\[\/EMAIL\])"
		strContent= re.Replace(strContent,"<A HREF=""mailto:$2"">$2</A>")
		re.Pattern="(\[EMAIL=(.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
		strContent= re.Replace(strContent,"<A HREF=""mailto:$2"">$3</A>")
	end if
	
	if instr(1,strContent,"http://",1)>0 then
		re.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		re.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		
		re.Pattern = "([^>=""])(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"$1<a target=_blank href=$2>$2</a>")
	end if
	
	if instr(1,strContent,"ftp://",1)>0 then
		re.Pattern = "^(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		re.Pattern = "(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		re.Pattern = "([^>=""])(ftp://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"$1<a target=_blank href=$2>$2</a>")
	end if
	
	if instr(1,strContent,"rtsp://",1)>0 then
		re.Pattern = "^(rtsp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		re.Pattern = "(rtsp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		re.Pattern = "([^>=""])(rtsp://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"$1<a target=_blank href=$2>$2</a>")
	end if
	
	if instr(1,strContent,"mms://",1)>0 then
		re.Pattern = "^(mms://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		re.Pattern = "(mms://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
		strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
		re.Pattern = "([^>=""])(mms://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
		strContent = re.Replace(strContent,"$1<a target=_blank href=$2>$2</a>")
	end if

	if instr(1,strContent,"[/color]",1)>0 then
		re.Pattern="(\[color=(.[^\[]*)\])(.[^\[]*)(\[\/color\])"
		strContent=re.Replace(strContent,"<font color=$2>$3</font>")
	end if
	if instr(1,strContent,"[/align]",1)>0 then
		re.Pattern="(\[align=(.[^\[]*)\])(.[^\[]*)(\[\/align\])"
		strContent=re.Replace(strContent,"<div align=$2>$3</div>")
	end if
	if instr(1,strContent,"[/b]",1)>0 then
		re.Pattern="(\[b\])(.[^\[]*)(\[\/b\])"
		strContent=re.Replace(strContent,"<b>$2</b>")
	end if
	set re=Nothing
	UBBCode=strContent
end function
'结束
%>

⌨️ 快捷键说明

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