<!--#include file="inc.asp"-->
<meta http-equiv="Content-Type' content="text/html; charset=gb2312">
<%
Dim ID,OnlineList
ID=request.querystring("ID")
If ID="1" Then Session(CacheName&"Online")=""
If Session(CacheName&"Online")="1" Then
	If ID<>"1" Then Session(CacheName&"Online")="0"
	OnlineList=""
Else
	Session(CacheName&"Online")="1"
	OnlineList=ShowOnlineList()
End If
Set BBS94KK=Nothing


Function ShowOnlineList()
Dim Temp,list,OnlineCache,AllonlineNum,EachOnline,User,S,I,II,pic,UserIP,PageInfo,TempBoard
Dim PSize,page,PageMax,Title
If BBS94KK.Cache.valid("OnlineCache") Then
	OnlineCache=BBS94KK.Cache.Value("OnlineCache")
	EachOnline=Split(OnlineCache,",")
	AllonlineNum=uBound(EachOnline)-1
	If BBS94KK.BoardID<>0 Then
		For I=0 To AllonlineNum
			Temp=Split(EachOnline(i),"|")
			If Int(Temp(8))=BBS94KK.BoardID Then
			TempBoard=TempBoard&EachOnline(i)&","
			End If
		Next
			OnlineCache=TempBoard
			EachOnline=Split(OnlineCache,",")
			AllonlineNum=uBound(EachOnline)-1
	End If
	PSize=Int(BBS94KK.Info(47))
	page=Request("page")
	If not isnumeric(page) then Page=1
	page=int(page)
	If AllOnlineNum-1 mod PSize = 0 Then
		PageMax = AllOnlineNum \ PSize
	Else
		PageMax = AllOnlineNum \ PSize + 1
	End If
	If Page >PageMax Then Page=PageMax
	If Page<1 Then Page=1
	
	If AllonlineNum =>page*PSize Then AllonlineNum=page*PSize-1
	For i=(page*PSize-pSize) to AllonlineNum
	II=II+1
	Temp=Split(EachOnline(i),"|")
	User=Temp(1)
	UserIp="已设置保密"
	Select Case Temp(6)
	Case "9"
	Pic=BBS94KK.SkinsPic(21)
	Case "8"
	Pic=BBS94KK.SkinsPic(22)
	Case "7"
	Pic=BBS94KK.SkinsPic(23)
	Case "4"
	Pic=BBS94KK.SkinsPic(24)
	Case "1"
	If BBS94KK.MyAdmin<>9 Then User="隐士"
	Pic=BBS94KK.SkinsPic(26)
	Case "0"
	If User="" Then
		Pic=BBS94KK.SkinsPic(27)
		User="访客"
	Else
		Pic=BBS94KK.SkinsPic(25)
	End If
	End Select
	If BBS94KK.FoundUser Then
		If SESSION(CacheName& "MyGradeInfo")(42)="1" Then
			UserIP=Temp(5)
		End If
	End If
	Title="所在位置："&Temp(7)&"&#10&#13进入时间："&Temp(3)&"&#10&#13活动时间："&Temp(4)&"&#10&#13真实IP地址："&UserIp
	If User="访客" or User="隐士" Then
		User="<a title="""&Title&""" >"&User&"</a>"
	Else
		User="<a title='"&Title&"' href='userInfo.asp?name="&User&"'>"&User&"</a>"
	End If
	If Temp(1)<>"" And Temp(1)=BBS94KK.MyName Then User=User&"<span title='这个就是你自己哦' style='color:red'>⊕</span>"
	List=List&"<td>"&pic&User&"</td>"
	If II mod 6 =0 And II<>PSize Then List=List&"</tr><tr>"
Next
	PageInfo="页次："&Page&" / "&PageMax&"页"
	if Page<>1 then
		PageInfo=PageInfo&"【<a target='hiddenframe' href='Online.asp?page=1&BoardID="&BBS94KK.BoardID&"&id=1'>首页</a>】"
		PageInfo=PageInfo& "<a target='hiddenframe' href='Online.asp?page="&cstr(Page-1)&"&BoardID="&BBS94KK.BoardID&"&id=1'>【上一页】</a>"
	end if
	If PageMax-Page>=1 then
		PageInfo=PageInfo& "<a target='hiddenframe' href='Online.asp?page="&cstr(Page+1)&"&BoardID="&BBS94KK.BoardID&"&id=1'>【下一页】</a>"
		PageInfo=PageInfo& "<a target='hiddenframe' href='Online.asp?page="&PageMax&"&BoardID="&BBS94KK.BoardID&"&id=1'>【尾页】</a>"
	End if
	List="<table border='0' width='100%'><tr>"&List&"</tr></table>"
	S=BBS94KK.ReadSkins("显示在线列表")
	S=Replace(S,"{管理员}",BBS94KK.SkinsPic(21))
	S=Replace(S,"{超级版主}",BBS94KK.SkinsPic(22))
	S=Replace(S,"{版主}",BBS94KK.SkinsPic(23))
	S=Replace(S,"{VIP会员}",BBS94KK.SkinsPic(24))
	S=Replace(S,"{会员}",BBS94KK.SkinsPic(25))
	S=Replace(S,"{隐身}",BBS94KK.SkinsPic(26))
	S=Replace(S,"{游客}",BBS94KK.SkinsPic(27))
	S=Replace(S,"{用户列表}",list)
	S=Replace(S,"{分页}",PageInfo)
	S=Replace(S,CHR(34),CHR(39))
	S=Replace(S,VbCrlf,"")
	ShowOnlineList=S
End If
End Function
%>
<script language="JavaScript" type="text/JavaScript">
parent.document.getElementById("showon").innerHTML="<%=OnlineList%>";
</script>