<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#include file="../forbbs.asp"-->
<%call head()
Call saycarda("聊天室发言")

Call FortxtChat
 dim pa,TM
  pa=request("pa")
  TM=request("TM")
dim ID,user,IDS
ID=trim(Request.QueryString("ID"))
IDS=trim(Request.QueryString("IDS"))
if ID="" or IsNumeric(ID)=false then
   Call Error("错误的聊天室ID")
end if
dim roomAdmin,roomAdmin2
set rs=server.createobject("adodb.recordset")
rs.open "select roomAdmin,roomAdmin2 from Chat where ID="&ID,conn,1,2
if rs.eof then
  rs.close
  set rs=nothing
  Call Error("不存在的聊天室！")
end if
roomAdmin = rs("roomAdmin")
rs.close
set rs=nothing
'管理员
dim AdminID
AdminID = 0
if Instr(","&roomAdmin&",",","&myid&",") > 0 then
   AdminID   = myid
end if


if IDS<>"" then
if IDS="" or IsNumeric(IDS)=false then
   Call Error("会员ID无效")
end if
dim reuser
set rs=server.createobject("ADODB.Recordset")
rs.Open "select ID,name from Users where ID = "&IDS,conn,1,1
if not rs.eof then
user=rs("name")
reuser=1
end if
rs.close
set rs=nothing
end if



if ids<>"" then
response.write "我对"&ubb(user)&"说:<br/>"
else
       if saytk<>1 Then
       Response.write "<form name=""form"" method=""post"" action=""chatsendok.asp?sid="&sid&"&amp;saytk="&saytk&""">"
	   end If
	   
       if saytk<>1 Then
       response.write "<select name='user' value='"&ubb(user)&"'><option value='all'>大家</option>"
	   Else
	   response.write "<select name='user"&tt&"' value='"&ubb(user)&"'><option value='all'>大家</option>"
	   end If
	   
set rs=server.createobject("ADODB.Recordset")
rs.Open "select ID,name from Users where  ChatID = "&ID&" and ID<>"&myid&" order by tjj desc",conn,1,1
dim j
j=1
do while not rs.eof
 dim username
username=rs("name")
if len(username)>8 then username=left(username,8)

Response.write "<option value='"&ubb(username)&"'>" & ubb(username) & "</option>"

j=j+1
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=Nothing
Response.write "</select>"
end If
if saytk<>1 then
Response.write "<form name=""form"" method=""post"" action=""chatsendok.asp?sid="&sid&"&amp;saytk="&saytk&""">"
end if

Response.write "表情:"
response.write "<select title='表情' name='face' value='0'>"&chr(13)
response.write "<option title='表情' value='0'>表情</option>"&chr(13)
response.write "<option title='微笑' value='1'>微笑</option>"&chr(13)
response.write "<option title='哭泣' value='2'>哭泣</option>"&chr(13)
response.write "<option title='调皮' value='3'>调皮</option>"&chr(13)
response.write "<option title='脸红' value='4'>脸红</option>"&chr(13)
response.write "<option title='害羞' value='5'>害羞</option>"&chr(13)
response.write "<option title='生气' value='6'>生气</option>"&chr(13)
response.write "<option title='偷笑' value='7'>偷笑</option>"&chr(13)
response.write "<option title='流汗' value='8'>流汗</option>"&chr(13)
response.write "<option title='我倒' value='9'>我倒</option>"&chr(13)
response.write "<option title='得意' value='10'>得意</option>"&chr(13)
response.write "<option title='眦牙' value='11'>眦牙</option>"&chr(13)
response.write "<option title='疑问' value='12'>疑问</option>"&chr(13)
response.write "<option title='睡觉' value='13'>睡觉</option>"&chr(13)
response.write "<option title='好色' value='14'>好色</option>"&chr(13)
response.write "<option title='口水' value='15'>口水</option>"&chr(13)
response.write "<option title='敲头' value='16'>敲头</option>"&chr(13)
response.write "<option title='可爱' value='17'>可爱</option>"&chr(13)
response.write "<option title='猪头' value='18'>猪头</option>"&chr(13)
response.write "<option title='YEAH' value='19'>YEAH</option>"&chr(13)
response.write "<option title='玫瑰' value='20'>玫瑰</option>"&chr(13)
response.write "</select>"&chr(13)
response.write "<br/>内容<input type=""text"" name=""Chat""/>"&chr(13)
if saytk<>1 then
response.write "<input type=""hidden"" name=""ID"" value="""&ID&"""/>"
if ids<>"" then
response.write "<input type=""hidden"" name=""user"" value="""&user&"""/>"
end if
response.write "<input type=""hidden"" name=""TM"" value="""&TM&"""/>"
response.write "<input type=""hidden"" name=""Pa"" value="""&Pa&"""/>"
response.write "<input type=""submit"" name=""Submit"" value=""确定发言""></form><br/>"
else
Response.write "<br/><anchor>[确定发言]"&chr(13)
Response.write "<go href=""chatsendok.asp?sid="&sid&"&amp;saytk="&saytk&""" method=""post"">"&chr(13)
Response.write "<postfield name=""ID""   value="""&ID&"""/>"&chr(13)
Response.write "<postfield name=""face"" value=""$(face)""/>"&chr(13)
if ids<>"" then
Response.write "<postfield name=""user"" value="""&ubb(user)&"""/>"&chr(13)
else
Response.write "<postfield name=""user"" value=""$(user"&tt&")""/>"&chr(13)
end if
Response.write "<postfield name=""Chat"" value=""$(Chat)""/>"&chr(13)
Response.write "<postfield name=""TM""   value="""&TM&"""/>"&chr(13)
Response.write "<postfield name=""Pa"" value="""&Pa&"""/>"&chr(13)
Response.write "</go></anchor>"&chr(13)
end if
if reuser=1 then
Response.write "<br/><a href='../uinfo.asp?ID="&IDS&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>[TA的资料]</a>"&chr(13)
'管理员
if myid = AdminID or keys = 1 or keys=2 then
Response.write "<br/><a href='chatout.asp?ID="&ID&"&amp;IDS="&IDS&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>[踢出房间]</a>"&chr(13)
end if
end if
Response.write "<br/><a href=""chatroom.asp?ID="&ID&"&amp;TM="&TM&"&amp;Pa="&Pa&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[返回聊天室]</a>"&chr(13)
call headsay()
%>