<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq1.asp"-->
<%
call head()
Call saycardd(""&waptitle&"聊天室")
Call FortxtChat
%>
<!--#include file="../sy1.asp"-->
<%
Response.write "<img src='"&chatlogo&"' alt='.' /><br/>"

Response.write "=+聊天室列表+=<br/>"

'''会员退出聊天室更新聊天室人数
 Conn.execute("update chat Set chatnum=chatnum+1 where id in (select chatid From users where id="&myid&")")
 conn.execute("update Users Set ChatID=0 where ID="&myid)
''''更新结束

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from Chat where gruid=0 and suxin=0 order by pid asc",conn,1,1
If Not rs.eof Then
If saytk=100 Then response.write"<ul class=""alst"">"
	Dim PageSize,i
	PageSize=8				
	Dim Count,page,pagecount,gopage			
	gopage="index.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
dim ggss
	For i=1 To PageSize     						
	If rs.eof Then Exit For
   'Response.write ""&i+(page-1)*PageSize&"."
If saytk=100 Then response.write"<li>"
   Response.write "<a href=""chatroom.asp?id="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&ubb(rs("roomname"))&"("&rs("Chatnum")&")</a><br/>"
If saytk=100 Then response.write"</li>"
	rs.moveNext
 	Next
	If saytk=100 Then response.write"</ul>"
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a><br/>"
Else
   Response.write "暂时没有聊天室！<br/>"
end If
Response.write "=+<a href=""indexs.asp?saytk="&saytk&"&amp;sid="&sid&""">自建</a>"
Response.write "聊天室+=<br/>"
'==================
If saytk=100 Then response.write"<ul class=""alst"">"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from Chat where gruid=0 and suxin<>0 order by pid asc",conn,1,1
If Not rs.eof Then

	PageSize=8					
		
	gopage="index.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))

	For i=1 To PageSize     						
	If rs.eof Then Exit For
If saytk=100 Then response.write"<li>"
   'Response.write ""&i+(page-1)*PageSize&"."
   Response.write "<a href=""chatroom.asp?id="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&ubb(rs("roomname"))&"("&rs("Chatnum")&")</a><br/>"
If saytk=100 Then response.write"</li>" End if
	rs.moveNext
 	Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a><br/>"
If saytk=100 Then 
response.write"</ul>"
End if
Else
   Response.write "暂时没有聊天室！<br/>"
end If


'if myid<>rs("fid") then
Function CreatedTextFiles(FileName,body)
On Error Resume Next
If InStr(FileName, ":") = 0 Then FileName = Server.MapPath(FileName)
	Dim oStream
	Set oStream = CreateObject("ADODB.Stream")
	oStream.Type = 2 
	oStream.Mode = 3 
	oStream.Charset = "GB2312"
	oStream.Open
	oStream.Position = oStream.Size
	oStream.WriteText body
	oStream.SaveToFile FileName, 2
	oStream.Close
	Set oStream = Nothing
	If Err.Number <> 0 Then Err.Clear
	End Function
'================================================

if myid<>0 then
mz="[url=uinfo.asp?id="&myid&"&amp;saytk="&saytk&"&sid=[sid]]"&myni&"[/url]"
else
mz="游客"
end if
conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&"进入了(url=/bbs/chat/index.asp?saytk="&saytk&"&sid=[sid])聊天大厅(/url)')")
rs.close
set rs=nothing
conn.close
set conn=Nothing

call bbslbtxt()
%>

<!--#include file="../fanhui.asp"-->
<% call head3() %>