<!--#include file="Index_Setting.asp"-->
<!--#include file="Inc/Cl_ClsCount.asp"-->
<%
if Not Cl.ChkUserLevel(Cl.Web_Setting(49),Cl.UserLevel) then
	Cl.OutErr("<li>对不起，你的权限不够!</li><li>只有本站的“"&Cl.GetUserGroupName(Cl.Web_Setting(49))&"”才能查看在线列表！</li>")
end if
TotalPut=0
TempStr = Replace(Template.html(2),"{%showonlinelist%}",ShowOnlineList)
if TotalPut>0 then
	TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage("OnlineList.asp",TotalPut,MaxPerPage,"个","用户"))
else
	TempStr = Replace(TempStr,"{%showpage%}","")
end if

Cl.Path= Cl.lanstr(1) & "<a href='" & Cl.WebDir & Cl.ChannelDir & "'>" & Cl.ChannelName & "</a>&nbsp;&gt;&gt;&nbsp;在线列表"
Cl.Title=Cl.Web_info(1) & " >> " & Cl.ChannelName & " >> 在线列表"

Response.write Cl.ReplaceAllFlag(TempStr)

Public Function ShowOnlineList()
	Set Count=New Cls_Count
	Count.ConnectionCount
	Dim RsOnline,SqlOnline,strHTML,n
	Set RsOnline=Server.createObject("Adodb.RecordSet")
	SqlOnline="Select id,username,userclass,stats,ip,startime,lastimebk,NowPage,Agent,UserLevel,UserID From Cl_Online order by lastimebk desc,id desc"
	RsOnline.Open SqlOnline,Conn_Count,1,1
	strHTML="<table width='100%' border='0' cellspacing='1' cellpadding='0'>"
	strHTML=strHTML&"<tr>"
	strHTML=strHTML&"<td width='70'>用户</td>"
	strHTML=strHTML&"<td width='70'>等级</td>"
	strHTML=strHTML&"<td width='120'>来访地区/时间</td>"
	strHTML=strHTML&"<td width='70'>活动时间</td>"
	strHTML=strHTML&"<td width='170'>其它信息</td>"
	strHTML=strHTML&"<td>当前页面</td>"
	strHTML=strHTML&"</tr>"
	if Not (RsOnline.bof And RsOnline.Eof) then
		TotalPut=RsOnline.RecordCount
		if (TotalPut mod MaxPerPage)=0 then
			TotalPages = TotalPut \ MaxPerPage
		else
			TotalPages = TotalPut \ MaxPerPage + 1
		end if
		if CurrentPage > TotalPages then CurrentPage=TotalPages
		if CurrentPage < 1 then CurrentPage=1
		RsOnline.move (CurrentPage-1)*MaxPerPage
	end if
	Do while Not RsOnline.Eof
		n=n+1
		strHTML=strHTML&"<tr>"
		strHTML=strHTML&"<td width='70'>"&RsOnline(1)&"</td>"
		strHTML=strHTML&"<td width='70'>"&RsOnline(2)&"</td>"
		strHTML=strHTML&"<td width='120'>"
		If Trim(Cl.Web_Setting(46)) = "Yes" Then
			strHTML=strHTML&Count.address(RsOnline(4))
		Else
			strHTML=strHTML&RsOnline(4)
		End If
		strHTML=strHTML&"<br>"&RsOnline(5)&"</td>"
		strHTML=strHTML&"<td width='70'>"&RsOnline(6)&"</td>"
		strHTML=strHTML&"<td width='170'>"
		If Trim(Cl.Web_Setting(47)) = "Yes" Then
			Count.GetBrowser(Request.ServerVariables("HTTP_USER_AGENT"))
			strHTML=strHTML&"游 览 器："&Count.Browser&" "&Count.version&"<br>"
			strHTML=strHTML&"操作系统："&Count.platform
		else
			strHTML=strHTML&RsOnline(8)
		End If
		strHTML=strHTML&"</td>"
		strHTML=strHTML&"<td><a href="""&RsOnline(7)&""" target=""_blank"">"&RsOnline(7)&"</a></td>"
		strHTML=strHTML&"</tr>"
		if n>=MaxPerPage then exit do
		RsOnline.MoveNext
	Loop
	strHTML=strHTML&"</table>"
	ShowOnlineList=strHTML
End Function

'==================================================
'CreateLive CMS Version 3.1
'							Powered by Aspoo.Net
'
'邮箱: aspoo@126.com		Info@aspoo.cn
'ＱＱ: 3315263				596197794
'网站: www.aspoo.cn			www.aspoo.com
'论坛: bbs.aspoo.cn			bbs.aspoo.com
'
'Copyright (C) 2005 Aspoo.Net All Rights Reserved.
'==================================================
%>