?? ubbcode.asp
字號:
<%
noimg=0
noswf=0
noubb=0
nocovhtml=0
noautourl=0
%>
<%
dim ubb_temp_,text,ltext,text2
function unHtml(content)
ON ERROR RESUME NEXT
unHtml=content
if content <> "" then
unHtml=Server.HTMLEncode(unHtml)
unHtml=replace(unHtml,vbcrlf,"<br>")
unHtml=replace(unHtml," "," ")
unHtml=replace(unHtml,chr(9)," ")
end if
if Err.Number <>0 then
unHtml= "html轉換中出錯請聯系管理員<br>"
Err.Clear
end if
end function
function ubb(text)
ubb=text
ubb=replace(ubb,"[swf]","[swf=500,350]",1,-1,1)
ubb=ubb_code(ubb)
ubb=ubb_html(ubb)
ubb=ubb_url(ubb)
ubb=ubb_url1(ubb)
ubb=ubb_email(ubb)
ubb=ubb_email1(ubb)
if not noimg=1 or isnull(noimg) then ubb=ubb_img(ubb)
if not noswf=1 or isnull(noswf) then ubb=ubb_swf(ubb)
ubb=ubb_move(ubb)
ubb=ubb_fly(ubb)
ubb=ubb_code(ubb)
ubb=ubb_quote(ubb)
ubb=ubb_size(ubb)
ubb=ubb_align(ubb)
ubb=ubb_font(ubb)
ubb=ubb_color(ubb)
ubb=ubb_order(ubb)
ubb=ubb_dir(ubb)
ubb=ubb_mp(ubb)
ubb=ubb_qt(ubb)
ubb=ubb_rm(ubb)
if not noautourl=1 or isnull(noautourl) then
UBB=AutoURL(ubb,"http://")
UBB=AutoURL(ubb,"ftp://")
UBB=AutoURL(ubb,"rtsp://")
UBB=AutoURL(ubb,"mms://")
end if
ubb=unmsubb(ubb)
end function
function UBB_order(text)
UBB_order=replace(text,"[b]","<b>",1,-1,1)
UBB_order=replace(UBB_order,"[/b]","</b>",1,-1,1)
UBB_order=replace(UBB_order,"[i]","<i>",1,-1,1)
UBB_order=replace(UBB_order,"[/i]","</i>",1,-1,1)
UBB_order=replace(UBB_order,"[u]","<u>",1,-1,1)
UBB_order=replace(UBB_order,"[/u]","</u>",1,-1,1)
UBB_order=replace(UBB_order,"[blue]","<font color='#000099'>",1,-1,1)
UBB_order=replace(UBB_order,"[/blue]","</font>",1,-1,1)
UBB_order=replace(UBB_order,"[red]","<font color='#990000'>",1,-1,1)
UBB_order=replace(UBB_order,"[/red]","</font>",1,-1,1)
end function
Function furl(url)
furl=replace(url," ","%20",1,-1,1)
end function
function UBB_size(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[size=","]")
if text<>"" and IsNumeric(text) then
if text>6 then text=6
if text<1 then text=1
ltext="<font size='"&text&"'>"
text2=SearchUBB(ubb_temp_,"[size="&text&"]","[/size]")
if text2<>"" then
ubb_temp_=replace(ubb_temp_,"[size="&text&"]",ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&text2&"[/size]",ltext&text2&"</font>",1,1,1)
else
exit do
end if
else
exit do
end if
loop
UBB_size=ubb_temp_
end function
function UBB_align(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[align=","]")
if text<>"" then
ltext="<div align='"&text&"'>"
text2=SearchUBB(ubb_temp_,"[align="&text&"]","[/align]")
if text2<>"" then
ubb_temp_=replace(ubb_temp_,"[align="&text&"]",ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&text2&"[/align]",ltext&text2&"</div>",1,1,1)
else
exit do
end if
else
exit do
end if
loop
UBB_align=ubb_temp_
end function
function UBB_font(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[font=","]")
if text<>"" then
ltext="<font face='"&text&"'>"
text2=SearchUBB(ubb_temp_,"[font="&text&"]","[/font]")
if text2<>"" then
ubb_temp_=replace(ubb_temp_,"[font="&text&"]",ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&text2&"[/font]",ltext&text2&"</font>",1,1,1)
else
exit do
end if
else
exit do
end if
loop
UBB_font=ubb_temp_
end function
function UBB_color(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[color=","]")
if text<>"" then
ltext="<font color='"&text&"'>"
text2=SearchUBB(ubb_temp_,"[color="&text&"]","[/color]")
if text2<>"" then
ubb_temp_=replace(ubb_temp_,"[color="&text&"]",ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&text2&"[/color]",ltext&text2&"</font>",1,1,1)
else
exit do
end if
else
exit do
end if
loop
UBB_color=ubb_temp_
end function
function ubb_quote(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[quote]","[/quote]")
if text<>"" then
if sColor=1 then
qccolor=table_topic_dark_color
else
qccolor=table_topic_light_color
end if
ltext=msubb(text)
ltext=replace(ltext,"[img]","",1,-1,1)
ltext=replace(ltext,"[/img]","",1,-1,1)
ltext=replace(ltext,"[swf]","",1,-1,1)
ltext=replace(ltext,"[/swf]","",1,-1,1)
ltext=replace(ltext,"[html]","",1,-1,1)
ltext=replace(ltext,"[/html]","",1,-1,1)
ltext=replace(ltext,"<br>","<br>",1,-1,1)
ltext="<blockquote><table width='100%' border='0' cellspacing='0' cellpadding='2' ><tr><td>以下被引用:<hr size='1' width='100%' noshade>"&text
ubb_temp_=replace(ubb_temp_,"[quote]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/quote]",ltext&"<hr size='1' width='100%' noshade></td></tr></table></blockquote>",1,1,1)
else
exit do
end if
loop
ubb_quote=ubb_temp_
end function
function ubb_code(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[code]","[/code]")
if text<>"" then
if sColor=1 then
qccolor=table_topic_dark_color
else
qccolor=table_topic_light_color
end if
ltext=msubb(text)
ltext="<br><table width='100%' border='0' cellspacing='1' cellspacing='0' bgcolor='#cccccc'><tr><td bgcolor=#efefef>"<ext
ubb_temp_=replace(ubb_temp_,"[code]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/code]",ltext&"<br></td></tr></table>",1,1,1)
else
exit do
end if
loop
ubb_code=ubb_temp_
end function
function ubb_html(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[html]","[/html]")
if text<>"" then
ltext=replace(text,"<br>",vbcrlf,1,-1,1)
ltext=replace(ltext," ",chr(32),1,-1,1)
ltext=msubb(ltext)
Randomize
rid="temp"&Int(100000 * Rnd)
ltext="<TEXTAREA rows=12 style='width:90%' class='bk' id='"&rid&"'>"<ext
ubb_temp_=replace(ubb_temp_,"[html]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/html]",ltext&"</TEXTAREA><br><INPUT onclick=runEx('"&rid&"') type=button value=運行代碼 > [Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運行] ",1,1,1)
else
exit do
end if
loop
ubb_html=ubb_temp_
end function
function ubb_url(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[url]","[/url]")
if text<>"" then
ltext=furl(msubb(text))
ltext="<a href='"<ext&"' target=_blank>"&text
ubb_temp_=replace(ubb_temp_,"[url]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/url]",ltext&"</a>",1,1,1)
else
exit do
end if
loop
ubb_url=ubb_temp_
end function
function ubb_email(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[email]","[/email]")
if text<>"" then
ltext=furl(msubb(text))
ltext="<a href='mailto:"<ext&"' target=_blank>"&text
ubb_temp_=replace(ubb_temp_,"[email]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/email]",ltext&"</a>",1,1,1)
else
exit do
end if
loop
ubb_email=ubb_temp_
end function
function ubb_move(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[move]","[/move]")
if text<>"" then
ltext="<MARQUEE scrollamount=3>"&text
ubb_temp_=replace(ubb_temp_,"[move]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/move]",ltext&"</marquee>",1,1,1)
else
exit do
end if
loop
ubb_move=ubb_temp_
end function
function ubb_fly(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[fly]","[/fly]")
if text<>"" then
ltext="<marquee width=90% behavior=alternate scrollamount=3>"&text
ubb_temp_=replace(ubb_temp_,"[fly]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/fly]",ltext&"</marquee>",1,1,1)
else
exit do
end if
loop
ubb_fly=ubb_temp_
end function
function ubb_img(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[img]","[/img]")
if text<>"" then
ltext=furl(msubb(text))
ltext="<img src='"<ext
ubb_temp_=replace(ubb_temp_,"[img]"&text,ltext,1,1,1)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -