<!--#include file="Inc.asp"-->

<%
call head()
Call saycarda("在线用户")

%>
<!--#INCLUDE file="newguest.asp"-->
<%

function onlineCou()
Dim onlineCounts
onlineCounts = conn.execute("Select count(ID) from [online]")(0)
response.write " 共在线" & onlineCounts & "人" & Chr(13)
end function
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"select * from online where online=1 order by times desc",conn,1,1
Count1=rs.recordcount
rs.close
set rs=nothing
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"select * from online order by times desc",conn,1,1 
If Not rs.eof Then
	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage		
	gopage="onlineview.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;"
	Count=rs.recordcount	
response.write "当前全站在线"&Count&"人<br/>-----------<br/>游客"&Count-Count1&"人.会员<a href=""hy.asp?saytk="&saytk&"&amp;sid="&sid&""">"&Count1&"</a>人<br/>"
	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	
response.write ""&i+(page-1)*PageSize&"."

if rs("online")=1 then
response.write ""&vipshow(rs("userid"))&""
response.write "<a href=""uinfo.asp?id="&rs("userid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&ubb(rs("name"))&"(ID:"&rs("userid")&")</a><br/>"
else
response.write ""&ubb(rs("name"))&"<br/>"
end if

response.write ""&fordate(rs("times"))&"<br/>"
if keys=1 or keys=2 then
response.write "IP:"&rs("onlineip")&"<br/>"
end if
	rs.moveNext
 	Next
response.write "第"&page&"页/共有"&pagecount&"页<br/>"
	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/>页<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
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "---------"
%><!--#include file="fanhui.asp"-->
<%Call head1()%>