<%
function ChkBadWords(fString)
if not(isnull(BadWords) or isnull(fString)) then
bwords = split(BadWords, "|")
for i = 0 to ubound(bwords)
fString = Replace(fString, bwords(i), string(len(bwords(i)),"*"))
next
ChkBadWords = fString
end if
end function
function HTMLEncode(fString)
if not isnull(fString) then
'fString = Replace(fString, CHR(38), "&")
'fString = replace(fString, ">", ">")
'fString = replace(fString, "<", "<")
'fString = Replace(fString, CHR(39), "'")
'fString = Replace(fString, CHR(32), " ")
'fString = Replace(fString, CHR(34), """)
'fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10), "<br/>")
HTMLEncode = fString
end if
end function
function HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10), "<br/>")
HTMLcode = fString
end if
end function
function HTMLDecode(fString)
if not isnull(fString) then
'fString = Replace(fString, CHR(38), "&")
'fString = replace(fString, ">", ">")
'fString = replace(fString, "<", "<")
'fString = Replace(fString, CHR(32), " ")
'fString = Replace(fString,"",CHR(13))
fString = Replace(fString,"<br/>",CHR(10))
HTMLDecode = fString
end if
end function
function UBBCode(strContent)
if strAllowHTML <> 1 then
strContent = HTMLEncode(strContent)
else
strContent = HTMLcode(strContent)
end if
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="\[IMG\](.[^\[]*)\[\/IMG\]"
strContent=re.Replace(strContent,"<img src=""$1"" border=""0""></img>")
re.Pattern="\[IMG=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/IMG\]"
strContent=re.Replace(strContent,"<a href=""$3"" title=点击看全图 target=_blank><img src=""$3"" width=""$1"" height=""$2"" border=""0""></img></a>")
'图文混排
re.Pattern="\[PIC\](.[^\[]*)\[\/PIC\]"
strContent=re.Replace(strContent,"<img src=""$1"" border=""0"" align=""left""></img>")
re.Pattern="\[PIC=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/PIC\]"
strContent=re.Replace(strContent,"<a href=""$3"" title=点击看全图 target=_blank><img src=""$3"" width=""$1"" height=""$2"" border=""0"" align=""left""></img></a>")
re.Pattern="\[FLASH=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/FLASH\]"
strContent= re.Replace(strContent,"<EMBED SRC=""$3"" width=""$1"" height=""$2""></EMBED>")
re.Pattern="\[FLASH\](.[^\[]*)\[\/FLASH\]"
strContent= re.Replace(strContent,"<EMBED SRC=""$1""></EMBED>")
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="(\[EMAIL\])(mailto:\/\/.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=""_blank"">$2</A>")
re.Pattern="(\[EMAIL\])(.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<A HREF=""MAILTO:$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>")
re.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "[^>=""](http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "^(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "[^>=""](ftp://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "^(rtsp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "(rtsp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "[^>=""](rtsp://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "^(mms://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "(mms://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern = "[^>=""](mms://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=http://www.ceocio.net/images/url.gif><a target=_blank href=$1>$1</a>")
re.Pattern="\[DIR=*([0-9]*),*([0-9]*)\](.[^\[]