<%
function ubbcode(str) 
    dim strsize
    ubbcode=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;") 
    ubbcode=replace(replace(replace(replace(replace(ubbcode,"[img]=http://[/img]","<font color=red>错误图片指向</font>"),"[img]=[/img]","<font color=red>错误图片指向</font>"),"[img]=null[/img]","<font color=red>错误图片指向</font>"),"[img]","<center><img src="),"[/img]"," border=0 vspace=5></center>")
    ubbcode=replace(replace(replace(replace(ubbcode,"[b]","<b>"),"[/b]","[/b]"),"[b]","<b>"),"[/b]","</b>")
    ubbcode=replace(replace(replace(replace(ubbcode,"[i]","<i>"),"[/i]","</i>"),"[u]","<u>"),"[/u]","</u>")
    for strsize = 1 to 6
     ubbcode=replace(replace(ubbcode,"[h"&(strsize)&"]","<h"&(strsize)&">"),"[/h"&(strsize)&"]","</h"&(strsize)&">")
    next
    ubbcode=replace(replace(ubbcode,"[flash]","<embed src="),"[/flash]"," width=500 height=375>")
    ubbcode=replace(replace(ubbcode,"[marquee]","<marquee scrolldelay=100>"),"[/marquee]","</marquee>")
    ubbcode=replace(replace(ubbcode,"[black]","<font color=black>"),"[/black]","</font>")
    ubbcode=replace(replace(ubbcode,"[white]","<font color=white>"),"[/white]","</font>")
    ubbcode=replace(replace(ubbcode,"[red]","<font color=red>"),"[/red]","</font>")
    ubbcode=replace(replace(ubbcode,"[pink]","<font color=pink>"),"[/pink]","</font>")
    ubbcode=replace(replace(ubbcode,"[blue]","<font color=blue>"),"[/blue]","</font>")
    ubbcode=replace(replace(ubbcode,"[green]","<font color=green>"),"[/green]","</font>")
    ubbcode=replace(replace(ubbcode,"[olive]","<font color=olive>"),"[/olive]","</font>")
    ubbcode=replace(replace(ubbcode,"[navy]","<font color=navy>"),"[/navy]","</font>")
    ubbcode=replace(replace(ubbcode,"[gray]","<font color=gray>"),"[/gray]","</font>")
    ubbcode=replace(replace(ubbcode,"[fuchsia]","<font color=fuchsia>"),"[/fuchsia]","</font>")
    ubbcode=replace(replace(ubbcode,"[yellow]","<font color=yellow>"),"[/yellow]","</font>")
    ubbcode=replace(replace(ubbcode,"[silver]","<栀?潣湮瑓?攀牡?????font color=silver>"),"[/silver]","</font>")
    ubbcode=replace(replace(ubbcode,"[purple]","<font color=purple>"),"[/purple]","</font>")
    ubbcode=replace(replace(ubbcode,"[email]","<a href=mailto:"),"[/email]","><font style="&chr(34)&"font-size: 9pt;color=red"&chr(34)&">[点击发送电子邮件]</font></a>")
    ubbcode=replace(replace(replace(ubbcode,"[url=","<a href="),"[/url]","</font></u></a>"),"]"," target=_blank><u><font color=red>")
end function
%>
