<!--#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"))

if my_level=0 then
  response.redirect("showerr.asp")
  set cschat=nothing
  application.unlock
  response.end
end if

myname=cschat.myname
cschat.FilterStr=""

room_name=cschat.trdb(request("room"))
room_id=request("room_id")

if room_id="" then
  all_room_array=split(Application(ConstStr & "_room_list"),"$><$")
  for i=0 to UBound(all_room_array) step 2
    all_room_array2=split(all_room_array(i),"$>")
    if room_name=all_room_array2(1) then
      room_id=replace(all_room_array2(0),"<$","")
      exit for
    end if
  next
end if

if room_id="" or instr(Application(ConstStr & "_room_list"),"<$"&room_id&"$>")=0 then
  set cschat=nothing
  response.redirect("showerr.asp?errtext=<img src=data/room2.gif border=1 bordercolor=#336699><br><br>曾经盛极一时的『"&room_name&"』早已倒塌了！")
  application.unlock
  response.end
end if

room_array=split(Application(ConstStr & "_room_list"),"<$"&room_id&"$>")
room_array2=split(room_array(1),"$>")

room_life=application(ConstStr & "_roomtimeout")-application(ConstStr & "_roomexpperday")*DATEDIFF("d",room_array2(11),now())+room_array2(10)
if room_array2(6)="1" then room_life="永久"

if myname=room_array2(1) or my_level-application(ConstStr & "_l_delroom")>=0 then
  owner=true
  onlyread=""
else
  owner=false
  onlyread="readonly"
end if

if request("B1")="提交" then
  Set Conn=Server.CreateObject("ADODB.Connection")
  conn.open Application(ConstStr & "_connstr")
  mess=""
  guests_mess=""
  cschat.FilterStr = Application(ConstStr & "_saysfilterstr")
  if owner then
    new_room_top=left(cschat.trdb(request("room_top")),50)
    new_room_des=left(cschat.trdb(request("room_des")),250)
    new_room_auto=left(cschat.trdb(request("room_auto")),10)
    new_room_guests=cschat.trdb(request("room_guests"))
    if new_room_auto="" or new_room_des="" then
      response.redirect "showerr.asp?errtext=机器人和房间描述不能为空！"
      set cschat=nothing
      application.unlock
      response.end
    end if
    new_room_tt=request("ttyes")
    if new_room_tt<>"0" then new_room_tt=1
    new_room_html=request("room_html")
    if new_room_html<>"0" then new_room_html=1
    new_door_open=request("door_open")
    if new_door_open<>"0" then new_door_open="1"
    new_permit_level=request("permit_level")
    if not Isnumeric(new_permit_level) then new_permit_level=1
    if instr(Application(ConstStr & "_room_list"),"<$"&room_id&"$>")=1 then
     new_permit_level=1
     new_door_open=1
    end if

    conn.execute("update room set door_open="&new_door_open&",permit_level="&new_permit_level&",room_auto='"&new_room_auto&"',room_des='"&new_room_des&"',room_top='"&new_room_top&"',room_tt="&new_room_tt&",room_html="&new_room_html&",room_time='"&now()&"' where ID="&room_ID)

    if new_room_top<>room_array2(4) then mess=mess&"parent.chttitle(\'"&new_room_top&"\');"
    if room_array2(2)<>new_room_auto then mess=mess&"parent.roomauto=\'"&new_room_auto&"\';"
    if room_array2(8)-new_room_tt<>0 then mess=mess&"parent.roomtt="&new_room_tt&";"
    if room_array2(9)-new_room_html<>0 then mess=mess&"parent.roomhtml="&new_room_html&";"
    if new_room_guests<>room_array2(13) then
      mess=mess&"parent.roomguests=\'"&new_room_guests&"\';"
      if new_room_guests="" then
        guests_mess="【系统】##将本聊天室从嘉宾聊天室修改为普通聊天室！"
      else
        guests_mess="【系统】##将本聊天室修改为嘉宾聊天室！嘉宾名单："&new_room_guests&"!"
      end if
    end if

    room_array2(2)=new_room_auto
    room_array2(3)=new_room_des
    room_array2(4)=new_room_top
    room_array2(7)=now()
    room_array2(8)=new_room_tt
    room_array2(9)=new_room_html
    room_array2(13)=new_room_guests
    room_array2(14)=new_permit_level
    room_array2(15)=new_door_open
  end if
  if my_level-application(ConstStr & "_l_delroom")>=0 then
    new_room_name=left(cschat.trdb(request("new_name")),10)
    new_room_owner=left(cschat.trdb(request("room_owner")),10)
    new_room_keep=request("room_keep")
    if new_room_keep<>"1" then new_room_keep=0
    if instr(Application(ConstStr & "_room_list"),"<$"&room_id&"$>")=1 then new_room_keep=1
    conn.execute("update room set room_name='"&new_room_name&"',room_owner='"&new_room_owner&"',room_keep="&new_room_keep&" where ID="&room_ID)
    if room_array2(0)<>new_room_name then mess=mess&"parent.roomname=\'"&new_room_name&"\';"
    room_array2(0)=new_room_name
    room_array2(1)=new_room_owner
    room_array2(6)=new_room_keep
  end if
  if mess<>"" then
    if guests_mess="" then
      semotion=-5
    else
      semotion=-2
    end if
    says = Application(ConstStr & "_says")
    current = Application(ConstStr & "_current")
    cschat.newsay myname,"大家",0,room_id,guests_mess&"<\script>"&mess&"</\script>","996633","990099",semotion,says,current
    Application(ConstStr & "_says") = says
    Application(ConstStr & "_current") = current
    
  end if
  room_array(1)=join(room_array2,"$>")
  Application(ConstStr & "_room_list")=join(room_array,"<$"&room_id&"$>")
  title_str="<tr><td class=navy1>〖"&room_array2(0)&"〗修改后的信息</td></tr>"
  conn.close
  set conn=nothing
else
  title_str="<tr><td class=navy1>〖"&room_array2(0)&"〗当前信息</td></tr>"
end if
set cschat=nothing
application.unlock%>
 <META content="text/html; charset=gb2312" http-equiv=content-type><meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<link rel="stylesheet" type="text/css" href="chat.css">
<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 style="color:000000">
  <table width=450 align=center cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
  <%=title_str%>
 <%if owner then%>
    <form method="POST" action="roomset.asp">
    <input type=hidden name=room value='<%=room_array2(0)%>'>
    <input type=hidden name=room_id value='<%=room_id%>'>
 <%end if%>
    <tr><td><table align="center" height="100%" width="100%" border=0 cellspacing=0 cellpadding=5>
    <tr><td>房&nbsp;间&nbsp;名:<input type=text name=new_name maxlength=10 size=10 value=<%=room_array2(0)%>><td>房间主人:<input
    type=text name=room_owner maxlength=10 size=10 value=<%=room_array2(1)%>>
    <tr><td>永久保留:&nbsp;否<input type=radio name=room_keep value="0" <%if room_array2(6)<>"1" then%>checked<%end if%>>&nbsp;是<input
        type="radio" name=ROOM_KEEP value="1" <%if room_array2(6)="1" then%>checked<%end if%>><td>允许字效:&nbsp;否<input <%=onlyread%> type=radio name=room_html value="0" <%if room_array2(9)<>"1" then%>checked<%end if%>>&nbsp;是<input
        <%=onlyread%> type="radio" name=room_html value="1" <%if room_array2(9)="1" then%>checked<%end if%>>
    <tr><td>允许贴图:&nbsp;否<input <%=onlyread%> type=radio name=ttyes value="0" <%if room_array2(8)="0" then%>checked<%end if%>>&nbsp;是<input
       <%=onlyread%> type="radio" name=ttyes value="true" <%if room_array2(8)<>"0" then%>checked<%end if%>><td>机&nbsp;器&nbsp;人:<input <%=onlyread%> type=text name=room_auto maxlength=10 size=10 value=<%=room_array2(2)%>>
    <tr><td>房间关门:&nbsp;关<input <%=onlyread%> type=radio name=door_open value="0" <%if room_array2(15)="0" then%>checked<%end if%>>&nbsp;开<input
       <%=onlyread%> type="radio" name=door_open value="true" <%if room_array2(15)<>"0" then%>checked<%end if%>><td>级别限制:<input <%=onlyread%> type=text name=permit_level maxlength=10 size=10 value=<%=room_array2(14)%>>
     <tr><td colspan=3>房间描述:<textarea <%=onlyread%> rows="3" name="room_des" cols="40"><%=room_array2(3)%></textarea>
      <tr><td colspan=3>管理标题:<textarea rows="3" <%=onlyread%>  name="room_top" cols="40"><%=room_array2(4)%></textarea>
      <tr><td colspan=3>嘉宾名单:<textarea rows="2" <%=onlyread%>  name="room_guests" cols="40"><%=room_array2(13)%></textarea>
    <%if owner then%><tr><td colspan=3><input type="submit" class=navy1 value="提交" name="B1">
        <input class=navy1 type="reset" value="复原" name="B2">
        <input class=navy1 type="reset" value="放弃" onclick="window.close()"></td></tr>
        </form><tr><td colspan=3 class=navy1>关于房间设置修改的说明
        <tr><td colspan=3><ul><li>嘉宾名单如不为空则聊天室自动为嘉宾聊天室。多个嘉宾之间用半角空格分开。嘉宾聊天室中嘉宾发言在发言区的上部分。
        <li>管理标题最多50个字符。房间描述250个字符。
        <li>房间描述里面可以使用字体特效！
  <%end if%>
  <tr><td colspan=3 class=navy1>房间其它属性
  <tr><td colspan=3><ul><li>建立时间：<%=room_array2(11)%><li>房间人气：<%=room_array2(10)%><li>房间生命：<%=room_life%>
    </table></table>
  </body>
  </html>











































































