<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock

set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))

application.unlock
if my_level-application( ConstStr & "_l_modact")<0 then
  response.redirect("showerr.asp?errtext=你没有权利执行此项操作！")  
  response.end
end if

Set Conn=Server.CreateObject("ADODB.Connection") 
conn.open Application( ConstStr & "_connstr")

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
  set cschat=nothing
  response.redirect("showerr.asp?errtext=你要修改的动作不存在！")
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
  response.end
end if

if request("cmdYes")="确认" then
  cschat.FilterStr = Application(ConstStr & "_saysfilterstr")
  act_name=replace(left(cschat.trdb(request("act_name")),10),"/","")
  alias=left(cschat.trdb(request("alias")),10)
  toall=replace(replace(request("toall"),chr(34),"&quot;"),"'","&#39;")
  toself=replace(replace(request("toself"),chr(34),"&quot;"),"'","&#39;")
  toother=replace(replace(request("toother"),chr(34),"&quot;"),"'","&#39;")
  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
  response.redirect("showerr.asp?errtext="&errText)
else%> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="chat.css">
<style>u{color:red}</style>
<body style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;" leftmargin=3 topmargin=20 >   
  <table width=400 align=center cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
  <tr><td class=navy1>添加新动作</td></tr>
 <form name="frmNewadd" action="actmod.asp" method="post">
 <input name="name" type=hidden value="<%=old_name%>">
  <tr><td height=50><u>英文</u>名称:<input type="text" name="act_name" maxlength="10" size="10" value="<%=rs("act_name")%>"><font color=990000>[<u>必填</u>]</font>
  <u>中文</u>描述:<input type="text" name="alias" maxlength="5" size="5" value="<%=rs("alias")%>"><font color=990000>[<u>必填</u>]</font>
  <tr><td height=230>对象为<u>大家</u>时内容:<font color=990000>[<u>必填</u>，最多100个汉字]</font><BR>
  <textarea rows="3" name="toall" cols="50"><%=rs("toall")%></textarea><br>
   对象为<u>自己</u>时内容:<font color=990000>[不填与对象为大家时相同]</font>
  <textarea rows="3" name="toself" cols="50"><%=rs("toself")%></textarea><br>
   对象为<u>别人</u>时内容:<font color=990000>[不填与对象为大家时相同]</font>
  <textarea rows="3" name="toother" cols="50"><%=rs("toother")%></textarea>                        
  <tr><td height=40><input class=navy1 type="submit" name="cmdYes" value="确认" >
    <input class=navy1 type="reset" name="cmdClear" value="清除" onclick="javascript:document.frmNewadd.act_name.focus();return true">
  <tr><td><ol>
    <li>动作中<font color=990000>##</font>代表自己，<font color=990000>%%</font>代表说话对象。大多数动作在对象是大家时、是自己时、是别人时，有不同的内容。</li>
    <li><u>单引号</u>和<u>双引号</u>会被替换，请不要使用。</li>
    <li>由于你是超级用户，对你的输入<u>不做html检查</u>，好自为之啊！</li>
  </td></tr></form></table><tr<td><br><center>[<a href='javascript:history.go(-1)'>后退</a>]</table></body></html>
<%end if
set cschat=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing%>






















