<%
'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>520)this.width=520""></a>")
    re.Pattern="(\[mp\])(.[^\[]*)(\[\/mp\])"
    strContent=re.Replace(strContent,"<IMG SRC=/blog/ubb/wmv.gif border=0><a href=""$2"" target=_blank> 点击浏览该Media Player视频文件</a>")
    re.Pattern="(\[rm\])(.[^\[]*)(\[\/rm\])"
    strContent=re.Replace(strContent,"<IMG SRC=/blog/ubb/real.gif border=0><a href=""$2"" target=_blank> 点击浏览该realplay视频文件</a>")
    re.Pattern="(\[flash\])(.[^\[]*)(\[\/flash\])"
    strContent=re.Replace(strContent,"<IMG SRC=/blog/ubb/swf.gif border=0><a href=""$2"" target=_blank> 点击浏览该flash文件</a>")
    re.Pattern="(\[csound\])(.[^\[]*)(\[\/csound\])"
    strContent=re.Replace(strContent,"<IMG SRC=/blog/ubb/mid.gif border=0><a href=""$2"" target=_blank> 本贴包含背景音乐文件，点击浏览该文件</a>")

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

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

    re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
    strContent= re.Replace(strContent,"<IMG SRC=/blog/ubb/mail.gif border=0><A HREF=""mailto:$2"">$2</A>")
    re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
    strContent= re.Replace(strContent,"<IMG SRC=/blog/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=/blog/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=/blog/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=/blog/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/em$1.gif border=0 align=middle>")
	Else
	re.Pattern="\[em(.[^\[]*)\]"
	strContent=re.Replace(strContent,"")
	End If

    set re=Nothing
    UBB=strContent
 end function
'VIP会员签名UBB 判断开始
function vip_ubb(strContent)
    dim re
    Set re=new RegExp
    re.IgnoreCase =true
    re.Global=True
    re.Pattern="(\[IMG\])(.[^\[]*)(\[\/IMG\])"
    strContent=re.Replace(strContent,"<IMG SRC=""$2"" border=0 onload=""javascript:if(this.width>520)this.width=520"">")
    re.Pattern="(\[URL\])(http:\/\/.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
    re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<A HREF=""http://$2"" TARGET=_blank>$2</A>")
    re.Pattern="(\[URL=(http:\/\/.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$3</A>")
    re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
    strContent= re.Replace(strContent,"<A HREF=""http://$2"" TARGET=_blank>$3</A>")
    set re=Nothing
    vip_ubb=strContent
 end function

function dvURLCode(fString)
if not isnull(fString) then
    fString = replace(fString, "http://", "^^&#")
    fString = replace(fString, "stream", "%$^#")
    fString = Replace(fString,  ".com","!~&#")
    fString = Replace(fString, "qqmusic.qq", "@@@#")
    fString = Replace(fString, ".wma", "*$&#")
    fString = Replace(fString, ".mp3","&^%#")
    fString = Replace(fString, "www.", "^$%#")
    fString = Replace(fString, "/100", "~!~~#")
    dvURLCode = fString
end if
end Function

Function FilterJS(v)
if not isnull(v) then
dim t
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(&#)"
t=re.Replace(lcase(v),"")
re.Pattern="(javascript)"
t=re.Replace(t,"&#106avascript")
re.Pattern="(jscript:)"
t=re.Replace(t,"&#106script:")
re.Pattern="(js:)"
t=re.Replace(t,"&#106s:")
're.Pattern="(value)"
't=re.Replace(t,"&#118alue")
re.Pattern="(about:)"
t=re.Replace(t,"about&#58")
re.Pattern="(file:)"
t=re.Replace(t,"file&#58")
re.Pattern="(document.cookie)"
t=re.Replace(t,"documents&#46cookie")
re.Pattern="(vbscript:)"
t=re.Replace(t,"&#118bscript:")
re.Pattern="(vbs:)"
t=re.Replace(t,"&#118bs:")
re.Pattern="(on(mouse|exit|error|click|key))"
t=re.Replace(t,"&#111n$2")
re.Pattern="(<script)"
t=re.Replace(t,"<&#115cript")
re.Pattern="(select)"
t=re.Replace(lcase(t),"&#115elect")
re.Pattern="(delete)"
t=re.Replace(lcase(t),"&#100elete")
re.Pattern="(update)"
t=re.Replace(lcase(t),"&#117pdate")
re.Pattern="(insert)"
t=re.Replace(lcase(t),"in&#115ert")
re.Pattern="( and )"
t=re.Replace(lcase(t),"")
re.Pattern="( or )"
t=re.Replace(lcase(t),"")
're.Pattern="(&#)"
't=re.Replace(t,"＆#")
't= replace(t, ">", "&gt;")
't = replace(t, "<", "&lt;")
FilterJS=replace(t,"'","''")
set re=nothing
end if
End Function
%>