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

📄 xbcode_inc.asp

📁 很好的一个论坛原代码
💻 ASP
字号:
<%
function xbcodeContent(strContent, emot, autourl, img, mov)
dim re
dim po,ii
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
po=0
ii=0

re.Pattern="(javascript)"
strContent=re.Replace(strContent,"&#106avascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"&#106script:")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"&#106s:")
re.Pattern="(value)"
strContent=re.Replace(strContent,"&#118alue")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"about&#58")
re.Pattern="(file:)"
strContent=re.Replace(strContent,"file&#58")
re.Pattern="(document.cookie)"
strContent=re.Replace(strContent,"documents&#46cookie")
re.Pattern="(vbscript:)"
strContent=re.Replace(strContent,"&#118bscript:")
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"&#118bs:")
re.Pattern="(on(mouse|exit|error|click|key))"
strContent=re.Replace(strContent,"&#111n$2")
	
if img then
	re.Pattern="\[img\](http|ftp):\/\/(.[^\[]*)\[\/img\]"
	strContent=re.Replace(strContent,"<img src=""$1://$2"" border=""0"" onload=""if(this.width>screen.width-333) {this.width=screen.width-333;this.title='open new window';}"" onmouseover=""if(this.title) {this.style.cursor='hand';}""; onclick=""if(this.title) {window.open('$1://$2');}"">")
end if

if mov then
	re.Pattern="\[mp\](.[^\[]*)\[\/mp]"
	strContent=re.Replace(strContent,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=360 height=320 ><param name=ShowStatusBar value=-1><param name=Filename value=$1><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$1  width=360 height=320></embed></object>")
	re.Pattern="\[rm\](.[^\[]*)\[\/rm]"
	strContent=re.Replace(strContent,"<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=320 height=240><PARAM NAME=SRC VALUE=$1><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=true></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=320><PARAM NAME=SRC VALUE=$1><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></object>")

	re.Pattern="(\[swf\])(.[^\[]*)(\[\/swf\])"
	strContent= re.Replace(strContent,"<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400><PARAM NAME=movie VALUE=""$2""><PARAM NAME=quality VALUE=high><embed src=""$2"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=500 height=400>$2</embed></object>")
end if

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>")

if autourl then
	re.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
	strContent = re.Replace(strContent,"<a href=$1 target=_blank>$1</a>")
	re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
	strContent = re.Replace(strContent,"<a href=$1 target=_blank>$1</a>")
	re.Pattern = "([^>=""'])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
	strContent = re.Replace(strContent,"$1<a href=$2 target=_blank>$2</a>")
end if

if emot then
	re.Pattern="\[em(.[^\[]*)\]"
	strContent=re.Replace(strContent,"<img src=image/emot/$1.gif border=0>")
end if

re.Pattern="\[code\](.*)\[\/code\]"
strContent=re.Replace(strContent,"<br><table align='center' width=80% cellpadding=4 cellspacing=1><tr><td class=code><pre>$1</pre></td></tr></table><br>")

re.Pattern="\[i\](.[^\[]*)\[\/i\]"
strContent=re.Replace(strContent,"<i>$1</i>")

re.Pattern="\[u\](.[^\[]*)(\[\/u\])"
strContent=re.Replace(strContent,"<u>$1</u>")

re.Pattern="\[b\](.[^\[]*)(\[\/b\])"
strContent=re.Replace(strContent,"<b>$1</b>")

re.Pattern="\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]"
strContent=re.Replace(strContent,"<font color=$1>$2</font>")

re.Pattern="\[quote\](.*)\[\/quote\]"
strContent=re.Replace(strContent,"<br><table align='center' width=80% cellpadding=4 cellspacing=1><tr><td class=quote>$1</td></tr></table><br>")

re.Pattern="\[size=([1-6])\](.*)\[\/size\]"
strContent=re.Replace(strContent,"<font size=$1>$2</font>")

set re=Nothing
xbcodeContent=strContent
end function

function filterJS(str)
if not isnull(str) then
dim t
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(javascript)"
t=re.Replace(str,"&#106avascript")
re.Pattern="(jscript:)"
t=re.Replace(t,"&#106script:")
re.Pattern="(js:)"
t=re.Replace(t,"&#106s:")
re.Pattern="(value)"
t=re.Replace(t,"&#118alue")
re.Pattern="(about:)"
t=re.Replace(t,"about&#58")
re.Pattern="(file:)"
t=re.Replace(t,"file&#58")
re.Pattern="(document.cookie)"
t=re.Replace(t,"documents&#46cookie")
re.Pattern="(vbscript:)"
t=re.Replace(t,"&#118bscript:")
re.Pattern="(vbs:)"
t=re.Replace(t,"&#118bs:")
re.Pattern="(on(mouse|exit|error|click|key))"
t=re.Replace(t,"&#111n$2")
re.Pattern="(&#)"
t=re.Replace(t,"&#")
FilterJS=t
set re=nothing
end if
end function
%>

⌨️ 快捷键说明

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