<!--#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
  set cschat=nothing
  response.write "<script Language=JavaScript>top.location.href = 'showerr.asp';</script>"
  application.unlock
  response.end
end if

myname=cschat.myname
room_id=cschat.room_id

h=request("h")
if IsNumeric(h) then
  Set fs = Server.CreateObject("Scripting.FileSystemObject")
  if fs.fileExists(Server.MapPath("headface/"&h&".gif")) then
    Set Conn=Server.CreateObject("ADODB.Connection")
    conn.open Application( ConstStr & "_connstr")
    conn.execute("update user set headface="&h&" where username='"&myname&"'")
    conn.close
    set conn=nothing
    Application( ConstStr & "_user_list")=cschat.SetListValue(Application( ConstStr & "_user_list"),myname,6,h,0)
    says = Application(ConstStr & "_says")
    current = Application(ConstStr & "_current")
    cschat.newsay myname,"",0,room_id,"<\script>parent.addl(\'" & myname & "\'," & cschat.getListvalue(Application( ConstStr & "_user_list"),myname,2) & ",\'" & h & "\',\'" & cschat.getListvalue(Application( ConstStr & "_user_list"),myname,12) & "\')</\script>","","",-5,says,current
    Application(ConstStr & "_says") = says
    Application(ConstStr & "_current") = current
  else%>
    <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'><meta content='text/html;charset=gb2312' http-equiv='content-type'><SCRIPT>parent.addsay(-1,'【系统】您所选取的头像并不存在！','','<%=myname%>',0,'black','',-2,'<%=time()%>');</script>
  <%end if
end if
set cschat=nothing
application.unlock
%>