⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ms_ubb.asp

📁 本系统是一套开源WEB的网站管理系统
💻 ASP
字号:
<%
''==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1   Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com   www.maosin.net
'      QQ:57861417  
'电子邮箱:maosin@163.com  maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
Function ubbCode(strTemp,dishtml,disMedia,disImg,autoUrl)
	if strTemp="" or isNull(strTemp) then
		ubbCode=strTemp
		exit Function
	end if
	dim reg
	set reg=new Regexp
		reg.IgnoreCase=True
		reg.Global=True
		strTemp=FilterJS(strTemp,reg)
	if dishtml=1 then
		strTemp=HTMLENCode(strTemp)
	end if
	reg.Pattern="\[b\](.*)(\[\/b\])"
	strTemp=reg.replace(strTemp,"<b>$1</b>")
	reg.Pattern="\[i\](.[^\[]*)(\[\/i\])"
	strTemp=reg.replace(strTemp,"<i>$1</i>")
	reg.Pattern="\[u\](.[^\[]*)(\[\/u\])"
	strTemp=reg.replace(strTemp,"<u>$1</u>")
	reg.Pattern="\[align=(.*)\](.[^\[]*)(\[\/align\])"
	strTemp=reg.replace(strTemp,"<div align=$1>$2</div>")
	reg.Pattern="\[sub\](.*)(\[\/sub\])"
	strTemp=reg.replace(strTemp,"<sub>$1</sub>")
	reg.Pattern="\[sup\](.*)(\[\/sup\])"
	strTemp=reg.replace(strTemp,"<sup>$1</sup>")
	reg.Pattern="\[font=([^<>\]]*?)\](.*?)\[\/font]"
	strTemp=reg.Replace(strTemp,"<font face=""$1"">$2</font>")
	reg.Pattern="\[color=([^<>\]]*?)\](.*?)\[\/color]"
	strTemp=reg.Replace(strTemp,"<font color=""$1"">$2</font>")
	reg.Pattern="\[size=(\-{0,1}[1-7])\](.[^\[]*)\[\/size]"
	strTemp=reg.Replace(strTemp,"<font size=""$1"">$2</font>")
	reg.Pattern="\[email=(.[^\]]*)\](.*?)\[\/email]"
	strTemp=reg.Replace(strTemp,"<a href=""mailto:$1"">$2</a>")
	reg.Pattern="\[url](.[^\[]*)\[\/url\]"
	strTemp=reg.Replace(strTemp,"<a href=$1 target=""_blank"">$1</a>")
	reg.Pattern="\[url=(.[^\]]*)\](.[^\[]*)\[\/url]"
	strTemp=reg.Replace(strTemp,"<a href=$1 target=""_blank"">$2</a>")
	reg.Pattern="\[quote\](.[^\[]*)\[\/quote\]"
	strTemp=reg.Replace(strTemp,"<div style=""padding:2px;background-color:#f8f8f8;border:1px dotted #dddddd;""><b>以下为引用内容:</b><br>$1</div>")
	reg.Pattern="\[code\](.[^\[]*)\[\/code\]"
	rndstr=int(9898*rnd+123)
	strTemp=reg.Replace(strTemp,"<div><b>以下为程序代码:</b></div><div style=""padding:3px;background-color:#f8f8f8;border:1px dotted #dddddd;"" id=""mycode_"&rndstr&""">$1</div><div align=""center"" style=""padding:3px;""><a href=""javascript:runCode(document.all.mycode_"&rndstr&");"">运行代码</a>&nbsp; <a href=""javascript:saveCode(document.all.mycode_"&rndstr&");"">保存代码</a>&nbsp; <a href=""javascript:copyText(document.all.mycode_"&rndstr&");"">复制代码</a></div>")
	strTemp=Replace(strTemp,"[list]","<ul>")
	strTemp=Replace(strTemp,"[list=1]","<ol type=""1"">")
	strTemp=Replace(strTemp,"[list=a]","<ol type=""a"">")
	strTemp=Replace(strTemp,"[list=A]","<ol type=""A"">")
	strTemp=Replace(strTemp,"[*]","<li>")
	strTemp=Replace(strTemp,"[/list]","</ul></ol>")
	reg.Pattern="\[fly\](.[^\[]*)\[\/fly\]"
	strTemp=reg.Replace(strTemp,"<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>")
	reg.Pattern="\[move\](.[^\[]*)\[\/move\]"
	strTemp=reg.Replace(strTemp,"<MARQUEE scrollamount=3>$1</marquee>")
	reg.Pattern="\[glow=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/glow]"
	strTemp=reg.Replace(strTemp,"<div style=""width:$1px;filter:glow(color=$2, strength=$3)"">$4</div>")
	reg.Pattern="\[shadow=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/shadow]"
	strTemp=reg.Replace(strTemp,"<div style=""width:$1px;filter:shadow(color=$2, strength=$3)"">$4</div>")
	reg.Pattern="^((http|ftp|https|mms|rtsp):\/{2}(.{1,}\.[a-zA-Z]{2,3}))"
	'reg.Pattern="^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)"
	strTemp=reg.replace(strTemp,"<a href=$1 target=_blank>$1</a>")
	reg.Pattern="\s((www|cn)\.\w+\.[a-zA-Z]{2,3})"'自动识别www开头
	strTemp=reg.replace(strTemp,"<a href=http://$1 target=_blank>$1</a>")
	if disMedia=1 then
		reg.Pattern="\[swf\](.*?)\[\/swf\]"
		strTemp=reg.Replace(strTemp,"<a href=""$1"" TARGET=_blank><IMG SRC=Images/Fileicon/swf.gif border=0 alt=""点击开新窗口欣赏该FLASH动画!"">[全屏欣赏]</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=""$1""><PARAM NAME=quality VALUE=high><embed src=""$1"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=500 height=400>$1</embed></OBJECT>")
		reg.Pattern="\[wmv=([0-9]{0,3}),([0-9]{0,3})\](.[^\[]*)\[\/wmv\]"
		strTemp=reg.replace(strTemp,"<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></object>")
		reg.Pattern="\[wma=([0-9]{0,3}),([0-9]{0,3})\](.[^\[]*)\[\/wma\]"
		strTemp=reg.replace(strTemp,"<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><embed src=$3 pluginspage=http://www.macromedia.com/shockwave/download/ width=$1 height=$2></embed></object>")
		reg.Pattern="\[rm=([0-9]{0,3}),([0-9]{0,3})\](.[^\[]*)\[\/rm\]"
		strTemp=reg.replace(strTemp,"<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>")
		reg.Pattern="\[qt=([0-9]{0,3}),([0-9]{0,3})\](.[^\[]*)\[\/qt\]"
		strTemp=reg.replace(strTemp,"<embed src=$3 width=$1 height=$2 autoplay=true loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>")
	end if
	if disImg=1 then
		reg.Pattern="\[img\](.*?)\[\/img\]"
		strTemp=reg.Replace(strTemp,"<img onmousewheel=""return cgimg(this);""  onload=""javascript:gbDrawImage(this);"" onclick=""window.open(this.src)"" src=""$1"" title=""点击图片在新窗口中打开"">")
	end if
	if autoUrl=1 then
		'自动识别网址
		reg.Pattern="^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]:+!]+([^<>""|'])+)"
		strTemp=reg.Replace(strTemp,"<a target=_blank href=$1>$1</a>")
		reg.Pattern="((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]:+!]+([^<>""])+)$([^\[|']*)"
		strTemp=reg.Replace(strTemp,"<a target=_blank href=$1>$1</a>")
		reg.Pattern="([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]:+!]+([^<>""|'])+)"
		strTemp=reg.Replace(strTemp,"$1<a target=_blank href=$2>$2</a>")
		'自动识别www等开头的网址
		reg.Pattern="([\s])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*)*)"
		strTemp=reg.Replace(strTemp,"<a target=_blank href=""http://$2"">$2</a>")
	end if
	set reg=nothing
	ubbCode=strTemp
End Function
Function FilterJS(s,reg)'转换有害代码
	if s="" or isNull(s)=true then
		filterJS=s
		exit function
	end if
	reg.Pattern="(<s+cript(.[^>]*)>)"
	s=reg.replace(s,"&lt;&#83cript$2&gt;")
	reg.Pattern="(<\/s+cript>)"
	s=reg.Replace(s,"&lt;/&#83cript&gt;")
	reg.Pattern="(<body(.[^>]*)>)"
	s=reg.Replace(s,"<body>")
	reg.Pattern="(<\!(.[^>]*)>)"
	s=reg.Replace(s,"&lt;$2&gt;")
	reg.Pattern="(<\!)"
	s=reg.Replace(s,"&lt;!")
	reg.Pattern="(-->)"
	s=reg.Replace(s,"--&gt;")
	reg.Pattern="(javascript:)"
	s=reg.Replace(s,"#i#javascript#i#:")
	's=reg.Replace(s,"&#106avascript:")
	reg.Pattern="<((asp|\!|%))"
	s=reg.Replace(s,"&lt;$1")
	reg.Pattern="<(\w+)(&nbsp;)+([^>]*)>"
	s=reg.Replace(s,"<$1 $3>")
	reg.Pattern="\[(br)\]"
	s=reg.Replace(s,"<$1>")
	reg.Pattern="(jscript:)"
	s=reg.Replace(s,"#i#jscript#i#:")
	's=reg.Replace(s,"&#106script:")
	reg.Pattern="(js:)"
	s=reg.Replace(s,"&#106s:")
	reg.Pattern="(about:)"
	s=reg.Replace(s,"about&#58")
	reg.Pattern="(file:)"
	s=reg.Replace(s,"file&#58")
	reg.Pattern="(document.cookie)"
	s=reg.Replace(s,"documents&#46cookie")
	reg.Pattern="(vbscript:)"
	s=reg.Replace(s,"#i#vbscript#i#:")
	's=reg.Replace(s,"&#118bscript:")
	reg.Pattern="(vbs:)"
	s=reg.Replace(s,"&#118bs:")
	reg.Pattern="(on(mouse|exit|error|click|key))"
	s=reg.Replace(s,"&#111n$2")
	reg.Pattern="(<!--{%)"
	s=reg.Replace(s,"&#123;&#37;")
	reg.Pattern="(%}-->)"
	s=reg.Replace(s,"&#37;&#125;")
	FilterJS=s
End Function
Function HTMLEncode(reString) '转换HTML代码
Dim Str:Str=reString
If Not IsNull(Str) Then
	Str=Replace(Str, "&", "&amp;")
	Str=Replace(Str, ">", "&gt;")
	Str=Replace(Str, "<", "&lt;")
	Str=replace(Str," ","&nbsp")'空格
	Str=Replace(Str, CHR(32),"&nbsp;")
	Str=Replace(Str, CHR(9), "&nbsp;&nbsp;&nbsp;&nbsp;")'table
	Str=Replace(Str, CHR(34),"&quot;")
	Str=Replace(Str, CHR(39),"&#39;")
	Str=replace(Str,"'","&#39;")		'单引号
	Str=replace(Str,"""","&quot;")
	Str=Replace(Str, CHR(13), "")
	Str=Replace(Str, CHR(10), "<br>")
	HTMLEncode=Str
End If
End Function
'========================================================
'MaoSin CMS 1.1      Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com  http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -