📄 ubb.asp
字号:
<%
function unHtml(content)
unHtml=content
if content <> "" then
unHtml=replace(unHtml,"<","<")
unHtml=replace(unHtml,">",">")
unHtml=replace(unHtml,chr(34),""")
unHtml=replace(unHtml,chr(13),"<br>")
unHtml=replace(unHtml,chr(32)," ")
end if
end function
function ubb(content)
ubb=content
nowtime=now()
UBB=ubbgo(ubb,"code")
UBB=ubbgo(ubb,"html")
UBB=ubbgo(ubb,"url")
UBB=ubbgo(ubb,"color")
UBB=ubbgo(ubb,"font")
UBB=ubbgo(ubb,"size")
UBB=ubbgo(ubb,"quote")
UBB=ubbgo(ubb,"email")
UBB=ubbgo(ubb,"img")
UBB=ubbgo(ubb,"swf")
UBB=autourl(ubb)
UBB=replace(ubb,"[b]","<b>",1,-1,1)
UBB=replace(ubb,"[/b]","</b>",1,-1,1)
UBB=replace(ubb,"[i]","<i>",1,-1,1)
UBB=replace(ubb,"[/i]","</i>",1,-1,1)
UBB=replace(ubb,"[u]","<u>",1,-1,1)
UBB=replace(ubb,"[/u]","</u>",1,-1,1)
UBB=replace(ubb,"[blue]","<font color='#000099'>",1,-1,1)
UBB=replace(ubb,"[/blue]","</font>",1,-1,1)
UBB=replace(ubb,"[red]","<font color='#990000'>",1,-1,1)
UBB=replace(ubb,"[/red]","</font>",1,-1,1)
UBB=replace(ubb,"[light]","<span style=behavior:url(img/lightfont.htc)>",1,-1,1)
UBB=replace(ubb,"[/light]","</span>",1,-1,1)
for i=1 to 28
UBB=replace(ubb,"[em"&i&"]","<IMG SRC=""img/emot/"&i&".gif""></img>",1,6,1)
UBB=replace(ubb,"[em"&i&"]","",1,-1,1)
next
UBB=replace(ubb,"["&chr(176),"[",1,-1,1)
UBB=replace(ubb,chr(176)&"]","]",1,-1,1)
UBB=replace(ubb,"/"&chr(176),"/",1,-1,1)
end function
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
function ubbgo(ubb,YCMSUBB)
ubbtext=ubb
su=1
do while YCMSUBB="url" or YCMSUBB="color" or YCMSUBB="font" or YCMSUBB="size"
su=instr(su,ubbtext,"["&YCMSUBB&"=",1)
if su=0 then exit do
eu=instr(su,ubbtext,"]",1)
if eu=0 then exit do
GOYCMSUBB=YCMSUBB
su=su+len(GOYCMSUBB)+2
text=mid(ubbtext,su,eu-su)
codetext=replace(text,"[","["&chr(176),1,-1,1)
codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)
codetext=replace(codetext,"/","/"&chr(176),1,-1,1)
select case YCMSUBB
case "color"
ubbtext=replace(ubbtext,"[color="&text&"]","<font color='"&text&"'>",1,1,1)
ubbtext=replace(ubbtext,"[/color]","</font>",1,1,1)
case "font"
ubbtext=replace(ubbtext,"[font="&text&"]","<font face='"&text&"'>",1,1,1)
ubbtext=replace(ubbtext,"[/font]","</font>",1,1,1)
case "size"
if IsNumeric(text) then
if text>6 then text=6
if text<1 then text=1
ubbtext=replace(ubbtext,"[size="&text&"]","<font size='"&text&"'>",1,1,1)
ubbtext=replace(ubbtext,"[/size]","</font>",1,1,1)
end if
case "url"
ubbtext=replace(ubbtext,"[url="&text&"]","<a href='"&codetext&"' target=_blank>",1,1,1)
ubbtext=replace(ubbtext,"[/url]","</a>",1,1,1)
case "email"
ubbtext=replace(ubbtext,"["&YCMSUBB&"="&text&"]","<a href=mailto:"&text&">",1,1,1)
ubbtext=replace(ubbtext,"[/"&YCMSUBB&"]","</a>",1,1,1)
end select
loop
su=1
do
su=instr(su,ubbtext,"["&YCMSUBB&"]",1)
if su=0 then exit do
eu=instr(su,ubbtext,"[/"&YCMSUBB&"]",1)
if eu=0 then exit do
GOYCMSUBB=YCMSUBB
su=su+len(GOYCMSUBB)+2
text=mid(ubbtext,su,eu-su)
codetext=replace(text,"[","["&chr(176),1,-1,1)
codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)
codetext=replace(codetext,"/","/"&chr(176),1,-1,1)
select case YCMSUBB
case "url"
ubbtext=replace(ubbtext,"["&YCMSUBB&"]"&text,"<a href='"&codetext&"' target=_blank>"&codetext,1,1,1)
ubbtext=replace(ubbtext,"<a href='"&codetext&"' target=_blank>"&codetext&"[/"&YCMSUBB&"]","<a href="&codetext&" target=_blank>"&codetext&"</a>",1,1,1)
case "email"
ubbtext=replace(ubbtext,"["&YCMSUBB&"]","<a href=mailto:"&text&">",1,1,1)
ubbtext=replace(ubbtext,"[/"&YCMSUBB&"]","</a>",1,1,1)
case "html"
codetext=replace(codetext,"<br>",chr(13),1,-1,1)
codetext=replace(codetext," ",chr(32),1,-1,1)
Randomize
rid="temp"&Int(100000 * Rnd)
ubbtext=replace(ubbtext,"[html]"&text,"<TEXTAREA rows=""8"" id="""&rid&""" style=""width:100%;height:100px;"" class=""text"">"&codetext,1,1,1)
ubbtext=replace(ubbtext,"<TEXTAREA rows=""8"" id="""&rid&""" style=""width:100%;height:100px;"" class=""text"">"&codetext&"[/html]","<TEXTAREA rows=""8"" id="""&rid&""" style=""width:100%;height:100px;"" class=""text"">"&codetext&"</TEXTAREA><div style=""margin:4px;""><INPUT onclick=""runcode("&rid&")"" type=""button"" value=""运 行"" class=""put"" onmouseover=""this.className='overput'"" onmouseout=""this.className='put'""> <INPUT onclick=""copycode("&rid&")"" type=""button"" value=""复 制"" class=""put"" onmouseover=""this.className='overput'"" onmouseout=""this.className='put'""> <INPUT onclick=""saveas("&rid&")"" type=""button"" value=""保 存"" class=""put"" onmouseover=""this.className='overput'"" onmouseout=""this.className='put'""> 提示:可先修改部分代码再运行</div>",1,1,1)
case "img"
ubbtext=replace(ubbtext,"[img]"&text,"<img src="&codetext,1,1,1)
ubbtext=replace(ubbtext,"[/img]"," border=0 alt=""点击图片在新窗口中打开"" onload=""if(this.width>500){this.width=500;}"" onclick=""window.open(this.src,null,'')"" onmousewheel=""return bbimg(this)"">",1,1,1)
case "code"
ubbtext=replace(ubbtext,"[code]"&text,"以下内容为程序代码<hr noshade>"&codetext,1,1,1)
ubbtext=replace(ubbtext,"以下内容为程序代码<hr noshade>"&codetext&"[/code]","以下内容为程序代码<hr noshade>"&codetext&"<hr noshade>",1,1,1)
case "quote"
atext=replace(text,"[img]","",1,-1,1)
atext=replace(atext,"[/img]","",1,-1,1)
atext=replace(atext,"[swf]","",1,-1,1)
atext=replace(atext,"[/swf]","",1,-1,1)
atext=replace(atext,"[html]","",1,-1,1)
atext=replace(atext,"[/html]","",1,-1,1)
atext=replace(atext,chr(32)," ",1,-1,1)
ubbtext=replace(ubbtext,"[quote]"&text,"<center><div style='text-align:left;padding:4px;width:98%;height:100px;border:1px solid #ccc;background:#eee;'>"&atext,1,1,1)
ubbtext=replace(ubbtext,"<center><div style='text-align:left;padding:4px;width:98%;height:100px;border-left:4px solid #999;border-top:1px solid #ccc;border-right:1px solid #ccc;border-bottom:1px solid #ccc;background:#eee;'>"&atext&"[/quote]","<center><div style='text-align:left;padding:4px;width:98%;height:100px;border-left:4px solid #999;border-top:1px solid #ccc;border-right:1px solid #ccc;border-bottom:1px solid #ccc;background:#eee;'>"&atext&"</div></center>",1,1,1)
end select
loop
ubbgo=ubbtext
end function
function autourl(ubb)
ubbtext=ubb
su=1
do
su=1
eu_a=0
eu_b=0
eu=0
su=instr(su,ubbtext,"http://",1)
if su=0 then exit do
eu_b=instr(su,ubbtext,"<",1)
eu_a=instr(su,ubbtext," ",1)
eu=eu_a
if eu=0 then
eu=eu_b
end if
if eu_b<eu and eu_b>0 then
eu=eu_b
end if
if eu=0 then
lenc=ubbtext
eu=len(lenc)+1
end if
if su>eu then exit do
text=mid(ubbtext,su,eu-su)
codetext=text
urllink="<a href='"&codetext&"' target=_blank>"&codetext&"</a> "
urllink=replace(urllink,"/","/"&chr(176),1,-1,1)
ubbtext=replace(ubbtext,text,urllink,1,1,1)
loop
autourl=ubbtext
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -