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

📄 actadd.asp

📁 此程序为网上下载
💻 ASP
字号:
<%@ LANGUAGE=VBScript.Encode codepage ="936" %>
<%Response.Buffer = True
Response.Expires = 0
Response.CacheControl = "Private"
'下面的 sjjg = XX 为时间间隔,单位为秒,默认设置为30秒才允许添加一条动作
sjjg = 30
Sub Msg (v)
 Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
 Response.Write "<script Language=JavaScript>alert('" & v & "');history.go(-1);</script></body></html>"
 Response.End
End Sub
nickname=Session("hxf_u_nickname")
grade=Int(Session("hxf_u_grade"))
userip=Request.ServerVariables("REMOTE_ADDR")
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj=n & "-" & y & "-" & r & " " & s & ":" & f & ":" & m
if nickname="" then Msg "您尚未登陆或断开连接,请重新登陆"
'if grade<3 then Msg "只有3级以上才可以添加动作,您只有" & grade & "级"
actname=Trim(Request.Form("actname"))
actname=Replace(actname,chr(13)&chr(10),"")
range=Trim(Request.Form("range"))
if range<>"1" and range<>"0" then range="0"
actnl=Trim(Request.Form("act"))
actnl=Replace(actnl,chr(13)&chr(10),"")
actnl=Replace(actnl,"<","&lt;")
actnl=Replace(actnl,">","&gt;")
actnl=Replace(actnl,"&","&amp;")
addacttime = Session("chg_hxf_addacttime")
If IsDate(addacttime) Then
 If DateDiff("s", addacttime, sj) <= sjjg Then Msg "两次添加动作必须间隔 [" & sjjg & "] 秒以上。"
End If
if range<>0 and range<>1 then range=""
if actname="" or actnl="" or range="" or len(actnl)<=2 then Msg "各个项目均不能放空白,请填写完整!"
if left(actnl,2)<>"//" then Msg "动作内容必须是以“//”开头的语句"
if left(actnl,4)="//##" then Msg "动作内容不能出现“//##”,这将导致发言后姓名出现重复.\n\n请将 ## 去掉"
if len(actnl)>100 or len(actname)>4 then Msg "动作名称或动作内容超过限制的长度!"
if InStr(actnl,"%%")<>0 and range="0" then Msg "动作内容含有“%%”,动作类型应改为“1 对别人”!"
if InStr(actnl,"%%")=0 and range="1" then Msg "动作类型为“1 对别人”,动作内容中却没有出现“%%”"
if InStr(actnl,"|")<>0 or InStr(actnl,"\")<>0 or InStr(actnl,chr(34))<>0 then Msg "添加的动作内容中,不能包含半角的“\”、“|”、“‘’”"
If Application("wsaxhxf_c_senablesaysfilter") = 1 Then
 actnameok = Replace(actname, " ", "")
 actnameok = Replace(actnameok, " ", "")
 rangeok = Replace(range, " ", "")
 rangeok = Replace(range, " ", "")
 saysfilterstr = Application("wsaxhxf_c_saysfilterstr")
 sfstr = Split(saysfilterstr, ",")
 ubstr = UBound(sfstr)
 For i = 0 To ubstr
  If InStr(rangeok, sfstr(i)) <> 0 Or InStr(actnameok, sfstr(i)) <> 0 Then
   Msg "添加的动作带有被禁止的字眼。"
  End If
 Next
End If
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("wsaxhg_connstr")
conn.open connstr
sql="SELECT acttype FROM actlib WHERE act LIKE '%" & actnl & "%'"
rs.open sql,conn,1,1
if Not(rs.Eof and rs.Bof) then
 rs.close
 conn.close
 set rs=nothing
 set conn=nothing
 Msg "该内容已经存在,不必重复添加!"
end if
rs.close
set rs=nothing
Function SqlStr(data)
 SqlStr="'" & Replace(data,"'","''") & "'"
End Function
sql="INSERT INTO actlib (acttype,name,act) VALUES ("
sql=sql & SqlStr(range) & ","
sql=sql & SqlStr(actname) & ","
sql=sql & SqlStr(actnl) & ")"
conn.Execute(sql)
sql = "INSERT INTO logs (type, logtime, name, ip, opertion) VALUES ('4', '" & sj & "', '" & nickname & "', '" & userip & "', '添加新的动作 <font color=green>类型</font>:[<font color=blue>" & range & "</font>] <font color=green>名称:</font>  " & actname & "。<font color=green>内容:</font> " & actnl & "')"
conn.Execute sql
conn.close
set conn=nothing
Session("chg_hxf_addacttime") = sj
Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
Response.Write "<script Language=JavaScript>alert('操作完成,谢谢您的参与!');window.close();</script></body></html>"
Response.End
%>

⌨️ 快捷键说明

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