<%
Function UBBCode(strContent,DisSM,DisUBB,DisIMG,AutoURL,AutoKEY)
If isEmpty(strContent) Or isNull(strContent) Then
Exit Function
Else
Dim re, strMatchs, strMatch, rndID
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
'strContent=Filter_Script(strContent)
IF AutoURL=1 Then
re.Pattern="([^=\]][\s]*?|^)(http|https|rstp|ftp|mms|ed2k)://([A-Za-z0-9\.\/=\?%\-_~`@':+!]*)"
strContent=re.Replace(strContent,"<a href=""
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
://$3"" target=""_blank"">
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
://$3</a>")
're.Pattern="(^|\s)(www\.\S+)"
'strContent=re.Replace(strContent,"<a href=""http://
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
"" target=""_blank"">
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
</a>")
End IF
IF Not DisUBB=1 Then
IF Not DisIMG=1 Then
re.Pattern="(\[img\])(.[^\]]*)(\[\/img\])"
strContent=re.Replace(strContent,"<img src=""
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
"" border=""0"" onload=""javascript:DrawImage(this);"" alt=""按此在新窗口打开图片"" onmouseover=""this.style.cursor='hand';"" onclick=""window.open(this.src);"" />")
'FlashUBB标签
re.Pattern="\[swf\](.*?)\[\/swf\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/flash.gif""> Flash</div><div style=""padding:6px""><a href=""javascript:hidden("&rndID&")""><img border=""0"" src=""images/hidden.gif"" width=""16"" height=""12""> 打开/隐藏Flash动画</a><div id="""&rndID&""" style=""overflow:hidden;display:none""><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"" width=""530"" height=""400""><param name=""movie"" value="""&strMatch.SubMatches(0)&"""><param name=""quality"" value=""high""><embed src="""&strMatch.SubMatches(0)&""" quality=""high"" pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""application/x-shockwave-flash"" width=""530"" height=""400""></embed></object></div></div></div>")
Next
Set strMatchs=nothing
'WMV标签
re.Pattern="\[wmv\](.*?)\[\/wmv\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/mm_avi.gif""> 视频播放器</div><div style=""padding:6px""><a href=""javascript:hidden("&rndID&")""><img border=""0"" src=""images/hidden.gif"" width=""16"" height=""12""> 打开/隐藏视频播放器</a><div id="""&rndID&""" style=""overflow:hidden;display:none""><object classid=""CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"" width=""450"" height=""350""><param name=""ShowStatusBar"" value=""-1""><param name=""AutoStart"" value=""False""><param name=""Filename"" value="""&strMatch.SubMatches(0)&"""></object></div></div></div>")
Next
Set strMatchs=nothing
'WMA标签
re.Pattern="\[wma\](.*?)\[\/wma\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/mm_snd.gif""> 音频播放器</div><div style=""padding:6px""><a href=""javascript:hidden("&rndID&")""><img border=""0"" src=""images/hidden.gif"" width=""16"" height=""12""> 打开/隐藏音频播放器</a><div id="""&rndID&""" style=""overflow:hidden;display:none""><object classid=""CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"" id=""MediaPlayer"" width=""450"" height=""70""><param name=""ShowStatusBar"" value=""-1""><param name=""AutoStart"" value=""True""><param name=""Loop"" value=""True""><param name=""Filename"" value="""&strMatch.SubMatches(0)&"""></object></div></div></div>")
Next
Set strMatchs=nothing
'RA标签
re.Pattern="\[ra\](.*?)\[\/ra\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/real.gif""> RealPlayer音频播放器</div><div style=""padding:6px""><a href=""javascript:hidden("&rndID&")""><img border=""0"" src=""images/hidden.gif"" width=""16"" height=""12""> 打开/隐藏RealPlayer音频播放器</a><div id="""&rndID&""" style=""overflow:hidden;display:none""><object classid=""clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA"" id=""RAOCX"" width=""450"" height=""60""><param name=""_ExtentX"" value=""6694""><param name=""_ExtentY"" value=""1588""><param name=""AUTOSTART"" value=""0""><param name=""SHUFFLE"" value=""0""><param name=""PREFETCH"" value=""0""><param name=""NOLABELS"" value=""0""><param name=""SRC"" value="""&strMatch.SubMatches(0)&"""><param name=""CONTROLS"" value=""StatusBar,ControlPanel""><param name=""LOOP"" value=""0""><param name=""NUMLOOP"" value=""0""><param name=""CENTER"" value=""0""><param name=""MAINTAINASPECT"" value=""0""><param name=""BACKGROUNDCOLOR"" value=""#000000""><embed src="""&strMatch.SubMatches(0)&""" width=""253"" autostart=""true"" height=""60""></embed></object></div></div></div>")
Next
Set strMatchs=nothing
'RM标签
re.Pattern="\[rm\](.*?)\[\/rm\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/real.gif""> RealPlayer视频播放器</div><div style=""padding:6px""><a href=""javascript:hidden("&rndID&")""><img border=""0"" src=""images/hidden.gif"" width=""16"" height=""12""> 打开/隐藏RealPlayer视频播放器</a><div id="""&rndID&""" style=""overflow:hidden;display:none""><object classid=""clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"" height=""350"" id=""Player"" width=""450"" viewastext><param name=""_ExtentX"" value=""12726""><param name=""_ExtentY"" value=""8520""><param name=""AUTOSTART"" value=""0""><param name=""SHUFFLE"" value=""0""><param name=""PREFETCH"" value=""0""><param name=""NOLABELS"" value=""0""><param name=""CONTROLS"" value=""ImageWindow""><param name=""CONSOLE"" value=""_master""><param name=""LOOP"" value=""0""><param name=""NUMLOOP"" value=""0""><param name=""CENTER"" value=""0""><param name=""MAINTAINASPECT"" value="""&strMatch.SubMatches(0)&"""><param name=""BACKGROUNDCOLOR"" value=""#000000""></object><br><object classid=""clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"" height=""32"" id=""Player"" width=""450"" VIEWASTEXT><param name=""_ExtentX"" value=""18256""><param name=""_ExtentY"" value=""794""><param name=""AUTOSTART"" value=""-1""><param name=""SHUFFLE"" value=""0""><param name=""PREFETCH"" value=""0""><param name=""NOLABELS"" value=""0""><param name=""CONTROLS"" value=""controlpanel""><param name=""CONSOLE"" value=""_master""><param name=""LOOP"" value=""0""><param name=""NUMLOOP"" value=""0""><param name=""CENTER"" value=""0""><param name=""MAINTAINASPECT"" value=""0""><param name=""BACKGROUNDCOLOR"" value=""#000000""><param name=""SRC"" value="""&strMatch.SubMatches(0)&"""></object></div></div></div>")
Next
Set strMatchs=nothing
'QuickTime标签
re.Pattern="\[qt\](.*?)\[\/qt\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/i_onair.gif""> 苹果播放器</div><div style=""padding:6px""><a href=""javascript:hidden("&rndID&")""><img border=""0"" src=""images/hidden.gif"" width=""16"" height=""12""> 打开/隐藏苹果播放器</a><div id="""&rndID&""" style=""overflow:hidden;display:none""><embed src="""&strMatch.SubMatches(0)&""" width=""480"" height=""380"" autoplay=""false"" Loop=""false"" controller=""true"" playeveryframe=""false"" cache=""false"" scale=""TOFIT"" bgcolor=""#000000"" kioskmode=""false"" targetcache=""false"" pluginspage=""http://www.apple.com/quicktime/""></div></div></div>")
Next
Set strMatchs=nothing
re.Pattern="(\[mid\])(.[^\]]*)(\[\/mid\])"
strContent= re.Replace(strContent,"<embed src=""
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
"" height=""45"" width=""314"" autostart=""0""></embed>")
End IF
re.Pattern = "\[url=(.[^\]]*)\](.[^\[]*)\[\/url]"
strContent = re.Replace(strContent,"<a target=""_blank"" href="""">
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
</a>")
re.Pattern = "\[url](.[^\[]*)\[\/url]"
strContent = re.Replace(strContent,"<a target=""_blank"" href=""""></a>")
re.Pattern = "\[email=(.[^\]]*)\](.[^\[]*)\[\/email]"
strContent = re.Replace(strContent,"<a href=""mailto:"">
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
</a>")
re.Pattern = "\[email](.[^\[]*)\[\/email]"
strContent = re.Replace(strContent,"<a href=""mailto:""></a>")
strContent = Replace(strContent,"[b]","<strong>")
strContent = Replace(strContent,"[/b]","</strong>")
strContent = Replace(strContent,"[i]","<i>")
strContent = Replace(strContent,"[/i]","</i>")
strContent = Replace(strContent,"[u]","<u>")
strContent = Replace(strContent,"[/u]","</u>")
strContent = Replace(strContent,"[fly]","<marquee width=""90%"" behavior=""alternate"" scrollamount=""3"">")
strContent = Replace(strContent,"[/fly]","</marquee>")
strContent = Replace(strContent,"[list]","<ul>")
strContent = Replace(strContent,"[list=1]","<ol type=""1"">")
strContent = Replace(strContent,"[list=a]","<ol type=""a"">")
strContent = Replace(strContent,"[list=A]","<ol type=""A"">")
strContent = Replace(strContent,"[*]","<li>")
strContent = Replace(strContent,"[/list]","</ul></ol>")
re.Pattern="\[font=([^<>\]]*?)\]"
strContent=re.Replace(strContent,"<font face="""">")
strContent=Replace(strContent,"[/font]","</font>")
re.Pattern="\[color=([^<>\]]*?)\]"
strContent=re.Replace(strContent,"<font color="""">")
strContent=Replace(strContent,"[/color]","</font>")
re.Pattern="\[align=([^<>\]]*?)\]"
strContent=re.Replace(strContent,"<div align="""">")
strContent=Replace(strContent,"[/align]","</div>")
re.Pattern="\[size=(\d*?)\]"
strContent=re.Replace(strContent,"<font size="""">")
strContent=Replace(strContent,"[/size]","</font>")
End IF
re.Pattern = "\[down=(.[^\]]*)\](.[^\[]*)\[\/down]"
strContent = re.Replace(strContent,"<img src=""images/download.gif"" align=""absmiddle"" /> <a href="""" target=""_blank"">
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
</a>")
'会员下载标签
re.Pattern = "\[vipdown=(.[^\]]*)\](.*?)\[\/vipdown]"
if memName=empty then
strContent = re.Replace(strContent,"<img src=""images/download.gif"" align=""absmiddle"" /> <b>本站会员方可下载。</b><a href=""register.asp""><font color=#ff0000>注册</font></a>|<a href=""logging.asp"" >登录</a>")
else
strContent = re.Replace(strContent,"<img src=""images/download.gif"" align=""absmiddle"" /> <a href="""" target=""_blank"">
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
</a>")
end if
re.Pattern="\[code\](.*?)\[\/code\]"
strContent= re.Replace(strContent,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/news_bullet.gif""> 程序代码</div><div style=""padding:6px""></div></div>")
re.Pattern="\[quote\](.*?)\[\/quote\]"
strContent= re.Replace(strContent,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/e1brepnew.gif""> 引用内容</div><div style=""padding:6px""></div></div>")
re.Pattern="\[html\](.*?)\[\/html\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent=Replace(strContent,strMatch.Value,"<div style=""border:1px dotted #8394B2;border-left:4px solid #8394B2;background:#FAFCFE""><div style=""background:#E4EAF2;padding:3px;font-weight:bold""><img src=""images/news_bullet.gif""> HTML代码</div><div style=""padding:6px""><TEXTAREA rows=""8"" style=""width:100%"" id="""&rndID&""">"&HTMLDecode(strMatch.SubMatches(0)) & "</TEXTAREA><br/><INPUT onclick=""runEx('"&rndID&"')"" type=""button"" value=""运行此代码""/> <INPUT onclick=""doCopy("&rndID&")"" type=""button"" value=""复制此代码""/> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]</div></div>",1,-1,1)
Next
Set strMatchs=nothing
IF Not DisSM=1 Then
dim log_Smilies,log_SmiliesContent
For Each log_Smilies IN Arr_Smilies
log_SmiliesContent=Split(log_Smilies,"|")
strContent=Replace(strContent,log_SmiliesContent(2)," <img src=""images/smilies/"&log_SmiliesContent(1)&""" border=""0"" align=""absmiddle"" />")
Next
End IF
IF AutoKEY=1 Then
dim log_Keywords,log_KeywordsContent
For Each log_Keywords IN Arr_Keywords
log_KeywordsContent=Split(log_Keywords,"$|{logcontent}quot;)
IF log_KeywordsContent(3)<>"None" Then
strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""&log_KeywordsContent(2)&""" target=""_blank""><img src=""images/keywords/"&log_KeywordsContent(3)&""" border=""0"" align=""absmiddle""> "&log_KeywordsContent(1)&"</a>")
Else
strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""&log_KeywordsContent(2)&""" target=""_blank"">"&log_KeywordsContent(1)&"</a>")
End IF
Next
End IF
Set re=Nothing
UBBCode=strContent
End IF
End Function
Rem 过滤脚本
Function Filter_Script(strContent)
If isEmpty(strContent) Or isNull(strContent) Then
Exit Function
Else
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
're.Pattern="(&#)"
'strContent=re.Replace(strContent,"&#")
re.Pattern="(var )"
strContent=re.Replace(strContent,"var..")
re.Pattern="(function )"
strContent=re.Replace(strContent,"function..")
re.Pattern="(meta )"
strContent=re.Replace(strContent,"meta..")
're.Pattern="(button )"
'strContent=re.Replace(strContent,"button..")
're.Pattern="(window)"
'strContent=re.Replace(strContent,"..window")
re.Pattern="(script)"
strContent=re.Replace(strContent,"script..")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"..js:")
're.Pattern="(value)"
'strContent=re.Replace(strContent,"..value")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"..about:" )
re.Pattern="(file:)"
strContent=re.Replace(strContent,"..file:")
re.Pattern="(Document.cookie)"
strContent=re.Replace(strContent,"..Document.cookie" )
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"..vbs:" )
re.Pattern="((ifr|fr)ame)"
strContent=re.Replace(strContent,"
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
ame" &chr(30))
re.Pattern="(on(mouse|Exit|error|click|key|load))"
strContent=re.Replace(strContent,"on..
{logsummary}
标签集:TAGS:{tags}
{phototitle}
- 点击:Hits:{viewcount}
- 发表:PostTime:{posttime}
{logsummary}
{logtitle}
{logcontent}
标签集:TAGS:{tags}
点击Count({viewcount})
")
Filter_Script=strContent
End If
End Function
%>
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}