📄 ubb.asp
字号:
<!--#include file="conn.asp" -->
<%
'取得变量
sqlconn1="select h_signimg,h_flash,h_img,h_ubb,h_html, h_jiami from home"
set rsconn1=conn.execute(sqlconn1)
if not rsconn1.eof then
h_signimg=rsconn1("h_signimg")'显示签名图片
h_flash=rsconn1("h_flash")'显示flash
h_img=rsconn1("h_img")'显示图片
h_ubb=rsconn1("h_ubb")'显示ubb
h_html=rsconn1("h_html")'显示html
h_jiami=rsconn1("h_jiami")'禁止加密内容字段
end if
set rsconn1=nothing
'---------------- 过滤表单字符--------------------
function HTMLcode(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
fString=ChkBadWords(fString)
HTMLcode = fString
end function
function htmldecode(fString)
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, "</P><P>", CHR(10) & CHR(10))
fString = Replace(fString, "<BR>", CHR(10))
fString = Replace(fString, "<I></I> ", CHR(32))
htmldecode = fString
end function
function cpbhtmlencode(fString)
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), "<I></I> ")
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)
cpbhtmlencode = fString
end function
function UBBCode(strContent)
if h_html<>"1" then '检查是否启用html代码
strContent = cpbhtmlencode(strContent)
else
strContent = HTMLcode(strContent)
end if
if h_ubb<>"1" then'检查是否启用ubb代码
dim re
Set re=new RegExp' 建立正则表达式
re.IgnoreCase =true'忽略大小写
re.Global=True' 设置全局可用
re.Pattern="(javascript)"
strContent=re.Replace(strContent,"javascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"jscript:")
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,"documents.cookie")
re.Pattern="(vbscript:)"
strContent=re.Replace(strContent,"vbscript:")
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"vbs:")
re.Pattern="(on(mouse|exit|error|click|key))"
strContent=re.Replace(strContent,"on$2")
if checklockubbreply=0 or checklockubb=0 then
if h_img<>"1" then
re.Pattern="(\[IMG\])(http|https|ftp):\/\/(.[^\[]*)(\[\/IMG\])"
strContent=re.Replace(strContent,"<a onfocus=this.blur() href=""$2://$3"" target=_blank><IMG SRC=""$2://$3"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-300)this.width=screen.width-300""></a><br>")
re.Pattern="(\[uploadIMG\])(.[^\[]*)(\[\/uploadIMG\])"
strContent=re.Replace(strContent,"<br><b>上传图片</b>:<br><a href=""upload/$2"" target=_blank><IMG SRC=""upload/$2"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-300)this.width=screen.width-300""><a>")
re.Pattern="\[upload=(gif|jpg|jpeg|bmp|png)\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/upload\]"
strContent=re.Replace(strContent,"<br><b>上传图片</b>:<br><a href=""upload/$2$1"" target=_blank><IMG SRC=""upload/$2$1"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-300)this.width=screen.width-300""><a>")
end if
re.Pattern="(\[uploadfile\])(.[^\[]*)(\[\/uploadfile\])"
strContent=re.Replace(strContent,"<br><b>上传文件</b>:<br><a href=""upload/$2"" target=_blank title=按此浏览上传文件>按此浏览<a><br>")
re.Pattern="\[upload=(.[^\[]*)\](.[^\[]*)\[\/upload\]"
strContent=re.Replace(strContent,"<br><b>上传文件</b>:<br><a href=""upload/$2"" target=_blank title=按此浏览上传文件>按此浏览<a><br>")
re.Pattern="(\[sound\])(.[^\[]*)(\[\/sound\])"
strContent=re.Replace(strContent,"<br><b>加有背景音乐:</b><br><a href=""$2"" target=_blank title=按此收听>按此收听<a><br><bgsound src=""$2"">")
re.Pattern="(\[download\])(.[^\[]*)(\[\/download\])"
strContent=re.Replace(strContent,"<IMG SRC=image/download.gif border=0><a href=""$2"" target=_blank title=点击下载><b>CPB--点击下载</b></a><BR>")
re.Pattern="\[DIR=*([0-9]*),*([0-9]*)\](http|https|ftp|mms):\/\/(.[^\[]*)\[\/DIR]"
strContent=re.Replace(strContent,"<BR><b>影视文件:</b><a href=$3://$4>$3://$4</a><BR><object classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0 width=$1 height=$2><param name=src value=$3://$4><embed src=""$3://$4"" pluginspage=http://www.macromedia.com/shockwave/download/ width=$1 height=$2></embed></object><BR>")
re.Pattern="\[QT=*([0-9]*),*([0-9]*)\](http|https|rtsp|ftp|mms):\/\/(.[^\[]*)\[\/QT]"
strContent=re.Replace(strContent,"<BR><b>影视文件:</b><a href=$3://$4>$3://$4</a><BR><embed src=$3://$4 width=$1 height=$2 autoplay=false loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/><BR>")
re.Pattern="\[MP=*([0-9]*),*([0-9]*)\](http|rtsp|https|ftp|mms):\/\/(.[^\[]*)\[\/MP]"
strContent=re.Replace(strContent,"<BR><b>影视文件:</b><a href=$3://$4>$3://$4</a><BR><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://$4><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://$4 width=$1 height=$2></embed></object><BR>")
re.Pattern="\[RM=*([0-9]*),*([0-9]*)\](http|https|rtsp|ftp|mms):\/\/(.[^\[]*)\[\/RM]"
strContent=re.Replace(strContent,"<BR><b>影视文件:</b><a href=$3://$4>$3://$4</a><BR><OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=$1 height=$2><PARAM NAME=SRC VALUE=$3://$4><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=false></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=$1><PARAM NAME=SRC VALUE=$3://$4><PARAM NAME=AUTOSTART VALUE=0><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT><BR>")
'flash转换
if h_flash<>"1" then
re.Pattern="\[FLASH\](http|https|ftp):\/\/(.[^\[]*)\[\/FLASH\]"
strContent= re.Replace(strContent,"<BR><a href=$1://$2 target=_blank>[全屏欣赏]</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=480 height=280><PARAM NAME=movie VALUE=""$1://$2""><PARAM NAME=quality VALUE=high><embed src=""$1://$2"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=480 height=280>$1://$2</embed></OBJECT><BR>")
re.Pattern="(\[FLASH=*([0-9]*),*([0-9]*)\])(.[^\[]*)(\[\/FLASH\])"
strContent= re.Replace(strContent,"<BR><a href=$4 target=_blank>[全屏欣赏]</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""><PARAM NAME=quality VALUE=high><embed src=""$4"" 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</embed></OBJECT>")
end if
'url与email 转换
re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$3</A>")
re.Pattern="(\[EMAIL\])((\w)+[@]{1}(\w)+[.]{1,3}(\w)+)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=image/email.gif><A HREF=""mailto:$2"">$2</A>")
re.Pattern="(\[EMAIL=((\w)+[@]{1}(\w)+[.]{1,3}(\w)+)\])(.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=image/email.gif><A HREF=""mailto:$2"" TARGET=_blank>$3</A>")
'代码转换
re.Pattern="\[code\](.[^\[]*)\[\/code\]"
strContent=re.Replace(strContent,"<table width='100%' border='0' cellspacing='0' cellpadding='6' bgcolor='"&bgcolor1&"' class=tdc><td><b>以下为程序代码:</b><br>$1</td></table>")
'代码转换
re.Pattern="\[html\](.[^\[]*)\[\/html\]"
strContent=re.Replace(strContent,"<br><b>以下为html代码:<textarea id=fy"&rcount&" style=width:95% rows=10 class=bdtj3>$1</textarea><br><script src=js/open.js></script><INPUT onclick=runEx() type=button value=运行此段代码 name=Button1 class=bdtj3> <INPUT onclick=JM_cc('fy"&rcount&"') type=button value=复制到我的剪贴板 name=Button2 class=bdtj3></B><Br>如果看不到效果或效果有问题,请将代码保存为html文件查看.<br>")
'引用
re.Pattern="(\[QUOTE\])(.*)(\[\/QUOTE\])"
replstr="<BLOCKQUOTE><BLOCKQUOTE>引用:<hr size=1 class=tdc2>$2<hr class=tdc2 size=1></BLOCKQUOTE></BLOCKQUOTE>"
Set Matches=re.Execute(strContent)
'加多这个循环为的是ubb可以套用
for each Match in matches
strcontent = re.Replace(strContent, replStr)
strcontent = re.Replace(strcontent, replStr)
next
'一般的文字处理
re.Pattern="\[i\](.[^\[]*)\[\/i\]"
strContent=re.Replace(strContent,"<i>$1</i>")
re.Pattern="\[u\](.[^\[]*)(\[\/u\])"
strContent=re.Replace(strContent,"<u>$1</u>")
re.Pattern="\[b\](.[^\[]*)(\[\/b\])"
strContent=re.Replace(strContent,"<b>$1</b>")
re.Pattern="\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]"
strContent=re.Replace(strContent,"<font color=$1>$2</font>")
re.Pattern="\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]"
strContent=re.Replace(strContent,"<font face=$1>$2</font>")
re.Pattern="\[font=(.[^\[]*)\](.[^\[]*)\[\/font\]"
strContent=re.Replace(strContent,"<font face=$1>$2</font>")
re.Pattern="\[size=(.[^\[]*)\](.[^\[]*)\[\/size\]"
strContent=re.Replace(strContent,"<font size=$1>$2</font>")
re.Pattern="\[align=(center|left|right)\](.[^\[]*)\[\/align\]"
strContent=re.Replace(strContent,"<div align=$1>$2</div>")
re.Pattern="\[fly\](.[^\[]*)\[\/fly\]"
strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>")
re.Pattern="\[move\](.[^\[]*)\[\/move\]"
strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$1</marquee>")
re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")
strContent=replace(strContent,"[br]","<br>")
'心情图标转换
re.Pattern="em([0-9]*):"
strContent=re.replace(strContent,"<img src='emot/em$1.gif' border='0'>")
if h_jiami<>"1" then
re.Pattern="(\[login\])(.[^\[]*)(\[\/login\])"
if isuser=false then
strContent=re.Replace(strContent,"<center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,必须登陆后才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center></center>")
else
strContent=re.Replace(strContent,"注意:<U>本贴为登陆显示贴</u>:$2")
end if
re.Pattern="(\[replyview\])(.[^\[]*)(\[\/replyview\])"
if (chkreply or issupermaster or ismaster or chkbanzhu) and isuser then
strContent=re.Replace(strContent,"注意:<U>本贴为回复显示贴</u>:$2")
else
strContent=re.Replace(strContent,"<center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,必须回复本帖才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center>")
end if
'经验
re.Pattern="(^.*)(\[fen=*([0-9]*)\])(.[^\[]*)(\[\/fen\])(.*)"
fend=re.Replace(strContent,"$3")
if IsNumeric(fend) then
if chktopic1 or chkbanzhu or issupermaster or ismaster or fycpbfen>int(fend) then
strContent=re.Replace(strContent,"$1<BR>注意:<U>本贴为经验贴,只有经验值大于$3才能观看</u>:$4<BR>$6")
else
strContent=re.Replace(strContent,"$1<BR><center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,只有经验值大于$3才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center><BR>$6")
end if
end if
'金钱
re.Pattern="(^.*)(\[money=*([0-9]*)\])(.[^\[]*)(\[\/money\])(.*)"
moneyd=re.Replace(strContent,"$3")
if IsNumeric(moneyd) then
if chktopic1 or chkbanzhu or issupermaster or ismaster or fycpbmoney>int(moneyd) then
strContent=re.Replace(strContent,"$1<BR>注意:<U>本贴为金钱贴,只有金钱大于$3才能观看</u>:$4<BR>$6")
else
strContent=re.Replace(strContent,"$1<BR><center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,只有金钱值大于$3才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center><BR>$6")
end if
end if
'魅力
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -