日期:2014-05-16  浏览次数:21104 次

ASP中,UBB代码中,为何Quote不能一段一段地进行引用呢?
UBB.asp代码如下:

<%
Const MaxLoopcount=50
function ubb(bod)  'h=2为转换帖,h=1为转换签名
Set re=new RegExp  '声明正则表达式对象
re.IgnoreCase =true   '设置是否区分字符大小写
re.Global=True   '设置全区可用性
're.pattern 设置模式
bod = dvHTMLEncode(bod)
re.Pattern="(javascript)"
bod=re.Replace(bod,"<I>&#106avascript</I>")
re.Pattern="(jscript:)"
bod=re.Replace(bod,"<I>&#106script:</I>")
re.Pattern="(js:)"
bod=re.Replace(bod,"<I>&#106s:</I>")
re.Pattern="(value)"
bod=re.Replace(bod,"<I>&#118alue</I>")
re.Pattern="(about:)"
bod=re.Replace(bod,"<I>about&#58</I>")
re.Pattern="(file:)"
bod=re.Replace(bod,"<I>file&#58</I>")
re.Pattern="(document.cookie)"
bod=re.Replace(bod,"<I>documents&#46cookie</I>")
re.Pattern="(vbscript:)"
bod=re.Replace(bod,"<I>&#118bscript:</I>")
re.Pattern="(vbs:)"
bod=re.Replace(bod,"<I>&#118bs:</I>")
re.Pattern="(on(mouse|exit|error|click|key))"
bod=re.Replace(bod,"<I>&#111n$2</I>")
'常用标签
re.Pattern="(\[humor)([\d]+)(\])"
bod=re.replace(bod,"<img src=""images/humor/$2.gif"" border=""0"">")
re.Pattern="\[QUOTE\](.*)\[\/QUOTE\]"
bod=re.Replace(bod,"<table style=""border-collapse:collapse;width:100%"" bordercolor=""#6595D6"" cellpadding=5 cellspacing=0 border=1><tr><td bgcolor=""#E4E8EF"" width=""100%"">$1</td></tr></table>")

re.Pattern = "(\[SIZE=([0-9]*)\])(.[^\[]*)(\[\/SIZE\])"
bod=re.Replace(bod,"<FONT SIZE='$2'>$3</FONT>")

re.Pattern = "(\[B\])(.[^\[]*)(\[\/B\])"
bod=re.Replace(bod,"<B>$2</B>")

re.Pattern = "(\[COLOR=(.[^\[]*)\])(.[^\[]*)(\[\/RED\])"
bod=re.Replace(bod,"<FONT COLOR='$2'>$3</FONT>")

re.Pattern = "(\[RED\])(.[^\[]*)(\[\/RED\])"
bod = re.Replace(bod,"<FONT COLOR='#FF0000'>$2</FONT>")

re.Pattern = "(\[GREEN\])(.[^\[]*)(\[\/GREEN\])"
bod = re.Replace(bod,"<FONT COLOR='#009900'>$2</FONT>")

re.Pattern = "(\[BLUE\])(.[^\[]*)(\[\/BLUE\])"
bod = re.Replace(bod,"<FONT COLOR='#000099'>$2</FONT>")

re.Pattern = "(\[GRAY\])(.[^\[]*)(\[\/GRAY\])"
bod = re.Replace(bod,"<FONT COLOR='#999999'>$2</FONT>")

re.Pattern = "(\[S\])(.[^\[]*)(\[\/S\])"
bod= re.Replace(bod,"<FONT STYLE='TEXT-DECORATION:LINE-THROUGH'>$2</FONT>")

re.Pattern = "(\[I\])(.[^\[]*)(\[\/I\])"
bod = re.Replace(bod,"<I>$2</I>")

re.Pattern = "(\[U\])(.[^\[]*)(\[\/U\])"
bod = re.Replace(bod,"<U>$2</U>")

re.Pattern = "(\[ALIGN=(.[^\[]*)\])(.[^\[]*)(\[\/ALIGN\])"
bod = re.Replace(bod,"<DIV ALIGN='$2'>$3</DIV>")
re.Pattern = "(\[CENTER\])(.[^\[]*)(\[\/CENTER\])"
bod= re.Replace(bod,"<CENTER>$2</CENTER>")

re.Pattern = "\[url=(.[^\]]*)\](.[^\[]*)\[\/url]"
bod = re.Replace(bod,"<img align=absmiddle src=images/url.gif border=0><a target=_blank style=font-size:9pt href=$1>$2</a>")
re.Pattern = "\[url](.[^\[]*)\[\/url]"
bod = re.Replace(bod,"<img align=absmiddle src=images/url.gif&