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

📄 dv_ubbcode.asp

📁 前台及后台用户名密码都是:gz35gz35.com
💻 ASP
📖 第 1 页 / 共 5 页
字号:
				s = re.Replace(s,"<a target=_blank href=""http://$2"">$2</a>")
			End If
		End If
		Dv_UbbCode=bbimg(s,350)
		Set Re=Nothing
	End Function
	Private Function bbimg(strText,ssize)
		Dim s
		s=strText
		re.Pattern="<img(.[^>]*)>"
		If ssize=350 Then
			s=re.replace(s,"<img$1 onmousewheel=""return bbimg(this)"" onload=""if(this.width>clubwidth-"&ssize&")this.style.width=clubwidth-"&ssize&";if(this.height>450)this.style.width=this.width*450/this.height;"">")
		Else
			s=re.replace(s,"<img$1 onload=""if(this.width>clubwidth-"&ssize&")this.style.width=clubwidth-"&ssize&";if(this.height>250)this.style.width=(this.width*250)/this.height;"">")
		End If
		bbimg=s
	End Function
	'签名UBB转换
	Public Function Dv_SignUbbCode(s,PostUserGroup)
		Dim ii
		Dim po
		Set re=new RegExp
		re.IgnoreCase =True
		re.Global=True
		If Dvbbs.forum_setting(66)="0" Then 
			s= server.htmlEncode(s)
			If Dv_FilterJS2(s)Then
				re.Pattern="\[(br)\]"
				s=re.Replace(s,"<$1>")
				re.Pattern = "(&nbsp;)"
				s = re.Replace(s,Chr(9))
				re.Pattern = "(<br>)"
				s = re.Replace(s,vbNewLine)
				re.Pattern = "(<p>)"
				s = re.Replace(s,"")
				re.Pattern = "(<\/p>)"
				s = re.Replace(s,vbNewLine)
				s=server.htmlencode(s)
				s="<form name=""scode"&replyid&""" method=""post"" action=""""><TABLE class=tableborder2 cellSpacing=1 cellPadding=3 width=""100%"" align=center border=0><TR><TH height=22>以下内容含脚本,或可能导致页面不正常的代码</TH></TR><TR><TD class=tablebody1 align=middle width=""98%""><TEXTAREA id=CodeText style=""BORDER-RIGHT: 1px dotted; BORDER-TOP: 1px dotted; OVERFLOW-Y: visible; OVERFLOW: visible; BORDER-LEFT: 1px dotted; WIDTH: 98%; COLOR: #000000; BORDER-BOTTOM: 1px dotted"" rows=20 cols=120>"&s&"</TEXTAREA></TD></TR><TR><TD class=tablebody2 align=middle width=""98%""><b>说明:</b>上面显示的是代码内容。您可以先检查过代码没问题,或修改之后再运行.</td></tr><TR><TD class=tablebody1 align=middle width=""98%""><input type=""button"" name=""run"" value=""运行代码"" onclick=""Dvbbs_ViewCode("&replyid&");""></TD></TR></TABLE></form>"
					s = Replace(s, vbNewLine, "")
					s = Replace(s, CHR(10), "")
					s = Replace(s, CHR(13), "")
				Dv_SignUbbCode=s
				Exit Function
			End If
		Else
			If Dv_FilterJS(s) Then
				re.Pattern="\[(br)\]"
				s=re.Replace(s,"<$1>")
				re.Pattern = "(&nbsp;)"
				s = re.Replace(s,Chr(9))
				re.Pattern = "(<br>)"
				s = re.Replace(s,vbNewLine)
				re.Pattern = "(<p>)"
				s = re.Replace(s,"")
				re.Pattern = "(<\/p>)"
				s = re.Replace(s,vbNewLine)
				s=server.htmlencode(s)
				s="<form name=""scode"&replyid&""" method=""post"" action=""""><TABLE class=tableborder2 cellSpacing=1 cellPadding=3 width=""100%"" align=center border=0><TR><TH height=22>以下内容含脚本,或可能导致页面不正常的代码</TH></TR><TR><TD class=tablebody1 align=middle width=""98%""><TEXTAREA id=CodeText style=""BORDER-RIGHT: 1px dotted; BORDER-TOP: 1px dotted; OVERFLOW-Y: visible; OVERFLOW: visible; BORDER-LEFT: 1px dotted; WIDTH: 98%; COLOR: #000000; BORDER-BOTTOM: 1px dotted"" rows=20 cols=120>"&s&"</TEXTAREA></TD></TR><TR><TD class=tablebody2 align=middle width=""98%""><b>说明:</b>上面显示的是代码内容。您可以先检查过代码没问题,或修改之后再运行.</td></tr><TR><TD class=tablebody1 align=middle width=""98%""><input type=""button"" name=""run"" value=""运行代码"" onclick=""Dvbbs_ViewCode("&replyid&");""></TD></TR></TABLE></form>"
				Dv_SignUbbCode=s
				Exit Function
			End If
			re.Pattern="<((asp|\!|%))"
			s=re.Replace(s,"&lt;$1")
			re.Pattern="(>)("&vbNewLine&")(<)"
			s=re.Replace(s,"$1$3") 
			re.Pattern="(>)("&vbNewLine&vbNewLine&")(<)"
			s=re.Replace(s,"$1$3") 
		End If
		s = Replace(s, "  ", "&nbsp;&nbsp;")
		s = Replace(s, vbNewLine, "<br>")
		s = Replace(s, CHR(10), "")
		s = Replace(s, CHR(13), "")
		
		'常规设置不支持UBB代码,则退出
		If Cint(Dvbbs.Forum_setting(65))=0 Then 
			Dv_SignUbbCode=s
			Exit Function
		End If 
		'img code
		If InStr(Lcase(s),"[/img]")>0 Then s=Dv_UbbCode_S2(s,"\[IMG\]","\[\/IMG\]","IMG","<IMG SRC=""$1"" border=0>","<IMG SRC=""skins/default/filetype/gif.gif"" border=0><a onfocus=this.blur() href=""$1"" target=_blank>$1</a>",PostUserGroup,Cint(Dvbbs.forum_setting(67)))
		'media code
		If InStr(Lcase(s),"[/sound]")>0 Then s=Dv_UbbCode_S2(s,"\[sound\]","\[\/sound\]","sound","<a href=""$1"" target=_blank><IMG SRC=skins/default/filetype/mid.gif border=0 alt=""背景音乐""></a><bgsound src=""$1"" loop=""-1"">","<a href=$1 target=_blank>$1</a>",PostUserGroup,Cint(Dvbbs.Board_Setting(9)))
		'flash code
		If InStr(Lcase(s),"[/flash]")>0 Then
			s=Dv_UbbCode_S2(s,"\[FLASH\]","\[\/FLASH\]","FLASH","<a href=""$1"" TARGET=_blank><IMG SRC=skins/default/filetype/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=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>","<IMG SRC="&Dvbbs.Forum_info(7)&"swf.gif border=0><a href=$1 target=_blank>$1</a>(注意:Flash内容可能含有恶意代码)",PostUserGroup,Cint(Dvbbs.forum_setting(71)))
			s=Dv_UbbCode_iS2(s,"\[FLASH=(.[^\[]*)\]","\[\/FLASH\]","FLASH","<a href=""$3"" TARGET=_blank><IMG SRC=skins/default/filetype/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=$1 height=$2><PARAM NAME=movie VALUE=""$3""><PARAM NAME=quality VALUE=high><embed src=""$3"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=$1 height=$2>$3</embed></OBJECT>","<a href=$3 target=_blank>$3</a>(注意:Flash内容可能含有恶意代码)",PostUserGroup,Cint(Dvbbs.forum_setting(71)),"=*([0-9]*),*([0-9]*)")
		End If
		'url code
		If InStr(Lcase(s),"[/url]")>0 Then
			s=Dv_UbbCode_S1(s,"\[URL\]","\[\/URL\]","URL","<A HREF=""$1"" TARGET=_blank>$1</A>")
			re.Pattern="(\[URL=(.[^:\/\/|\[]*)\])(.[^\[]*)(\[\/URL\])"
			s= re.Replace(s,"<A HREF=""$2"" TARGET=_blank>$3</A>")
			re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
			s= re.Replace(s,"<A HREF=""$2"" TARGET=_blank>$3</A>")
		End If
		'email code
		If InStr(Lcase(s),"[/email]")>0 Then
			s=Dv_UbbCode_S1(s,"\[EMAIL\]","\[\/EMAIL\]","EMAIL","<img align=absmiddle src=skins/default/filetype/email1.gif ><A HREF=""mailto:$1"">$1</A>")
			s=Dv_UbbCode_iS1(s,"\[EMAIL=(.[^\[]*)\]","\[\/EMAIL\]","EMAIL","<img align=absmiddle src=skins/default/filetype/email1.gif ><A HREF=""mailto:$1"">$2</A>","=(.[^\[]*)")
		End If
		If InStr(Lcase(s),"[/html]")>0 Then s=Dv_UbbCode_S1(s,"\[HTML\]","\[\/HTML\]","HTML","<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""6"" class="""&abgcolor&"""><td><b>以下内容为程序代码:</b><br>$1</td></table>")
		If InStr(Lcase(s),"[/color]")>0 Then s=Dv_UbbCode_C(s)
		If InStr(Lcase(s),"[/face]")>0 Then s=Dv_UbbCode_F(s)
		If InStr(Lcase(s),"[/align]")>0 Then s=Dv_UbbCode_Align(s)

		If InStr(Lcase(s),"[/shadow]")>0 Then s=Dv_UbbCode_iS1(s,"\[SHADOW=(.[^\[]*)\]","\[\/SHADOW\]","SHADOW","<table width=$1 ><tr><td style=""filter:shadow(color=$2, strength=$3)"">$4</td></tr></table>","=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)")
		If InStr(Lcase(s),"[/glow]")>0 Then s=Dv_UbbCode_iS1(s,"\[GLOW=(.[^\[]*)\]","\[\/GLOW\]","GLOW","<table width=$1 ><tr><td style=""filter:glow(color=$2, strength=$3)"">$4</td></tr></table>","=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)")
		If InStr(Lcase(s),"[/i]")>0 Then s=Dv_UbbCode_S1(s,"\[i\]","\[\/i\]","i","<i>$1</i>")
		If InStr(Lcase(s),"[/b]")>0 Then s=Dv_UbbCode_S1(s,"\[b\]","\[\/b\]","b","<b>$1</b>")
		If InStr(Lcase(s),"[/u]")>0 Then s=Dv_UbbCode_S1(s,"\[u\]","\[\/u\]","u","<u>$1</u>")
		If InStr(Lcase(s),"[/size]")>0 Then s=Dv_UbbCode_S(s)
		REM :签名移动(如需使用则把以下屏蔽去掉)
		'If InStr(Lcase(s),"[/fly]")>0 Then s=Dv_UbbCode_S1(s,"\[fly\]","\[\/fly\]","fly","<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>")
		'If InStr(Lcase(s),"[/move]")>0 Then s=Dv_UbbCode_S1(s,"\[move\]","\[\/move\]","move","<MARQUEE scrollamount=3>$1</marquee>")
		REM 不开放HTML支持,不转换HREF
		REM 加上签名是否开放HTML判断 2004-5-6 Dvbbs.YangZheng
		If Dvbbs.Board_Setting(5)="1" And Dvbbs.Forum_Setting(66) = "1" Then
			'自动识别网址
			If InStr(Lcase(s),"http://")>0 Then
				re.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
				s = re.Replace(s,"<a target=_blank href=$1>$1</a>")
				re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)$"
				s = re.Replace(s,"<a target=_blank href=$1>$1</a>")
				re.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
				s = re.Replace(s,"$1<a target=_blank href=$2>$2</a>")
			End If
			'自动识别www等开头的网址
			If InStr(Lcase(s),"www.")>0 Then
				re.Pattern = "([^@|^\.|^\/\/])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*)*)"
				s = re.Replace(s,"<a target=_blank href=http://$2>$2</a>")
			End If
		End If
		s=bbimg(s,260)
		Dv_SignUbbCode=s
		Set Re=Nothing
	End Function
	Private Function Dv_UbbCode_S1(strText,uCodeL,uCodeR,uCodeC,tCode)
		Dim s
		s=strText
		re.Pattern=uCodeL
		s=re.replace(s, chr(1) & uCodeC & chr(2))
		re.Pattern=uCodeR
		s=re.replace(s, chr(1) & "/" & uCodeC & chr(2))
		re.Pattern="\x01"&uCodeC&"\x02\x01\/"&uCodeC&"\x02"
		s=re.Replace(s,"")
		re.Pattern="\x01"&uCodeC&"\x02(.[^\x01]*)\x01\/"&uCodeC&"\x02"
		s=re.Replace(s,tCode)
		re.Pattern="\x02"
		s=re.replace(s, "]")
		re.Pattern="\x01"
		s=re.replace(s, "[")
		Dv_UbbCode_S1=s
	End Function
	Private Function Dv_UbbCode_iS1(strText,uCodeL,uCodeR,uCodeC,tCode,iCode)
		Dim s
		s=strText
		re.Pattern=uCodeL
		s=re.replace(s, chr(1) & uCodeC & "=$1" & chr(2))
		re.Pattern=uCodeR
		s=re.replace(s, chr(1) & "/" & uCodeC & chr(2))
		re.Pattern="\x01"&uCodeC&iCode&"\x02\x01\/"&uCodeC&"\x02"
		s=re.Replace(s,"")
		re.Pattern="\x01"&uCodeC&iCode&"\x02(.[^\x01]*)\x01\/"&uCodeC&"\x02"
		s=re.Replace(s,tCode)
		re.Pattern="\x02"
		s=re.replace(s, "]")
		re.Pattern="\x01"
		s=re.replace(s, "[")
		Dv_UbbCode_iS1=s
	End Function

	Private Function Dv_UbbCode_S2(strText,uCodeL,uCodeR,uCodeC,tCode1,tCode2,PostUserGroup,Flag)
		Dim s
	
		s=strText
		If Dvbbs.Forum_Setting(76)="" Or  Dvbbs.Forum_Setting(76)="" Then
			re.Pattern="UploadFile/"
			s=re.replace(s,Dvbbs.Forum_Setting(76))
		End If
		re.Pattern=uCodeL
		s=re.replace(s, chr(1) & uCodeC & chr(2))
		re.Pattern=uCodeR
		s=re.replace(s, chr(1) & "/" & uCodeC & chr(2))
		re.Pattern="\x01"&uCodeC&"\x02(.[^\x01]*)\x01\/"&uCodeC&"\x02"
		If Flag = 1 or PostUserGroup<4 Then
			s=re.Replace(s,tCode1)
		Else
			s=re.Replace(s,tCode2)
		End If 
		re.Pattern="\x02"
		s=re.replace(s, "]")
		re.Pattern="\x01"
		s=re.replace(s, "[")
		Dv_UbbCode_S2=s
	End Function
	Private Function Dv_UbbCode_iS2(strText,uCodeL,uCodeR,uCodeC,tCode1,tCode2,PostUserGroup,Flag,iCode)
		Dim s
		s=strText
		re.Pattern=uCodeL
		s=re.replace(s, chr(1) & uCodeC & "=$1" & chr(2))
		re.Pattern=uCodeR
		s=re.replace(s, chr(1) & "/" & uCodeC & chr(2))
		re.Pattern="\x01"&uCodeC&iCode&"\x02(.[^\x01]*)\x01\/"&uCodeC&"\x02"
		If Flag = 1 or PostUserGroup<4 Then
			s=re.Replace(s,tCode1)
		Else
			s=re.Replace(s,tCode2)
		End If 
		re.Pattern="\x02"
		s=re.replace(s, "]")
		re.Pattern="\x01"
		s=re.replace(s, "[")
		Dv_UbbCode_iS2=s
	End Function

	Private Function Dv_UbbCode_Align(strText)
		Dim s
		s=strText

⌨️ 快捷键说明

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