%Response.Buffer=true response.expires=0 myid=Session("myid") myname=Session("myname") call get_guests set rsparam=conn.execute("select * from param") if myid="" or myname="" then call echoerr("你还没有进入聊天室!","default.asp") response.end elseif myname<>guests(myid,0) or Session("mytemp")<>guests(myid,1) then call echoerr("你还没有进入聊天室!","default.asp") response.end elseif guests(myid,4)-rsparam("lmodact")<0 then call echoerr("你无权修改酷库!","allact.asp") response.end end if old_name=request("name") sql="select * from action where act_name='"&old_name&"'" set rs=conn.Execute(sql) if rs.eof or rs.bof then call echoerr("酷库里没有["&old_name&"]这个动作,怎么修改?","allact.asp") response.end end if if request("cmdYes")="确认" then act_name=replace(left(trdb(request("act_name")),10),"/","") alias=left(trdb(request("alias")),10) toall=replace(replace(request("toall"),chr(34),"""),"'","'") toself=replace(replace(request("toself"),chr(34),"""),"'","'") toother=replace(replace(request("toother"),chr(34),"""),"'","'") if len(toall)>100 or len(toself)>100 or len(toother)>100 then errtext="错误:动作内容太长,超过了100个字符!" elseif act_name="" or alias="" or toall="" then errtext="错误:动作名称、动作描述、对象是大家时的动作内容都不能为空!" else if toself="" then toself=toall if toother="" then toother=toall if mid(toall,1,2)="//" then toall="##"&mid(toall,3,len(toall)) if mid(toself,1,2)="//" then toself="##"&mid(toself,3,len(toself)) if mid(toother,1,2)="//" then toother="##"&mid(toother,3,len(toother)) if instr(toall,"##")=0 or instr(toself,"##")=0 or instr(toother,"##")=0 then errText="错误:动作里必须要有“##”来指明动作使用者!" else sql="update action set act_name='"&act_name&"',alias='"&alias&"',toall='"&toall&"',toself='"&toself&"',toother='"&toother&"' where act_name='"&old_name&"'" conn.Execute(sql) errText="操作成功:你成功地修改了动作!" end if end if call echoerr(errText,"allact.asp") else%>
| 添加新动作 |