?? marcosubb.asp
字號:
<%
function jsCode(str)
str=fixNull(str)
str=replace(str,"'","’")
str=replace(str,"""",""")
jsCode=str
end function
function enCode(str)
if isNull(str) then
enCode=""
exit function
end if
str=replace(str,"&","&")
str=replace(str,"<","<")
str=replace(str,">",">")
str=replace(str,"""",""")
enCode=str
end function
function encodeStr(str)
if isNull(str) then
enCodeStr=""
exit function
end if
str=replace(str,"<","<")
str=replace(str,">",">")
str=replace(str,"'","'")
str=replace(str,"""",""")
str=replace(str,vbCrLf,"<br>")
str=replace(str,chr(9)," ")
enCodeStr=str
end function
function mUbb(strContent)
dim re,i
strContent=encodeStr(strContent)
set re=new RegExp
re.IgnoreCase =true
re.Global=True
if inStr(lcase(strContent),"script:")>0 then
re.Pattern="script:"
strContent=re.Replace(strContent,"script:")
end if
if inStr(lcase(strContent),"[/img]")>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>500)this.width=500""></a> ")
end if
if inStr(lcase(strContent),"[/dir]")>0 then
re.Pattern="\[DIR=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/DIR]"
strContent=re.Replace(strContent,"<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>")
end if
if inStr(lcase(strContent),"[/qt]")>0 then
re.Pattern="\[QT=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/QT]"
strContent=re.Replace(strContent,"<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/>")
end if
if inStr(lcase(strContent),"[/mp]")>0 then
re.Pattern="\[MP=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/MP]"
strContent=re.Replace(strContent,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=400 height=300><param name=ShowStatusBar value=-1><param name=Filename value=""$3""><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=400 height=300></embed></object>")
end if
if inStr(lcase(strContent),"[/rm]")>0 then
re.Pattern="\[RM=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/RM]"
strContent=re.Replace(strContent,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=400 height=300><PARAM NAME=SRC VALUE=""$3""><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=400><PARAM NAME=SRC VALUE=""$3""><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>")
end if
if inStr(lcase(strContent),"[/flash]")>0 then
re.Pattern="(\[FLASH\])(.[^\[]*)(\[\/FLASH\])"
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
if inStr(lcase(strContent),"[/url]")>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(lcase(strContent),"[/email]")>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(lcase(strContent),"[/color]")>0 then
re.Pattern="(\[color=(.[^\[]*)\])(.[^\[]*)(\[\/color\])"
strContent=re.Replace(strContent,"<font color=$2>$3</font>")
end if
if inStr(lcase(strContent),"[/face]")>0 then
re.Pattern="(\[face=(.[^\[]*)\])(.[^\[]*)(\[\/face\])"
strContent=re.Replace(strContent,"<font face=$2>$3</font>")
end if
if inStr(lcase(strContent),"[/align]")>0 then
re.Pattern="(\[align=(.[^\[]*)\])(.[^\[]*)(\[\/align\])"
strContent=re.Replace(strContent,"<div align=$2>$3</div>")
end if
if inStr(lcase(strContent),"[/fly]")>0 then
re.Pattern="(\[fly\])(.[^\[]*)(\[\/fly\])"
strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>")
end if
if inStr(lcase(strContent),"[/move]")>0 then
re.Pattern="(\[move\])(.[^\[]*)(\[\/move\])"
strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$2</marquee>")
end if
if inStr(lcase(strContent),"[/glow]")>0 then
re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
end if
if inStr(lcase(strContent),"[/shadow]")>0 then
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")
end if
if inStr(lcase(strContent),"[/i]")>0 then
re.Pattern="(\[i\])(.[^\[]*)(\[\/i\])"
strContent=re.Replace(strContent,"<i>$2</i>")
end if
if inStr(lcase(strContent),"[/u]")>0 then
re.Pattern="(\[u\])(.[^\[]*)(\[\/u\])"
strContent=re.Replace(strContent,"<u>$2</u>")
end if
if inStr(lcase(strContent),"[/b]")>0 then
re.Pattern="(\[b\])(.[^\[]*)(\[\/b\])"
strContent=re.Replace(strContent,"<b>$2</b>")
end if
if inStr(lcase(strContent),"[/sub]")>0 then
re.Pattern="(\[sub\])(.[^\[]*)(\[\/sub\])"
strContent=re.Replace(strContent,"<sub>$2</sub>")
end if
if inStr(lcase(strContent),"[/sup]")>0 then
re.Pattern="(\[sup\])(.[^\[]*)(\[\/sup\])"
strContent=re.Replace(strContent,"<sup>$2</sup>")
end if
if inStr(lcase(strContent),"[/fly]")>0 then
re.Pattern="(\[fly\])(.[^\[]*)(\[\/fly\])"
strContent=re.Replace(strContent,"<marquee>$2</marquee>")
end if
if inStr(lcase(strContent),"[/size]")>0 then
re.Pattern="(\[size=1\])(.[^\[]*)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=1>$2</font>")
re.Pattern="(\[size=2\])(.[^\[]*)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=2>$2</font>")
re.Pattern="(\[size=3\])(.[^\[]*)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=3>$2</font>")
re.Pattern="(\[size=4\])(.[^\[]*)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=4>$2</font>")
re.Pattern="(\[size=5\])(.[^\[]*)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=5>$2</font>")
end if
if inStr(lcase(strContent),"[/center]")>0 then
re.Pattern="(\[center\])(.[^\[]*)(\[\/center\])"
strContent=re.Replace(strContent,"<center>$2</center>")
end if
if inStr(lcase(strContent),"[/list]")>0 then
strContent=doCode(strContent,"[list]","[/list]","<ul>","</ul>")
strContent=doCode(strContent,"[list=1]","[/list]","<ol type=1>","</ol id=1>")
strContent=doCode(strContent,"[list=a]","[/list]","<ol type=a>","</ol id=a>")
end if
if inStr(lcase(strContent),"[/*]")>0 then
strContent=doCode(strContent,"[*]","[/*]","<li>","</li>")
end if
if inStr(lcase(strContent),"[/code]")>0 then
strContent=doCode(strContent,"[code]","[/code]","<table width='100%' border='0' cellspacing='0' cellpadding='6' class='trOnMOver'><td><b>以下內容為程序代碼:</b><br>","</td></table>")
end if
if inStr(lcase(strContent),"[/quota]")>0 then
strContent = doCode(strContent,"[quota]","[/quota]","<table cellpadding=5 cellspacing=1 border=0 class='trOnMOver' WIDTH=94% align=center><TR><TD>","</td></tr></table><br>")
end if
if inStr(strContent,"[/color]")>0 and inStr(strContent,"[color=")>0 then
strContent=MReplace(strContent,"[color=","[/color]","<font color=$sunc>$himarcos</font>")
end if
set re=Nothing
mUbb=strContent
end function
function doCode(txt, txtS, txtE, txtNS, txtNE)
dim i, j
i=inStr(1,txt,txtS,1)
j=inStr(1,txt,txtE,1)
while (i>0 and j>0)
txt=replace(txt,txtS,txtNS,1,1,1)
txt=replace(txt,txtE,txtNE,1,1,1)
i=inStr(1,txt,txtS,1)
j=inStr(1,txt,txtE,1)
wend
doCode=txt
end function
function MReplace(txt,txtS,txtE,txtN)
dim sunc,himarcos,hididi
i=instr(txt,txtS)
j=instr(txt,txtE)
sn=0
do while((j-i)>0)
sn=sn+1
if sn>=50 then
exit do
end if
k=i+instr(mid(txt,i+1,len(txt)),"]")
l=k-(i+len(txtS))
sunc=mid(txt,i+len(txtS),l)
Mtxt=txtN
if instr(sunc,",") then
hididi=left(sunc,instr(sunc,",")-1)
sunc=right(sunc,len(sunc)-len(hididi)-1)
Mtxt=replace(Mtxt,"$hididi",hididi)
end if
if instr(sunc,",") then
himidi=left(sunc,instr(sunc,",")-1)
sunc=right(sunc,len(sunc)-len(himidi)-1)
Mtxt=replace(Mtxt,"$himidi",himidi)
end if
himarcos=mid(txt,i+len(txtS)+l+1,j-(i+len(txtS)+l+1))
Mtxt=replace(Mtxt,"$sunc",sunc)
Mtxt=replace(Mtxt,"$himarcos",himarcos)
txt=left(txt,i-1)&Mtxt&mid(txt,j+len(txtE),len(txt))
i=instr(txt,txtS)
j=instr(txt,txtE)
loop
MReplace=txt
end function
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -