📄 code.asp
字号:
<%
Function ChkBadWords(fString)
bwords = split(BadWords, "|")
For i = 0 to ubound(bwords)
fString = Replace(fString, bwords(i), string(len(bwords(i)),"*"), 1,-1,1)
Next
ChkBadWords = fString
End Function
Function doCode(fString, fOTag, fCTag, fROTag, fRCTag)
fOTagPos = Instr(1, fString, fOTag, 1)
fCTagPos = Instr(1, fString, fCTag, 1)
While (fCTagPos > 0 and fOTagPos > 0)
fString = replace(fString, fOTag, fROTag, 1, 1, 1)
fString = replace(fString, fCTag, fRCTag, 1, 1, 1)
fOTagPos = Instr(1, fString, fOTag, 1)
fCTagPos = Instr(1, fString, fCTag, 1)
Wend
doCode = fString
End Function
Function UBBCode(strContent)
strContent = Replace(strContent, vbcrlf, "[BR]")
dim re
set re = New RegExp
re.Global = True
re.IgnoreCase = True
' re.MultiLine = True
re.Pattern = "\[(\/|)(td|tr|th|tbody|table)]\[BR]"
strContent = re.Replace(strContent,"<$1$2>")
re.Pattern = "\[(\/|)(td|tr|th|tbody|table) (.[^]]*)]\[BR]"
strContent = re.Replace(strContent,"<$1$2 $3>")
re.Pattern = "\[(\/|)(td|tr|th|tbody|table)]"
strContent = re.Replace(strContent,"<$1$2>")
re.Pattern = "\[(\/|)(td|tr|th|tbody|table) (.[^]]*)]"
strContent = re.Replace(strContent,"<$1$2 $3>")
re.Pattern = "\[br]"
strContent = re.Replace(strContent,"<br>")
re.Pattern = "\[(center|right|left)](.[^\[]*)\[\/(center|right|left)]"
strContent = re.Replace(strContent,"<div align=$1>$2</div>")
re.Pattern = "\[div(.[^\]]*|)](.[^\[]*)\[\/div]"
strContent = re.Replace(strContent,"<div$1>$2</div>")
re.Pattern = "\[p(.[^\]]*|)](.[^\[]*)\[\/p]"
strContent = re.Replace(strContent,"<br>$2")
re.Pattern = "\[url=(.[^\]]*)\](.[^\[]*)\[\/url]"
strContent = re.Replace(strContent,"<a target=_blank href=$1>$2</a>")
re.Pattern = "\[url](.[^\[]*)\[\/url]"
strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
re.Pattern = "\[email=(.[^\]]*)\](.[^\[]*)\[\/email]"
strContent = re.Replace(strContent,"<a href=$1>$2</a>")
re.Pattern = "\[email](.[^\[]*)\[\/email]"
strContent = re.Replace(strContent,"<a href=mailto:$1>$1</a>")
re.Pattern = "\[img](.[^\[]*)\[\/img]"
strContent = re.Replace(strContent,"<img src=$1 border=0>")
re.Pattern = "\[img(.[^\]]*)src=(.[^\]]*)\]"
strContent = re.Replace(strContent,"<img src=$2 $1 border=0>")
re.Pattern = "\[FLASH](.[^\[]*)\[\/FLASH]"
strContent = re.Replace(strContent,"<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>")
re.Pattern ="\[HTML](.[^\[]*)\[\/HTML]"
strContent =re.Replace(strContent,"<SPAN><IMG src=pic/code.gif align=absBottom> HTML 代码片段如下:<BR><TEXTAREA style=""WIDTH: 94%; BACKGROUND-COLOR: #f7f7f7"" name=textfield rows=10>$1</TEXTAREA><BR><INPUT onclick=runEx() type=button value=运行此代码 name=Button> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]</SPAN><BR>")
re.Pattern ="\[ALIGN=(.[^\]]*)\](.[^\[]*)\[\/ALIGN]"
strContent =re.Replace(strContent,"<div align=$1>$2</div>")
re.Pattern ="\[QUOTE](.[^\[]*)\[\/QUOTE]"
strContent =re.Replace(strContent,"<BLOCKQUOTE><b>引用</b>:<HR>$1<HR></BLOCKQUOTE>")
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=(.[^\]]*),(.[^\]]*),(.[^\]]*)\](.[^\[]*)\[\/GLOW]"
strContent =re.Replace(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
re.Pattern ="\[SHADOW=(.[^\]]*),(.[^\]]*),(.[^\]]*)\](.[^\[]*)\[\/SHADOW]"
strContent =re.Replace(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")
re.Pattern = "\[(\/|)(b|u)]"
strContent = re.Replace(strContent,"<$1$2>")
re.Pattern = "\[I](.[^\[]*)\[\/I]"
strContent = re.Replace(strContent,"<I>$1</I>")
re.Pattern ="\[(color|face|size)=(.[^\]]*)]"
strContent =re.Replace(strContent,"<font $1=$2>")
re.Pattern ="\[\/font]"
strContent = re.Replace(strContent,"</font>")
strContent = doCode(strContent, "[list]", "[/list]", "<ul>", "</ul>")
strContent = doCode(strContent, "[list=1]", "[/list]", "<ol type=1>", "</ol id=1>")
strContent = doCode(strContent, "[list=a]", "[/list]", "<ol type=a>", "</ol id=a>")
strContent = doCode(strContent, "[*]", "[/*]", "<li>", "</li>")
strContent = doCode(strContent, "[code]", "[/code]", "<pre id=code><font size=1 face=""Verdana, Arial"" id=code>", "</font id=code></pre id=code>")
re.Pattern = "\[\*]"
strContent = re.Replace(strContent,"<li>")
strContent=ChkBadWords(strContent)
UBBCode = strContent
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -