?? ubbcode.asp
字號(hào):
<%
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,chr(9)," ")
unHtml=replace(unHtml," "," ")
end if
if Err.Number <>0 then
unHtml= "html轉(zhuǎn)換中出錯(cuò)請(qǐng)聯(lián)系管理員<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)
//加入img擴(kuò)展
if not noimg=1 or isnull(noimg) then ubb=ubb_img1(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)
//poorfish增加標(biāo)記
ubb=ubb_iframe(ubb)
ubb=ubb_down(ubb)
ubb=ubb_list(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 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,"<br>","<br>",1,-1,1)
ltext="<blockquote><div>以下為引用內(nèi)容:<hr size='1' noshade>"&text
ubb_temp_=replace(ubb_temp_,"[quote]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/quote]",ltext&"<hr size='1' noshade></div></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="<script src=highlight.js></script><font color=#CCCCCC>程序代碼:</font><br><div id='html_code' name='html_code' style='display:none'></div><div id='html_lightcode' name='html_lightcode' style='font-size:11px;font-family: sans-serif; background-color: #f9f9f9;height:40px;padding:5px;border:1 dotted #999999'>"<ext
ubb_temp_=replace(ubb_temp_,"[code]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/code]",ltext&"</div><img src=images/hn2_sunny.gif width=0 height=0 onload=show(this)>",1,1,1) '加入代碼高亮顯示 by Poorfish
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:100%' 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><INPUT onclick=runEx('"&rid&"') type=button value=運(yùn)行代碼 > <font color=#CCCCCC>[Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運(yùn)行]</font>",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 class=ubblink>"&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 class=ubblink>"&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
//poorfish修改圖片顯示
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="<div align=right id=imgtip style='color:#999999;display:none'>此圖片僅顯示局部,請(qǐng)點(diǎn)擊查看完整圖片</div><img src='"<ext
ubb_temp_=replace(ubb_temp_,"[img]"&text,ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&"[/img]",ltext&"' vspace=4 hspace=4 border=0 onload=""if(this.width>=514){this.style.cursor='hand';this.alt='!!!此圖片僅顯示局部,請(qǐng)點(diǎn)擊查看完整圖片!!!';this.previousSibling.style.display='';}"" onclick=""if(this.width>=514)window.open(this.src);else return false;"">",1,1,1)
ubb_temp_=replace(ubb_temp_,"javascript","java script")
else
exit do
end if
loop
ubb_img=ubb_temp_
end function
//poorfish加入圖片擴(kuò)展標(biāo)記
function ubb_img1(ubb_temp)
ubb_temp_=ubb_temp
do while ubb_temp_ <> ""
text=SearchUBB(ubb_temp_,"[img=","]")
if text<>"" then
ltext=furl(msubb(text))
ltext="<img align="<ext&" src="
text2=SearchUBB(ubb_temp_,"[img="&text&"]","[/img]")
if text2<>"" then
ubb_temp_=replace(ubb_temp_,"[img="&text&"]",ltext,1,1,1)
ubb_temp_=replace(ubb_temp_,ltext&text2&"[/img]",ltext&text2&" vspace=4 hspace=4 border=0>",1,1,1)
ubb_temp_=replace(ubb_temp_,"javascript","java script")
else
exit do
end if
noautourl=1
else
exit do
end if
loop
UBB_img1=ubb_temp_
end function
//poorfish修改,加入iframe標(biāo)記
function ubb_iframe(ubb_temp)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -