📄 mark.asp
字号:
re.Pattern="(\[RAR\])(.[^\[]*)(\[\/RAR\])"
strContent=re.Replace(strContent,"<br><IMG SRC=pic/rar.gif border=0> <a href=""$2"">点击下载该文件</a>")
re.Pattern="(\[TXT\])(.[^\[]*)(\[\/TXT\])"
strContent=re.Replace(strContent,"<br><IMG SRC=pic/txt.gif border=0> <a href=""$2"">点击下载该文件></a>")
re.Pattern="(\[EXE\])(.[^\[]*)(\[\/EXE\])"
strContent=re.Replace(strContent,"<br><IMG SRC=pic/exe.gif border=0> <a href=""$2"">点击下载该文件</a>")
re.Pattern="(\[UPLOAD=GIF\])(.[^\[]*)(\[\/UPLOAD\])"
strContent=re.Replace(strContent,"<br><IMG SRC=""pic/gif.gif"" border=0>相关图片如下<br><a href=""$2"" target=_blank><IMG SRC=""$2"" border=0 alt=点击图片浏览完整大小的图片 onload=""javascript:if(this.width>screen.width-450)this.width=screen.width-450""></a>")
re.Pattern="(\[UPLOAD=JPG\])(.[^\[]*)(\[\/UPLOAD\])"
strContent=re.Replace(strContent,"<br><IMG SRC=""pic/jpg.gif"" border=0>相关图片如下<br><a href=""$2"" target=_blank><IMG SRC=""$2"" border=0 alt=点击图片看完整大小的图片 onload=""javascript:if(this.width>screen.width-450)this.width=screen.width-450""></a>")
re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=pic/url.gif border=0><A HREF=""$2"" TARGET=_blank>$2</A>")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=pic/url.gif border=0><A HREF=""$2"" TARGET=_blank>$3</A>")
re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=pic/email1.gif><A HREF=""mailto:$2"">$2</A>")
re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=pic/email1.gif><A HREF=""mailto:$2"" TARGET=_blank>$3</A>")
'自动识别IFRAME框架,如果打开可能引起循环
're.Pattern="(\[IFRAME\])(.[^\]]*)(\[\/IFRAME\])"
'strContent=re.Replace(strContent,"<IFRAME src=""$2"" width=95% height=400></iframe><br><a href=""$2"" target=_blank>点击这里查看</a>")
'自动识别网址
re.Pattern = "(^|[^==""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
strContent = re.Replace(strContent,"$1<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=$2>$2</a>")
re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)$"
strContent = re.Replace(strContent,"<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=$1>$1</a>")
re.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
strContent = re.Replace(strContent,"$1<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=$2>$2</a>")
'自动识别www等开头的网址
re.Pattern = "([^(http://|http:\\)|^<>\@|^<>\.|^<>0-9|^<>a-z|^<>A-Z])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*[^<>""]+)*)"
strContent = re.Replace(strContent,"$1<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=http://$2>$2</a>")
'自动识别Email地址,如打开本功能在浏览内容很多的帖子会引起服务器停顿
're.Pattern = "([^(=)])((\w)+[@]{1}((\w)+[.]){1,3}(\w)+)"
'strContent = re.Replace(strContent,"<img align=absmiddle src=pic/email1.gif border=0><a target=_blank href=""mailto:$2"">$2</a>")
if strIcons = "1" then
re.Pattern="(\[em(.[^\]]*)\])"
strContent=re.Replace(strContent,"<img src=pic/em$2.gif border=0 align=middle>")
end if
re.Pattern="(\[QUOTE\])(.*)(\[\/QUOTE\])"
strContent=re.Replace(strContent,"<table width='95%' border='0' cellspacing='1' cellpadding='2' bgcolor='"&Tablebackcolor&"' align='center'><tr><td bgcolor='"&ContentTitle&"'><i>以下内容为引用:</i><br>$2</td></tr></table>")
re.Pattern="(\[fly\])(.*)(\[\/fly\])"
strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>")
re.Pattern="(\[move\])(.*)(\[\/move\])"
strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$2</marquee>")
re.Pattern="\[glow=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\]]*)\[\/glow\]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\]]*)\[\/SHADOW]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")
re.Pattern="\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]"
strContent=re.Replace(strContent,"<font color=$1>$2</font>")
re.Pattern="\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]"
strContent=re.Replace(strContent,"<font face=$1>$2</font>")
re.Pattern="\[align=(.[^\[]*)\](.*)\[\/align\]"
strContent=re.Replace(strContent,"<div align=$1>$2</div>")
re.Pattern="\[i\](.[^\[]*)\[\/i\]"
strContent=re.Replace(strContent,"<i>$1</i>")
re.Pattern="\[u\](.[^\[]*)(\[\/u\])"
strContent=re.Replace(strContent,"<u>$1</u>")
re.Pattern="\[b\](.[^\[]*)(\[\/b\])"
strContent=re.Replace(strContent,"<b>$1</b>")
re.Pattern="\[size=([1-4])\](.[^\[]*)\[\/size\]"
strContent=re.Replace(strContent,"<font size=$1>$2</font>")
strContent=ChkBadWords(strContent)
set re=Nothing
UBBCode=strContent
end function
public function translate(sourceStr,fieldStr)
rem 处理逻辑表达式的转化问题
dim sourceList
dim resultStr
dim i,j
if instr(sourceStr," ")>0 then
dim isOperator
isOperator = true
sourceList=split(sourceStr)
'--------------------------------------------------------
rem Response.Write "num:" & cstr(ubound(sourceList)) & "<br>"
for i = 0 to ubound(sourceList)
rem Response.Write i
Select Case ucase(sourceList(i))
Case "AND","&","和","与"
resultStr=resultStr & " and "
isOperator = true
Case "OR","|","或"
resultStr=resultStr & " or "
isOperator = true
Case "NOT","!","非","!","!"
resultStr=resultStr & " not "
isOperator = true
Case "(","(","("
resultStr=resultStr & " ( "
isOperator = true
Case ")",")",")"
resultStr=resultStr & " ) "
isOperator = true
Case Else
if sourceList(i)<>"" then
if not isOperator then resultStr=resultStr & " and "
if inStr(sourceList(i),"%") > 0 then
resultStr=resultStr&" "&fieldStr& " like '" & replace(sourceList(i),"'","''") & "' "
else
resultStr=resultStr&" "&fieldStr& " like '%" & replace(sourceList(i),"'","''") & "%' "
end if
isOperator=false
End if
End Select
rem Response.write resultStr+"<br>"
next
translate=resultStr
else '单条件
if inStr(sourcestr,"%") > 0 then
translate=" " & fieldStr & " like '" & replace(sourceStr,"'","''") &"' "
else
translate=" " & fieldStr & " like '%" & replace(sourceStr,"'","''") &"%' "
End if
rem 前后各加一个空格,免得连sql时忘了加,而出错。
end if
end function
function IsValidEmail(email)
dim names, name, i, c
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
'用户来源
function address(sip)
if isnumeric(left(sip,2)) then
set iprs=server.createobject("adodb.recordset")
if sip="127.0.0.1" then sip="192.168.0.1"
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
else
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
ipsql="select Top 1 country,city from address where ip1 <="&num&" and ip2 >="&num&""
iprs.open ipsql,conn,1,1
if iprs.eof and iprs.bof then
country="亚洲"
city=""
else
country=iprs("country")
city=iprs("city")
end if
iprs.close
set iprs=nothing
end if
address=country&city
else
address="未知"
end if
end function
'用户IP限制
function LockIP(sip)
LockIP=false
if isnumeric(left(sip,2)) then
'if sip="127.0.0.1" then sip="192.168.0.1"
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
else
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
ipsql="select count(*) from LockIP where ip1 <="&num&" and ip2 >="&num&""
set iprs=server.createobject("adodb.recordset")
iprs.open ipsql,conn,1,1
if iprs(0)>0 then
LockIP=true
end if
iprs.close
set iprs=nothing
end if
end if
end function
function ChkPost()
chkpost=false
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
chkpost=false
else
chkpost=true
end if
end function
scriptname=request.ServerVariables("PATH_INFO")
if instr(scriptname,"admin")=0 and instr(scriptname,"stat")=0 then
if LockIP(Request.ServerVariables("REMOTE_ADDR")) then
response.write "<table align=center height=20% style=font-size:12px><tr><td>您的IP已经被限制不能访问本论坛,请和管理员联系"&SystemEmail&"。</td></tr></table>"
response.end
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -