📄 char.asp
字号:
<Script Language="JScript" Runat=Server>
$UBBCode = 0 // 打开或关闭UBB代码功能.1(关闭).0(打开)
$html = 0 // 打开或关闭HTML代码功能.1(打开).0(关闭)
//$Smilies = 0 // 同样的是为了打开或关闭表情功能.1(关闭).0(打开)
function Autolink(temp) {
temp=patch(temp);
// temp=Smilies(temp);
if (!$UBBCode){ // UBB 代码的支持,这里仅仅提供了一些常用的代码。
temp = temp.replace(/(^|\s)(http|https|ftp)(:\/\/[^\";,<>]+)/ig, "<a href=\"$2$3\" target=_blank>$2$3</a>");
temp = temp.replace(/([^\//]])(www\.[^\";,<>]+)/ig, "<a href=\"http:\/\/$2\" target=_blank>$2</a>");
temp = temp.replace(/(^|\s)(www\.[^\";,<>&]+)/ig, "<a href=\"http:\/\/$2\" target=_blank>$2</a>");
temp = temp.replace(/(\[URL\])(http|https|ftp)(:\/\/\S+)(\[\/URL\])/ig, "<A HREF=\"$2$3\" TARGET=_blank>$2$3</A>");
temp = temp.replace(/(\[URL\])(\S+)(\[\/URL\])/ig, " <A HREF=\"http:\/\/$2\" TARGET=_blank>$2</A>");
temp = temp.replace(/(\[URL=)(http|https|ftp)(:\/\/\S+)(\])(.+)(\[\/URL\])/ig, "<A HREF=\"$2$3\" TARGET=_blank>$5</A>");
temp = temp.replace(/(\[email=)(\S+)(\])(.+)(\[\/email\])/ig, "<A HREF=\"http:\/\/$2\" TARGET=_blank>$4</A>");
temp = temp.replace(/(\[URL=)(\S+)(\])(.+)(\[\/URL\])/ig, "<a href=\"http:\/\/$2\" TARGET=_blank>$4</A>");
temp = temp.replace(/(\[img\])(\S+)(\[\/img\])/ig, "<img src=\"$2\" alt=\"$2\">");
temp = temp.replace(/(\[code\])(.+)(\[\/code\])/ig, "<BR><BLOCKQUOTE><strong>Code</strong>:<HR Size=1>$2<HR SIZE=1><\/BLOCKQUOTE>");
temp = temp.replace(/(\[QUOTE\])(.+)(\[\/QUOTE\])/ig, "<BR><BLOCKQUOTE><strong>引用</strong>:<HR Size=1>$2<HR SIZE=1><\/BLOCKQUOTE>");
temp = temp.replace(/(\[color=)(\S+)(\])(.+)(\[\/color\])/ig, "<font color=\"$2\">$4<\/font>");
temp = temp.replace(/(\[span=)(\S+),(\S+)(\])(.+)(\[\/span\])/ig, "<span style=\"background\-color:$2\;color:$3\">$5<\/span>");
temp = temp.replace(/(\[glow=)(\S+)(,\S+)(,\S+)(\])(.+)(\[\/glow\])/ig, "<table width=$2 style=\"filter:glow\(color=$3\,strength=$4\)\">$6<\/table>");
temp = temp.replace(/(\[list\])(.+)(\[\/list\])/ig, "<UL TYPE=SQUARE>$2<\/UL>");
temp = temp.replace(/(\[list=A\])(.+)(\[\/list\])/ig, "<ol type=A>$2<\/ol>");
temp = temp.replace(/(\[list=1\])(.+)(\[\/list\])/ig, "<ol type=1>$2<\/ol>");
temp = temp.replace(/(\[center\])(.+)(\[\/center\])/ig, "<CENTER>$2<\/CENTER>");
temp = temp.replace(/(\[fly\])(.+)(\[\/fly\])/ig, "<marquee behavior=alternate>$2<\/marquee>");
temp = temp.replace(/(\[move\])(.+)(\[\/move\])/ig, "<marquee>$2<\/marquee>");
temp = temp.replace(/(\[i\])(.+)(\[\/i\])/ig, "<I>$2<\/I>");
temp = temp.replace(/(\[b\])(.+)(\[\/b\])/ig, "<B>$2<\/B>");
temp = temp.replace(/(\[u\])(.+)(\[\/u\])/ig, "<U>$2<\/U>");
temp = temp.replace(/(\[\*\])/ig, "<LI>");
}
return (temp);
}
function patch(temp) {
if (!$html){
temp = temp.replace(/</ig, "<");
temp = temp.replace(/>/ig, ">");
temp = temp.replace(/\r\n/ig, "<br>");
}
temp = temp.replace(/\n\r\n/ig, "<P>");
temp = temp.replace(/\n/ig, "<BR>");
temp = temp.replace(/\r/ig, "");
return (temp);
}
</Script>
<%
function htmlencode(str)
dim result
dim l
if isNULL(str) then
htmlencode=""
exit function
end if
l=len(str)
result=""
dim i
for i = 1 to l
select case mid(str,i,1)
case "<"
result=result+"<"
case ">"
result=result+">"
case chr(13)
result=result+""
case chr(34)
result=result+"""
case "&"
result=result+"&"
case chr(32)
'result=result+" "
if i+1<=l and i-1>0 then
if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9) then
result=result+" "
else
result=result+" "
end if
else
result=result+" "
end if
case chr(9)
result=result+" "
case else
result=result+mid(str,i,1)
end select
next
htmlencode=result
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -