<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<%
'UBB 判断开始
function UBB(strContent)
    dim re
    Set re=new RegExp
    re.IgnoreCase =true
    re.Global=True

    re.Pattern="(\[IMG\])(.[^\[]*)(\[\/IMG\])"
    strContent=re.Replace(strContent,"<a href=""$2"" target=_blank><IMG SRC=""$2"" alt=""点击图片新开窗口查看"" border=0 onload=""javascript:if(this.width>380)this.width=380""></a>")
    re.Pattern="(\[mp\])(.[^\[]*)(\[\/mp\])"
    strContent=re.Replace(strContent,"<IMG SRC=../bbs/ubb/wmv.gif border=0><a href=""$2"" target=_blank> 点击浏览该Media Player视频文件</a>")
    re.Pattern="(\[rm\])(.[^\[]*)(\[\/rm\])"
    strContent=re.Replace(strContent,"<IMG SRC=../bbs/ubb/real.gif border=0><a href=""$2"" target=_blank> 点击浏览该realplay视频文件</a>")
    re.Pattern="(\[flash\])(.[^\[]*)(\[\/flash\])"
    strContent=re.Replace(strContent,"<IMG SRC=../bbs/ubb/swf.gif border=0><a href=""$2"" target=_blank> 点击浏览该flash文件</a>")
    re.Pattern="(\[csound\])(.[^\[]*)(\[\/csound\])"
    strContent=re.Replace(strContent,"<IMG SRC=../bbs/ubb/mid.gif border=0><a href=""$2"" target=_blank> 本贴包含背景音乐文件，点击浏览该文件</a>")

    re.Pattern="(\[URL\])(http:\/\/.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<IMG SRC=../bbs/ubb/http.gif border=0><A HREF=""$2"" TARGET=_blank>$2</A>")
    re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<IMG SRC=../bbs/ubb/http.gif border=0><A HREF=""http://$2"" TARGET=_blank>$2</A>")

    re.Pattern="(\[URL=(http:\/\/.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<IMG SRC=../bbs/ubb/http.gif border=0><A HREF=""$2"" TARGET=_blank>$3</A>")
    re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<IMG SRC=../bbs/ubb/http.gif border=0><A HREF=""http://$2"" TARGET=_blank>$3</A>")

    re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
    strContent= re.Replace(strContent,"<IMG SRC=../bbs/ubb/mail.gif border=0><A HREF=""mailto:$2"">$2</A>")
    re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
    strContent= re.Replace(strContent,"<IMG SRC=../bbs/ubb/mail.gif border=0><A HREF=""mailto:$2"" TARGET=_blank>$3</A>")

	re.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
	strContent = re.Replace(strContent,"<IMG SRC=../bbs/ubb/http.gif border=0><a target=_blank href=$1>$1</a>")
	re.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
	strContent = re.Replace(strContent,"<IMG SRC=../bbs/ubb/http.gif border=0><a target=_blank href=$1>$1</a>")
	re.Pattern = "[^>=""](http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
	strContent = re.Replace(strContent,"<IMG SRC=../bbs/ubb/http.gif border=0><a target=_blank href=$1>$1</a>")

    re.Pattern="(\[color=(.[^\[]*)\])(.[^\[]*)(\[\/color\])"
    strContent=re.Replace(strContent,"<font color=$2>$3</font>")
    re.Pattern="(\[align=(.[^\[]*)\])(.*)(\[\/align\])"
    strContent=re.Replace(strContent,"<div align=$2>$3</div>")
    re.Pattern="(\[QUOTE\])(.*)(\[\/QUOTE\])"
    strContent=re.Replace(strContent,"<table cellpadding=10 cellspacing=1 border=0 WIDTH=94% bgcolor=#cccccc align=center><tr><td bgcolor=#f9f9f9><font color=#999999>$2</font></td></tr></table>")
    re.Pattern="(\[i\])(.[^\[]*)(\[\/i\])"
    strContent=re.Replace(strContent,"<i>$2</i>")
    re.Pattern="(\[u\])(.[^\[]*)(\[\/u\])"
    strContent=re.Replace(strContent,"<u>$2</u>")
    re.Pattern="(\[b\])(.[^\[]*)(\[\/b\])"
    strContent=re.Replace(strContent,"<b>$2</b>")

    re.Pattern="(\[center\])(.[^\[]*)(\[\/center\])"
    strContent=re.Replace(strContent,"<center>$2</center>")
	
	If InStr(Lcase(strContent),"[em")>0 Then
	re.Pattern="\[em(.[^\[]*)\]"
	strContent=re.Replace(strContent,"<img src=../bbs/em/$1.gif border=0 align=middle>")
	Else
	re.Pattern="\[em(.[^\[]*)\]"
	strContent=re.Replace(strContent,"")
	End If

    set re=Nothing
    UBB=strContent
 end function

%>