📄 ubb.asp
字号:
<!-- #include file="ep_config.asp" -->
<%
function ubb(str)
if isnull(str) then exit function
str=replace(str,"[CODE]","[code]")
str=replace(str,"[/CODE]","[/code]")
dim ary_string,i,n,n_pos
ary_string=split(str,"[code]")
n=ubound(ary_string)
if n>=1 then
ary_string(0)=ubb_base(ary_string(0))
for i=1 to n
n_pos=instr(ary_string(i),"[/code]")
if n_pos>0 then
ary_string(i)="<form><textarea style='border:solid 1px #999999;width:100%;background-color:#eeeeee;' name='dbg' rows='15' class='scrollbar1'>" & text_encode(left(ary_string(i),n_pos-1)) & "</textarea><br><input type='button' class='input1' value='运行此代码' style='width:80px' onclick='runit(this.form.dbg)'> <input type='button' class='input1' value='复制到剪贴板' style='width:90px' onclick='copyit(this.form.dbg)'> <input type='button' class='input1' value='代码另存为' style='width:80px' onclick='saveAs(this.form.dbg)'> <font color=#999999>提示:你可以先修改部分代码再运行</font></form><br>" & ubb_base(right(ary_string(i),len(ary_string(i))-n_pos-6))
else
ary_string(i)=ubb_base(ary_string(i))
end if
next
ubb=join(ary_string,"")
else
ubb=ubb_base(str)
end if
end function
function text_encode(byval s_string)
if isnull(s_string) then
text_encode=""
else
s_string=replace(s_string,"&","&")
s_string=replace(s_string,"<","<")
text_encode=replace(s_string,">",">")
end if
end function
function ubb_base(str)
if isnull(str) then exit function
str = replace(str, ">", ">")
str = replace(str, "<", "<")
str = Replace(str, CHR(32), "<I></I> ")
str = Replace(str, CHR(9), " ")
str = Replace(str, CHR(34), """)
str = Replace(str, CHR(39), "'")
str = Replace(str, CHR(13), "")
str = Replace(str, CHR(10) & CHR(10), "</P><P> ")
str = Replace(str, CHR(10), "<BR> ")
str=replace(str,"[HTML]","[html]")
str=replace(str,"[/HTML]","[/html]")
if instr(str,"[noubb]")<>0 then
str=replace(str,"[noubb]","")
ubb_base=str
exit function
elseif instr(str,"[ep]")>0 and instr(str,"[/ep]")=0 then
str=replace(str,"[ep]","")
str=use_ep(str)
end if
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(javascript)"
str=re.Replace(str,"javascript")
re.Pattern="(jscript:)"
str=re.Replace(str,"jscript:")
re.Pattern="(js:)"
str=re.Replace(str,"js:")
re.Pattern="(value)"
str=re.Replace(str,"value")
re.Pattern="(about:)"
str=re.Replace(str,"about:")
re.Pattern="(file:)"
str=re.Replace(str,"file:")
re.Pattern="(document.cookie)"
str=re.Replace(str,"documents.cookie")
re.Pattern="(vbscript:)"
str=re.Replace(str,"vbscript:")
re.Pattern="(vbs:)"
str=re.Replace(str,"vbs:")
re.Pattern="(on(mouse|exit|error|click|key))"
str=re.Replace(str,"on$2")
re.Pattern="\[img\]((\w)+)([.]{1}(gif|jpg|png|jpeg|bmp))\[\/img\]"
str=re.Replace(str,fr("$1$3","",""))
re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
str=re.Replace(str,fr("$1://$2","",""))
re.Pattern="\[IMG=*([0-9]*),*([0-9]*)\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
str=re.Replace(str,fr("$3://$4","$1","$2"))
re.Pattern="\[IMG=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/IMG\]"
str=re.Replace(str,fr("$3","$1","$2"))
re.Pattern="\[DIR=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/DIR]"
str=re.Replace(str,"<object classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0 width=$1 height=$2><param name=src value=$3><embed src=$3 pluginspage=http://www.macromedia.com/shockwave/download/ width=$1 height=$2></embed></object>")
re.Pattern="\[QT=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/QT]"
str=re.Replace(str,"<embed src=$3 width=$1 height=$2 autoplay=true loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>")
re.Pattern="\[MP3\](.[^\[]*)(mid|wav|mp3|cda|avi|wov|asf|mpg|mpeg|wma)\[\/MP3]"
str=re.Replace(str,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=300 height=70 ><param name=ShowStatusBar value=-1><param name=Filename value=$1$2><param name=LOOP value=1><PARAM NAME=AUTOSTART VALUE=0><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$2 width=300 height=70></embed></object>")
re.Pattern="\[MP\](.[^\[]*)(mp3)\[\/MP]"
str=re.Replace(str,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=400 height=70 ><param name=ShowStatusBar value=-1><param name=Filename value=$1$2><param name=LOOP value=1><PARAM NAME=AUTOSTART VALUE=0><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$2 width=400 height=70></embed></object>")
re.Pattern="\[MP\](.[^\[]*)\[\/MP]"
str=re.Replace(str,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=500 height=350 ><param name=ShowStatusBar value=-1><param name=Filename value=$1><param name=LOOP value=1><PARAM NAME=AUTOSTART VALUE=0><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=500 height=350></embed></object>")
re.Pattern="\[MP=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/MP]"
str=re.Replace(str,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=$1 height=$2 ><param name=ShowStatusBar value=-1><param name=Filename value=$3><param name=LOOP value=1><PARAM NAME=AUTOSTART VALUE=0><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$3 width=$1 height=$2></embed></object>")
re.Pattern="\[RM\](.[^\[]*)(mp3)\[\/RM]"
str=re.Replace(str,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=350 height=38><PARAM NAME=SRC VALUE=$1><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><param name=LOOP value=1></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=350><PARAM NAME=SRC VALUE=$1$2><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>")
re.Pattern="\[RM\](.[^\[]*)\[\/RM]"
str=re.Replace(str,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=350 height=38><PARAM NAME=SRC VALUE=$1><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><param name=LOOP value=1></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=350><PARAM NAME=SRC VALUE=$1><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>")
re.Pattern="\[RM=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/RM]"
str=re.Replace(str,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=$1 height=$2><PARAM NAME=SRC VALUE=$3><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><param name=LOOP value=1></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=$1><PARAM NAME=SRC VALUE=$3><PARAM NAME=AUTOSTART VALUE=0><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>")
re.Pattern="(\[FLASH\])(.[^\[]*)(\[\/FLASH\])"
str= re.Replace(str,"<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><param name=LOOP value=1><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'>$2</embed></OBJECT>")
re.Pattern="(\[FLASH=*([0-9]*),*([0-9]*)\])(.[^\[]*)(\[\/FLASH\])"
str= re.Replace(str,"<a href=""$4"" TARGET=_blank alt='按此新窗口打开该flash文件浏览'><img src='images/swf.gif' border=0 align=absmiddle> <font color=blue>全屏浏览</font></a><br><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=$2 height=$3><param name=LOOP value=1><PARAM NAME=movie VALUE=""$4""><PARAM NAME=quality VALUE=high><embed src=""$4"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=$2 height=$3>$4</embed></OBJECT>")
re.Pattern="(\[sound\])(.[^\[]*)(\[\/sound\])"
str=re.Replace(str,"<bgsound src=""$2"" loop=""-1"">")
re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
str= re.Replace(str,"<A HREF=""$2"" TARGET=_blank>$2</A>")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
str= re.Replace(str,"<A HREF=""$2"" TARGET=_blank>$3</A>")
re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
str= re.Replace(str,"<img align=absmiddle src=images/email.gif><A HREF=""mailto:$2"">$2</A>")
re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
str= re.Replace(str,"<img align=absmiddle src=images/email.gif><A HREF=""mailto:$2"" TARGET=_blank>$3</A>")
re.Pattern="\[html\](.[^\[]*)\[\/html\]"
str=re.Replace(str,"<table border=0 width='100%' cellspacing=0 cellpadding=0><tr><td> 程序代码段:</td><td align=right> </td></tr><tr><td colspan=2><table border=0 width=100% cellspacing=1 cellpadding=10 bgcolor=#000000><tr><td width=100% bgcolor=#F6F6F6 style='word-break:break-all' id='htmlcode'>$1</td></tr></table></td></tr></table><br>")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -