📄 const.asp
字号:
<%
Function Ubbcode(strContent)
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="\[code\][\n\r]*(.+?)[\n\r]*\[\/code\]"
strContent=re.Replace(strContent,"<table border='0' width='90%' cellspacing='0' cellpadding='0' align='center'><tr><td>程序代码:</td></tr><tr><td><table border='0' width='100%' cellspacing='1' cellpadding='10'><tr><td width='100%' bgcolor='#FFFFFF' class='code'>$1</td></tr></table></td></tr></table>")
re.Pattern="\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]"
strContent=re.Replace(strContent,"<table border='0' width='90%' cellspacing='0' cellpadding='0' align='center'><tr><td>引用内容:</td></tr><tr><td><table border='0' width='100%' cellspacing='1' cellpadding='10'><tr><td width='100%' bgcolor='#FFFFFF' class='code'>$1</td></tr></table></td></tr></table>")
re.Pattern="\[size=(.+?)\]"
strContent=re.Replace(strContent,"<font size='$1'>")
re.Pattern="\[font=(.+?)\]"
strContent=re.Replace(strContent,"<font face='$1'>")
re.Pattern="\[align=(.+?)\]"
strContent=re.Replace(strContent,"<p align='$1'>")
strContent=Replace(strContent,"[/size]","</font>",1,-1,1)
strContent=Replace(strContent,"[/font]","</font>",1,-1,1)
strContent=Replace(strContent,"[/align]","</p>",1,-1,1)
strContent=Replace(strContent,"[b]","<b>",1,-1,1)
strContent=Replace(strContent,"[/b]","</b>",1,-1,1)
strContent=Replace(strContent,"[i]","<i>",1,-1,1)
strContent=Replace(strContent,"[/i]","</i>",1,-1,1)
strContent=Replace(strContent,"[u]","<u>",1,-1,1)
strContent=Replace(strContent,"[/u]","</u>",1,-1,1)
strContent=Replace(strContent,"[fly]","<marquee width='90%' behavior='alternate' scrollamount='3'>",1,-1,1)
strContent=Replace(strContent,"[/fly]","</marquee>",1,-1,1)
strContent=Replace(strContent,"[list]","<ul>",1,-1,1)
strContent=Replace(strContent,"[list=1]","<ol type=1>",1,-1,1)
strContent=Replace(strContent,"[list=A]","<ol type=A>",1,-1,1)
strContent=Replace(strContent,"[*]","<li>",1,-1,1)
strContent=Replace(strContent,"[/list]","</ul></ol>",1,-1,1)
re.Pattern="(\[\/color\])"
strContent=re.Replace(strContent,"[/color]" & VbCrLf)
re.Pattern="\[color=*(#*[a-z0-9]*)\](.*)\[\/color\]"
strContent=re.Replace(strContent,"<font color=""$1"">$2</font>")
strContent = Replace(strContent,VbCrLf,"")
re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<A HREF=""mailto:$2"">$2</A>")
re.Pattern="(\[\/EMAIL\])"
strContent=re.Replace(strContent,"[/EMAIL]" & VbCrLf)
re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<A HREF=""mailto:$2"">$3</A>")
strContent = Replace(strContent,VbCrLf,"")
re.Pattern="(\[\/URL\])"
strContent=re.Replace(strContent,"[/URL]" & VbCrLf)
re.Pattern="(\[URL\])(.*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
strContent = Replace(strContent,VbCrLf,"")
re.Pattern="\[MP\](.[^\[]*)\[\/MP]"
strContent=re.Replace(strContent,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=320 height=240 ><param name=ShowStatusBar value=-1><param name=Filename value=$1><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$1 width=320 height=240></embed><PARAM NAME=AUTOSTART VALUE=-1></object>")
re.Pattern="\[MP\](.[^\[]*)\[\/MP]"
strContent= re.Replace(strContent,"<a href=""$1"" TARGET=_blank><IMG SRC=../images/FileType/mp3.gif border=0 align=absmiddle height=16 width=16>[点击打开此文件,注意此文件可能含有不安全内容]</a>")
re.Pattern="\[MP=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/MP]"
strContent=re.Replace(strContent,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=$1 height=$2 ><param name=ShowStatusBar value=-1><param name=Filename value=$3><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$3 width=$1 height=$2></embed><PARAM NAME=AUTOSTART VALUE=0></object>")
re.Pattern="\[MP=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/MP]"
strContent= re.Replace(strContent,"<a href=""$3"" TARGET=_blank><IMG SRC=../images/FileType/mp3.gif border=0 align=absmiddle height=16 width=16>[点击打开此文件,注意此文件可能含有不安全内容]</a>")
re.Pattern="\[RM\](.[^\[]*)\[\/RM]"
strContent=re.Replace(strContent,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=320 height=240><PARAM NAME=SRC VALUE=$1><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=true></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=320><PARAM NAME=SRC VALUE=$1><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>")
re.Pattern="\[RM=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/RM]"
strContent=re.Replace(strContent,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=$1 height=$2><PARAM NAME=SRC VALUE=$3><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=true</OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=$1><PARAM NAME=SRC VALUE=$3><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>")
re.Pattern="(\[swf\])(http://|ftp://|../)(.[^\[]*)(.swf)(\[\/swf\])"
strContent= re.Replace(strContent,"<a href=""$2$3$4"" TARGET=_blank><IMG SRC=images/swf.gif border=0 align=absmiddle height=16 width=16>[全屏欣赏]</a><br><OBJECT codeBase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0"" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400><PARAM NAME=movie VALUE=""$2$3$4""><PARAM NAME=quality VALUE=high><embed src=""http://$3$4"" quality=high pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type='application/x-shockwave-flash' width=500 height=400>$2$3$4</embed></OBJECT>")
strContent= re.Replace(strContent,"<a href=""$2$3$4"" TARGET=_blank><IMG SRC=images/swf.gif border=0 align=absmiddle height=16 width=16>[全屏欣赏,注意Flash可能含有不安全内容]</a>")
re.Pattern="(\[swf=*([0-9]*),*([0-9]*)\])(http://|ftp://|../)(.[^\[]*)(.swf)(\[\/swf\])"
strContent= re.Replace(strContent,"<a href=""$4$5$6"" TARGET=_blank><IMG SRC=images/swf.gif border=0 alt=点击开新窗口欣赏该FLASH动画! height=16 width=16>[全屏欣赏]</a><br><OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=$2 height=$3><PARAM NAME=movie VALUE=""$4$5$6""><PARAM NAME=quality VALUE=high><embed src=""$4$5$6"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=$2 height=$3>$4$5$6</embed></OBJECT>")
strContent= re.Replace(strContent,"<a href=""$4$5$6"" TARGET=_blank><IMG SRC=images/swf.gif border=0 align=absmiddle height=16 width=16>[全屏欣赏,注意Flash可能含有不安全内容]</a>")
re.Pattern="(\[\/img\])"
strContent=re.Replace(strContent,"[/img]" & VbCrLf)
re.Pattern="\[img=*([0-9]*),(absmiddle|left|right|top|middle|bottom|absbottom|baseline|texttop)\](/|../|http://|https://|ftp://)([A-Za-z0-9\./=\?%\-&_~`@[\]\':+!#]+)\[\/img]"
strContent=re.Replace(strContent,"<IMG onmouseover=""javascript:if(this.width>570)this.width=570;"" style=""CURSOR: hand"" onclick=javascript:window.open(this.src); src=""$3$4"" onload=""javascript:if(this.width>570)this.width=570;"" align=$2 border=$1>")
re.Pattern="\[img\](/|../|http://|https://|ftp://)([A-Za-z0-9\./=\?%\-&_~`@[\]\':+!#]+)\[\/img]"
strContent=re.Replace(strContent,"<IMG onmouseover=""javascript:if(this.width>570)this.width=570;"" style=""CURSOR: hand"" onclick=javascript:window.open(this.src); src=""$1$2"" onload=""javascript:if(this.width>570)this.width=570;"" align=absmiddle border=0>")
strContent = Replace(strContent,VbCrLf,"")
Ubbcode=strContent
End Function
'*******************************************
'留言过滤
dim Badwords
call getbadwords()
function HTMLEncode(fString)
'on error resume next
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
fString=ChkBadWords(fString)
'if err<>"0" then
' HTMLEncode="出错"
'else
HTMLEncode = fString
'Response.Write HTMLEncode
'Response.End
'end if
end if
end function
function ChkBadWords(fString)
dim bwords
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 HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLcode = fString
end if
end function
sub getbadwords()
sql = "select badwords from ys_messageboard_config "
set rs = server.CreateObject ("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then badwords=trim(rs("badwords"))
rs.close
set rs=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -