<%
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), "
")
HTMLEncode = fString
end if
end function
function HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10), "
")
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,"
",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,"")
re.Pattern="[IMG=*([0-9]*),*([0-9]*)](.[^[]*)[/IMG]"
strContent=re.Replace(strContent,"")
'图文混排
re.Pattern="[PIC](.[^[]*)[/PIC]"
strContent=re.Replace(strContent,"")
re.Pattern="[PIC=*([0-9]*),*([0-9]*)](.[^[]*)[/PIC]"
strContent=re.Replace(strContent,"")
re.Pattern="[FLASH=*([0-9]*),*([0-9]*)](.[^[]*)[/FLASH]"
strContent= re.Replace(strContent,"")
re.Pattern="[FLASH](.[^[]*)[/FLASH]"
strContent= re.Replace(strContent,"")
re.Pattern="([URL])(http://.[^[]*)([/URL])"
strContent= re.Replace(strContent,"$2")
re.Pattern="([URL])(.[^[]*)([/URL])"
strContent= re.Replace(strContent,"$2")
re.Pattern="([EMAIL])(mailto://.[^[]*)([/EMAIL])"
strContent= re.Replace(strContent,"$2")
re.Pattern="([EMAIL])(.[^[]*)([/EMAIL])"
strContent= re.Replace(strContent,"$2")
re.Pattern="([URL=(http://.[^[]*)])(.[^[]*)([/URL])"
strContent= re.Replace(strContent,"$3")
re.Pattern="([URL=(.[^[]*)])(.[^[]*)([/URL])"
strContent= re.Replace(strContent,"$3")
re.Pattern = "^(http://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "(http://[A-Za-z0-9./=?%-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"$1")
re.Pattern = "[^>=""](http://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "^(ftp://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "(ftp://[A-Za-z0-9./=?%-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"$1")
re.Pattern = "[^>=""](ftp://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "^(rtsp://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "(rtsp://[A-Za-z0-9./=?%-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"$1")
re.Pattern = "[^>=""](rtsp://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "^(mms://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "(mms://[A-Za-z0-9./=?%-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"$1")
re.Pattern = "[^>=""](mms://[A-Za-z0-9./=?%-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern="[DIR=*([0-9]*),*([0-9]*)](.[^[]*)[/DIR]"
strContent=re.Replace(strContent,"")
re.Pattern="[QT=*([0-9]*),*([0-9]*)](.[^[]*)[/QT]"
strContent=re.Replace(strContent,"
")
re.Pattern="([color=(.[^[]*)])(.[^[]*)([/color])"
strContent=re.Replace(strContent,"$3")
re.Pattern="([face=(.[^[]*)])(.[^[]*)([/face])"
strContent=re.Replace(strContent,"$3")
re.Pattern="([align=(.[^[]*)])(.*)([/align])"
strContent=re.Replace(strContent,"
re.Pattern="([QUOTE])(.*)([/QUOTE])"
strContent=re.Replace(strContent,"
|
")
re.Pattern="([fly])(.*)([/fly])"
strContent=re.Replace(strContent,"")
re.Pattern="([move])(.*)([/move])"
strContent=re.Replace(strContent,"")
re.Pattern="[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)](.[^[]*)[/GLOW]"
strContent=re.Replace(strContent,"
re.Pattern="[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)](.[^[]*)[/SHADOW]"
strContent=re.Replace(strContent,"
re.Pattern="([i])(.[^[]*)([/i])"
strContent=re.Replace(strContent,"$2")
re.Pattern="([u])(.[^[]*)([/u])"
strContent=re.Replace(strContent,"$2")
re.Pattern="([b])(.[^[]*)([/b])"
strContent=re.Replace(strContent,"$2")
re.Pattern="([fly])(.[^[]*)([/fly])"
strContent=re.Replace(strContent,"")
re.Pattern="([size=1])(.[^[]*)([/size])"
strContent=re.Replace(strContent,"$2")
re.Pattern="([size=2])(.[^[]*)([/size])"
strContent=re.Replace(strContent,"$2")
re.Pattern="([size=3])(.[^[]*)([/size])"
strContent=re.Replace(strContent,"$2")
re.Pattern="([size=4])(.[^[]*)([/size])"
strContent=re.Replace(strContent,"$2")
re.Pattern="([center])(.[^[]*)([/center])"
strContent=re.Replace(strContent,"
'以下扩展
re.Pattern="([li])(.[^[]*)([/li])"
strContent=re.Replace(strContent,"
'字体背景
re.Pattern="([fontbg=(.[^[]*)])(.[^[]*)([/fontbg])"
strContent=re.Replace(strContent,"$3")
'删除线
re.Pattern="([strike])(.[^[]*)([/strike])"
strContent=re.Replace(strContent,"
re.Pattern="([HTML])(.[^[]*)([/HTML])"
strContent=re.Replace(strContent,"
以下内容为程序代码: $2 |
re.Pattern="([code])(.[^[]*)([/code])"
strContent=re.Replace(strContent,"
以下内容为程序代码: $2 |
strContent=ChkBadWords(strContent)
set re=Nothing
UBBCode=strContent
end function
%>