<!-- #include file=inc/BBSsetup.asp -->
<!-- #include file=inc/User_Setup.ASP -->
<!-- #include file=inc/Board_Popfun.asp -->
<%
DEF_PubMessageEnable = 1
GBL_CHK_PWdFlag = 0
Dim LMT_SimpleHomePage '是否为简约首页
LMT_SimpleHomePage = 0
If Request.QueryString("S") = "1" Then LMT_SimpleHomePage = 1

Dim GBL_ID
Dim GBL_REQ_Assort,GBL_TopicNum,GBL_AnnounceNum,GBL_GoodNum,GBL_TodayAnnounce

Dim GBL_OnlineUserNum,GBL_UserCount,GBL_MaxOnline,GBL_MaxolTime,GBL_OnlineTime,GBL_PageCount,GBL_UploadNum
Dim GBL_MaxAnnounce,GBL_MaxAncTime,GBL_YesterdayAnc

Dim Blist,BoardNum
Blist = application(DEF_MasterCookies & "BList")

Function CheckAssort

	GBL_REQ_Assort = Left(Request.QueryString("Assort"),14)
	If isNumeric(GBL_REQ_Assort)=0 Then GBL_REQ_Assort=0
	GBL_REQ_Assort = Fix(cCur(GBL_REQ_Assort))

	Dim BoardNum,N
	If GBL_REQ_Assort > 0 and isArray(Blist) = True Then
		BoardNum = Ubound(Blist,2)		
		For N = 0 to BoardNum
			If GBL_REQ_Assort = cCur(Blist(1,n)) Then
				If isArray(Application(DEF_MasterCookies & "BoardInfo" & Blist(0,n))) = True Then
					GBL_Board_BoardAssort = cCur(Application(DEF_MasterCookies & "BoardInfo" & Blist(0,n))(1,0))
					GBL_Board_AssortName = Application(DEF_MasterCookies & "BoardInfo" & Blist(0,n))(14,0)
					Exit For
				Else
					GBL_REQ_Assort = 0
					GBL_Board_BoardAssort = 0
					GBL_Board_AssortName = ""
					Exit For
				End If
			End If
		Next
		If N > BoardNum Then GBL_REQ_Assort = 0
	Else
		GBL_REQ_Assort = 0
		GBL_Board_BoardAssort = 0
		GBL_Board_AssortName = ""
	End If
	If cCur(GBL_ShowBottomSure) = 0 and GBL_REQ_Assort > 0 Then GBL_SiteBottomString = ""

End Function

Function DisplayBoardMastList(MasterList,Num)

	If MasterList = "" Then
		Response.Write "无"
		Exit function
	ElseIf MasterList = "?LeadBBS?" Then
		Response.Write "全体版主"
		Exit function		
	End If
	Dim temp,n,I
	Temp = split(MasterList,",")
	I = Ubound(temp,1)
	For N = 0 to I
		If N >= Num Then
			'Response.Write "..."
			Exit For
		End If
		Response.Write " <a href=" & DEF_BBS_HomeUrl & "user/LookUserInfo.asp?name=" & urlencode(temp(N)) & ">" & htmlencode(temp(n)) & "</a>"
	Next

	If N >= Num and N <= I Then
		Response.Write "<span style=""cursor:hand"" title=""更多版主: " & temp(N)
		N = N + 1
		For N = N to I
			Response.Write " " & temp(N)
		Next
		Response.Write """>...</span>"
	End If

End Function

Function DisplayBoard

	Dim Temp,Flag,NN,n,m
	Flag = 0

	Dim GetData(21,0),GDT
	If isArray(Blist) = True Then
		BoardNum = Ubound(Blist,2)
	Else
		BoardNum = -1
	End If

	If BoardNum = -1 Then
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=1 cellpadding=6 align=center bgcolor=" & DEF_BBS_DarkColor & " class=TBone><tr bgcolor=" & DEF_BBS_LightestColor & " class=TBBG9><td colspan=4>找不到任何版面</td></tr></table>"
	Else
		Dim CurrentAssosrt
		CurrentAssosrt = -1183
		GBL_TopicNum = 0
		GBL_AnnounceNum = 0
		'Response.Write "fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1)):"&fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1))
		For N = 0 to BoardNum
			Temp = Application(DEF_MasterCookies & "BoardInfo" & Blist(0,n))
			GetData(0,0) = Blist(0,n)
			If isArray(Temp) = False Then
				ReloadBoardInfo(GetData(0,0))
			End If
		If isArray(Temp) = True and (GBL_REQ_Assort = 0 or (GBL_REQ_Assort > 0 and GBL_REQ_Assort = cCur(Blist(1,n)))) Then
	
			GetData(15,0) = Temp(14,0)
			GetData(2,0) = Temp(0,0)
			GetData(1,0) = Temp(1,0)
			GetData(6,0) = Temp(29,0)
			GetData(7,0) = Temp(30,0)
			GetData(16,0) = Temp(31,0)
			GetData(17,0) = Temp(32,0)
			If LMT_SimpleHomePage = 0 Then
				GetData(14,0) = Temp(1,0)
				GetData(3,0) = Temp(2,0)
				GetData(4,0) = Temp(3,0)
				GetData(5,0) = Temp(4,0)
				GetData(8,0) = Temp(7,0)
				GetData(9,0) = Temp(8,0)
				GetData(10,0) = Temp(19,0)
				GetData(11,0) = Temp(20,0)
				GetData(12,0) = Temp(10,0)
				GetData(13,0) = Temp(9,0)
				GetData(18,0) = Temp(21,0)
				GetData(19,0) = Temp(22,0)
				GetData(20,0) = Temp(23,0)
				GetData(21,0) = Temp(27,0)
			End If
			If CurrentAssosrt<>cCur(GetData(1,0)) Then
				CurrentAssosrt = cCur(GetData(1,0))
				If Flag = 1 Then
					if nn > 0 Then
						For m = nn to 3
							Response.Write "<td width=20% >&nbsp;</td>"
						Next
					End If
					Response.Write "</table>"
					If GBL_TableBottomString <> "" Then
						Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
						Response.Write GBL_TableBottomString
						Response.Write "</td></tr></table>"
					End If
					Response.Write "<br>"
				End If
				If GBL_TableHeadString <> "" Then
					Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
					Response.Write GBL_TableHeadString
					Response.Write "</td></tr></table>"
				End If
				Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=1 cellpadding=5 align=center bgcolor=" & DEF_BBS_DarkColor & " class=TBone><tr bgcolor=" & DEF_BBS_LightDarkColor & "><td colspan=4 class=TBHead><img src=images/blank.gif width=2 height=3><br><a href=Boards.asp?Assort=" & GetData(14,0) & "><b><font color=white class=HeadFont>" &  GetData(15,0) & "</font></b></a></td></tr>"
				Flag = 1
				nn = 0
			End If

			If LMT_SimpleHomePage = 1 Then
				If (nn mod 4) = 0 Then Response.Write "<tr bgcolor=#f7f7f7 class=TBBG9>"
				Response.Write "<td width=20% ><a href=Board/Board.asp?BoardID=" & GetData(0,0) & ">" & GetData(2,0) & "</a></td>"
				nn = nn + 1
				If nn> 3 Then nn = 0
			Else
			Response.Write "<tr bgcolor=" & DEF_BBS_LightestColor & " align=center class=TBBG9><td width=25 bgcolor=" & DEF_BBS_LightColor & " class=TBBG1><img src=images/" & GBL_DefineImage & "BoardTopic/"
			If cCur(GetData(16,0)) > 0 Then Response.Write "_"
			If GetData(8,0) <> "" Then
				Response.Write "lock.gif title=保密论坛"
			Else
				If GetBinarybit(GetData(13,0),7) = 1 Then
					Response.Write "lock3.gif title=版主专区"
				Else
					If GetBinarybit(GetData(13,0),4) = 1 and GetBinarybit(GetData(13,0),3) = 1 and GetBinarybit(GetData(13,0),6) = 1 Then
						Response.Write "readonly.gif title=只读论坛"
					Else
						If GetBinarybit(GetData(13,0),2) = 1 Then
							Response.Write "lock2.gif title=正式会员论坛"
						Else
							If GetBinarybit(GetData(13,0),1) = 1 Then
								Response.Write "lock1.gif title=注册认证论坛"
							Else
								If GetBinarybit(GetData(13,0),9) = 1 Then
									Response.Write "open.gif title=开放论坛"
								Else
									Response.Write "1.gif title=常规论坛"
								End If
							End If
						End If
					End If
				End If
			End If
			Response.Write " width=24 height=24></td>"
			Response.Write "<td align=Left><table width=100% border=0 cellspacing=0 cellpadding=0>"
			If GetData(18,0) <> "" Then Response.Write "<tr><td rowspan=4 width=" & GetData(19,0) & " valign=top><img src=images/null.gif width=2 height=3><br><a href=Board/Board.asp?BoardID=" & GetData(0,0) & "><img src=""" & htmlencode(GetData(18,0)) & """ width=" & GetData(19,0) & " height=" & GetData(20,0) & " border=0></a></td><td width=4 rowspan=4><img src=images/null.gif width=2 height=2></td></tr>"
			Response.Write "<tr height=20><td><a href=Board/Board.asp?BoardID=" & GetData(0,0) & ">" & GetData(2,0) & "</a>"
			
			Response.Write "</td><td align=right rowspan=2 valign=top><img src=images/null.gif width=2 height=2><br><a href=announce/announce2.asp?BoardID=" & GetData(0,0) & "><img src=images/" & GBL_DefineImage & "BoardTopic/post.gif height=13 width=12 border=0 title=在此论坛发表新帖子></a><br><img src=images/null.gif width=2 height=5><br><a href=Board/EBoard.asp?BoardID=" & GetData(0,0) & "><img src=images/" & GBL_DefineImage & "BoardTopic/elist.gif height=13 width=12 border=0 title=查看精华区内容(共" & GetData(17,0) & "精华帖子)></a></td></tr>"
			Response.Write "<tr height=15><td>"
			Response.Write GetData(3,0) & "</td>"
			'Response.Write "<td align=right><a href=Board/EBoard.asp?BoardID=" & GetData(0,0) & "><img src=images/" & GBL_DefineImage & "BoardTopic/elist.gif height=13 width=12 border=0 title=查看精华区内容(共" & GetData(17,0) & "精华帖子)></a></td></tr>"
			Response.Write "<tr height=15><td colspan=2>"
			Response.Write "<img src=images/null.gif height=2 width=192><br>版主："
			DisplayBoardMastList GetData(12,0),5
			Response.Write "</tr>"
			Response.Write "</table></td>"
			Response.Write "<td align=Left width=80 valign=top><img src=images/null.gif height=2 width=2><br>主题 <b>" & GetData(6,0) & "</b><br><img src=images/null.gif height=4 width=2><br>新帖 <b><font color=" & DEF_BBS_LightDarkColor & " class=TBtwofont>" & GetData(16,0) & "</font></b><br><img src=images/null.gif height=4 width=2><br>总量 <b>" & GetData(7,0) & "</b></td>"
			Response.Write "<td align=left width=222 valign=top><img src=images/null.gif height=2 width=2><br>"
			Temp = 0
			'If GetBinarybit(GetData(13,0),12) = 1 Then
			'	If(GetData(21,0)="" or isNull(GetData(21,0))) Then
			'		Response.Write "版面：无下级版面"
			'	Else
			'		Response.Write "版面：" & (Ubound(Split(GetData(21,0),","),1) + 1) & "个"
			'	End If
			'Else
				If GetData(11,0) = "" or isNull(GetData(11,0)) Then
					Response.Write "主题：无"
				Else
					If strLength(GetData(11,0))>31 Then
						GetData(11,0) = htmlencode(LeftTrue(GetData(11,0),31-3)) & "..."
					Else
						GetData(11,0) = htmlencode(GetData(11,0))
					End if
					If GetData(8,0) <> "" or GetBinarybit(GetData(13,0),2) = 1 or GetBinarybit(GetData(13,0),7) = 1 Then
						Response.Write "主题：已设置为隐藏"
						Temp = 1
					Else
						If cCur(GetData(10,0)) > 0 Then
							Response.Write "主题：<a href=announce/announce.asp?BoardID=" & GetData(0,0) & "&ID=" & GetData(10,0) & "&aupflag=1&anum=1>" & htmlencode(GetData(11,0)) & "</a>"
						Else
							Response.Write "主题：" & htmlencode(GetData(11,0))
						End If
					End If
				End If
				Response.Write "<br><img src=images/null.gif height=4 width=2><br>"
				If GetData(4,0)="" Then
					Response.Write "作者："
					GetData(4,0)="无"
					Response.Write GetData(4,0)
					Response.Write "<br><img src=images/null.gif height=4 width=2><br>时间：无"
				Else
					Response.Write "回复："
					If GetData(4,0) <> "游客" Then
						If Temp = 1 Then
							Response.Write "隐藏"
						Else
							Response.Write "<a href=User/LookUserInfo.asp?Name=" & htmlencode(GetData(4,0)) & ">" & htmlencode(GetData(4,0)) & "</a>"
						End If
					Else
						Response.Write htmlencode(GetData(4,0))
					End If
					If Temp = 0 Then Response.Write " " & Left(RestoreTime(GetData(5,0)),16)
					If isNumeric(Application(DEF_MasterCookies & "BDOL" & GetData(0,0))) = 0 Then
						Application.Lock
						Application(DEF_MasterCookies & "BDOL" & GetData(0,0)) = 0
						Application.UnLock
					End If
					Response.Write "<br><img src=images/null.gif height=4 width=2><br>在线：共<b><a href=User/UserOnline.asp?AtBoardID=" & GetData(0,0) & ">" & cCur(Application(DEF_MasterCookies & "BDOL" & GetData(0,0))) & "</a></b>人在线"
				End If
			'End If
			Response.Write "</td></tr>"
			End If
			GBL_TopicNum = GBL_TopicNum + cCur(GetData(6,0))
			GBL_AnnounceNum = GBL_AnnounceNum + cCur(GetData(7,0))
			GBL_GoodNum = GBL_GoodNum + cCur(GetData(17,0))
			GBL_TodayAnnounce = GBL_TodayAnnounce + cCur(GetData(16,0))
		End If
		Next
		If nn > 0 and LMT_SimpleHomePage = 1 Then
			For m = nn to 3
				Response.Write "<td width=20% >&nbsp;</td>"
			Next
		End If
		Response.Write "</table>"
		'Response.Write "fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1)):"&fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1))
	End If
	If GBL_TodayAnnounce > GBL_MaxAnnounce Then
		GBL_MaxAnnounce = GBL_TodayAnnounce
		Con.ExeCute("Update LeadBBS_SiteInfo Set MaxAnnounce=" & GBL_TodayAnnounce & ",MaxAncTime=" & GetTimeValue(DEF_Now))
		GBL_DBNum = GBL_DBNum + 1
	End If
	%><%If GBL_TableBottomString <> "" Then
			%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%
		End If%><br><%
		
		If GBL_TableHeadString <> "" Then
			Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
			Response.Write GBL_TableHeadString
			Response.Write "</td></tr></table>"
		End If
		DisplayBoardInfo
		If GBL_TableBottomString <> "" Then
			%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%
		End If%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr align=center>
		<td>
<!-- #include file=inc/IncHtm/BoardLink.asp -->
		</td>
	</tr>
	</table>
	<%

End Function

Sub DisplayBoardInfo

	%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="7" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr bgcolor=<%=DEF_BBS_LightestColor%> align=center width=<%=DEF_AllFaceMaxWidth%> class=TBBG9>
		<td width=21 align=center bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1><img src=images/null.gif width=2 height=3><br>论<br>坛<br>信<br>息</td>
		<td align=left valign=top>
				<%DisplayBoardInfo2%>
		<td width=21 bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1><img src=images/null.gif width=2 height=3>个<br>人<br>信<br>息
		<td width=273 align=left valign=top><img src=images/null.gif width=2 height=3><br><%
			If DEF_DisplayOnlineUser = 1 Then%><IMG id=followImg0 name=followImg0 style="CURSOR: hand" onclick=ShowOnline(0,"") src="images/<%=GBL_DefineImage%>frame/plus.gif" loaded="no" width=10 height=10><%
			Else
				Response.Write "<font color=gray class=GrayFont>■</font>"
			End If
			Response.write " 在线人数：<b><a href=User/UserOnline.asp>" & GBL_OnlineUserNum & "</a></b> "
			Response.Write "<a href=User/UserFriend.asp?need=23>查看在线好友</a>"
			%><br>
			<img src=images/null.gif width=2 height=3><br><font color=gray class=GrayFont>■</font> ＩＰ地址：<%=GBL_IPAddress%><br>
			<img src=images/null.gif width=2 height=2><br>
			<font color=gray class=GrayFont>■</font> 系统信息：<%=GetSBInfo(Request.ServerVariables("HTTP_USER_AGENT"),1)%>&nbsp;<%=GetSBInfo(Request.ServerVariables("HTTP_USER_AGENT"),2)%><br>
			<%If GBL_CHK_User <> "" Then
			Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 用 户 名：<a href=User/LookUserInfo.asp?name=" & GBL_CHK_User & ">" & GBL_CHK_User & "</a><br>"
			Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 经 验 值：" & CLng(cCur(GBL_CHK_OnlineTime)/60)
			Response.Write " " & DEF_PointsName & "：" & GBL_CHK_Points
			End If%>
		</td>
	</tr>
	<%If DEF_DisplayOnlineUser = 1 Then%>
	<TR id=follow0 name=follow0 style="DISPLAY: none" bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD id=followTd0 name=followTd0 align=left colspan=5>
	<script language=javascript>
	var EndFlag=0;
	function ShowOnline(id,ur){
		if (EndFlag==0){alert("网页未下载完成,请稍候...");return;}
		if (follow0.style.display!='block'){
			follow0.style.display="block";
			document.followImg0.src="images/<%=GBL_DefineImage%>frame/minus.gif";
			if (document.followImg0.loaded=="no"){document.frames["hiddenframe"].location.replace("User/ol.asp?id="+id+"&ur="+ur);}
			}else{
			follow0.style.display="none";
			document.followImg0.src="images/<%=GBL_DefineImage%>frame/plus.gif";
			}
		}
	</SCRIPT>
            <DIV onclick=ShowOnline(0,"")>
            <TABLE cellPadding=0 width="100%">
              <TBODY>
              <TR>
                <TD width="100%">读取中...</TD></TR></TBODY></TABLE></DIV></TD></TR>
	<%
		End If
	If DEF_DisplayOnlineUser = 2 or DEF_DisplayOnlineUser = 3 Then%>
	<TR bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD align=left colspan=5><%DisplayUserOnline 0,""%></TD></TR>
	<%
	End If%>
	</table><%

End Sub


Sub DisplayBoardInfo2

	Dim Temp%>
	<table border=0 cellspacing=0 cellpadding=0>
	<tr>
		<td>
	<%
	Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 总发帖量：" & GBL_AnnounceNum & " 帖<br>"
	'Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 主题帖子：" & GBL_TopicNum & " 帖<br>"
	'Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 回复帖子：" & (GBL_AnnounceNum-GBL_TopicNum) & " 帖<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 今日帖子：<font color=Red class=RedFont>" & GBL_TodayAnnounce & "</font> 帖<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 昨日帖子：" & GBL_YesterdayAnc & " 帖<br>"
	'Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 精华帖子：" & GBL_GoodNum & " 帖<br>"
	If BoardNum<0 Then BoardNum=0
	'Response.Write "<img src=images/null.gif width=2 height=2><br><font color=gray class=GrayFont>■</font> 可见版面：" & BoardNum+1 & " 个<br>"
	Response.Write "</td><td>"
	'Response.Write "<img src=images/null.gif width=2 height=2><br> &nbsp; &nbsp; <font color=gray class=GrayFont>■</font> 总 在 线："
	'If isNumeric(application(DEF_MasterCookies & "SiteOlTime")) = False Then
	'	Application.Lock
	'	application(DEF_MasterCookies & "SiteOlTime") = 0
	'	Application.UnLock
	'End If
	'GBL_OnlineTime = GBL_OnlineTime + application(DEF_MasterCookies & "SiteOlTime")
	'Response.Write Fix((GBL_OnlineTime)/(24*60*60)) & " 天<br>"
	Response.Write " <img src=images/null.gif width=2 height=2><br>&nbsp; &nbsp; 上传附件：" & GBL_UploadNum & " 个<br>"
	Response.Write " <img src=images/null.gif width=2 height=2><br>&nbsp; &nbsp; 注册用户：" & GBL_UserCount & " 人<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br> &nbsp; &nbsp; 页浏览量：" & GBL_PageCount+application(DEF_MasterCookies & "SitePageCount") & " 次<br>"
	Response.Write "</td></tr><tr><td colspan=2 align=left>"
	Response.Write "<img src=images/null.gif width=2 height=2><br> <font color=gray class=GrayFont>■</font> 最高在线数 " & GBL_MaxOnline & " 人 发生于 " & RestoreTime(GBL_MaxolTime) & "<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br> <font color=gray class=GrayFont>■</font> 最高日发帖 " & GBL_MaxAnnounce & " 帖 发生于 " & RestoreTime(GBL_MaxAncTime)
	Response.Write "</td></tr></table>"

End Sub

Sub Main

	OpenDatabase
	CheckUserOnline
	If GBL_CheckPassDoneFlag <> 1 Then CheckPass
	GetActiveUserNumber
	GBL_CHK_TempStr = ""
	
	CheckAssort
	BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID,""
	
	UpdateOnlineUserAtInfo 0,"论坛首页"

	If GBL_CHK_User = "" Then DisplayTopInfo
	DisplayBoard
	closeDataBase
	SiteBottom
	If DEF_DisplayOnlineUser = 1 Then%><IFRAME name=hiddenframe width=0 height=0></IFRAME>	
	<script language=javascript>
	EndFlag=1;
	</script><%End If%>
	<script>document.write("<img src=http://202.107.219.25/LeadBBS/track/count.asp?refer="+escape(top.document.referrer)+"&ver="+escape(navigator.appVersion)+"&bc="+escape(navigator.appName)+"&scr="+escape(screen.width)+" border=0 width=0 height=0>");</script>
	<%
	If GBL_SiteBottomString <> "" Then Response.Write GBL_SiteBottomString

End Sub

Function DisplayTopInfo

	If GBL_CHK_User <> "" Then
		Dim Flag,Form_ID
	%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="7" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr bgcolor=<%=DEF_BBS_LightestColor%> align=center width=<%=DEF_AllFaceMaxWidth%> class=TBBG9>
		<td width=21 align=center bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1><img src=images/null.gif width=2 height=3><br>个<br>人<br>信<br>息</td>
		<%
			Response.Write "<TD valign=middle><img src=images/null.gif width=2 height=3><br><a href=User/LookUserInfo.asp><img src="
			If FaceWidth > DEF_AllFaceMaxWidth Then FaceWidth = DEF_AllFaceMaxWidth
			If FaceHeight > DEF_AllFaceMaxWidth*2 Then FaceHeight = DEF_AllFaceMaxWidth
			If DEF_AllDefineFace = 1 and FaceUrl <> "" Then
				If Lcase(Left(FaceUrl,5)) <> "http:" Then
					FaceUrl = DEF_BBS_HomeUrl & "Announce/" & htmlencode(FaceUrl)
				Else
					FaceUrl = htmlencode(FaceUrl)
				End If
				Response.Write chr(34) & FaceUrl & chr(34) & " width=" & FaceWidth & " height=" & FaceHeight & " border=0>"
			Else
				Response.Write "images/face/" & string(4-len(cstr(UserPhoto)),"0")&UserPhoto & ".gif border=0 width=62 height=62>"
			End If
			%></a>
		<td align=left><img src=images/null.gif width=100% height=3><br>
			<table border="0" cellspacing="0" cellpadding="1">
			<tr>
				<td width=100%>
			<%
			Flag = 1
			Form_ID = UserLevel
			If Form_ID > 10 Then Form_ID = 10

			Response.Write "<font color=555555 class=GrayFont>用户：</font>" & htmlencode(GBL_CHK_User) & "</td>"
			If (Left(DEF_BBS_ScreenWidth,1) = "7" and isNumeric(DEF_BBS_ScreenWidth)) or isNumeric(DEF_BBS_ScreenWidth) = 0 Then
				Response.Write "<td width=150><img src=images/null.gif width=150 height=1><br><font color=555555 class=GrayFont>等级：</font><img src=images/" & GBL_DefineImage & "lvstar/level" & UserLevel & ".gif align=absmiddle width=110 height=11></td></tr>"
			Else
				Response.Write "<td><img src=images/null.gif width=50 height=1><br><font color=555555 class=GrayFont>等级：</font>" & UserLevel & "级</td></tr>"
			End If

			Response.Write "<tr><td><font color=555555 class=GrayFont>级别：</font>" & DEF_UserLevelString(UserLevel) & "&nbsp;</td>"
			Response.Write "<td width=100><img src=images/null.gif width=100 height=1><br><font color=555555 class=GrayFont>" & DEF_PointsName & "：</font>" & Points & "</td></tr>"
			
			If Flag = 1 Then
				Response.Write "<tr>"
				Flag = 2
			Else
				Flag = 1
			End If
			Response.Write "<td valign=top><font color=555555 class=GrayFont>经验：</font>" & CLng(cCur(OnlineTime)/60) & "<br>"
			
			If Flag = 1 Then
				Response.Write "<tr>"
				Flag = 2
			Else
				Flag = 1
			End If
			Response.Write "<td valign=top><font color=555555 class=GrayFont>文章：</font><a href=""User/UserAncTopic.asp?name=" & htmlencode(GBL_CHK_User) & """>" & AnnounceNum & "篇</a><br>"
						
			If Flag = 1 Then
				Response.Write "<tr>"
				Flag = 2
			ElseIf Flag =2 Then
				Flag = 1
			End If
			Response.write "<td width=120><font color=555555 class=GrayFont>注册：</font>" & RestoreTime(Left(ApplyTime,8)) & "<br>"

			If GetBinarybit(UserLimit,10) = 1 Then
				If Flag = 1 Then
					Response.Write "<tr>"
					Flag = 2
				ElseIf Flag =2 Then
					Flag = 1
				End If
				Response.write "<td valign=top><font color=555555 class=GrayFont>职务：</font><font color=blue class=BlueFont>总版主</font><br>"
			ElseIf GetBinarybit(UserLimit,14) = 1 Then
				If Flag = 1 Then
					Response.Write "<tr>"
					Flag = 2
				ElseIf Flag =2 Then
					Flag = 1
				End If
				Response.write "<td valign=top><font color=555555 class=GrayFont>职务：</font><font color=green class=GreenFont>区版主</font><br>"
			ElseIf GetBinarybit(UserLimit,8) = 1 Then
				If Flag = 1 Then
					Response.Write "<tr>"
					Flag = 2
				ElseIf Flag =2 Then
					Flag = 1
				End If
				Response.write "<td valign=top><font color=555555 class=GrayFont>职务：</font><font color=blue class=BlueFont>论坛版主</font><br>"
			ElseIf GetBinarybit(UserLimit,2) = 1 Then
				If Flag = 1 Then
					Response.Write "<tr>"
					Flag = 2
				ElseIf Flag =2 Then
					Flag = 1
				End If
				Response.write "<td valign=top><font color=555555 class=GrayFont>认证：</font><font color=blue class=BlueFont>认证会员</font><br>"
			End If
			%>
				</td>
			</tr>
			</table>
		<td width=21 bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1><img src=images/null.gif width=2 height=3>浏<br>览<br>信<br>息
		<td width=273 align=left><img src=images/null.gif width=2 height=3><br><%
			If DEF_DisplayOnlineUser = 1 Then%><IMG id=followImg0 name=followImg0 style="CURSOR: hand" onclick=ShowOnline(0,"") src="images/<%=GBL_DefineImage%>frame/plus.gif" loaded="no" width=10 height=10><%
			Else
				Response.Write "<font color=888888 class=GrayFont>■</font>"
			End If
			Response.write " 在线人数：<b><a href=User/UserOnline.asp>" & GBL_OnlineUserNum & "</a></b> "
			Response.Write "<a href=User/UserFriend.asp?need=23>查看在线好友</a>"
			%><br>
			<font color=888888 class=GrayFont>■</font> ＩＰ地址：<%=GBL_IPAddress%><br>
			<img src=images/null.gif width=2 height=3><br>
			<font color=888888 class=GrayFont>■</font> 浏 览 器：<%=GetSBInfo(Request.ServerVariables("HTTP_USER_AGENT"),1)%><br>
			<img src=images/null.gif width=2 height=3><br>
			<font color=888888 class=GrayFont>■</font> 操作系统：<%=GetSBInfo(Request.ServerVariables("HTTP_USER_AGENT"),2)%><br>
		</td>
	</tr>
	<%If DEF_DisplayOnlineUser = 1 Then%>
	<TR id=follow0 name=follow0 style="DISPLAY: none" bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD id=followTd0 name=followTd0 align=left colspan=5>
	<script language=javascript>
	var EndFlag=0;
	function ShowOnline(id,ur){
		if (EndFlag==0){alert("网页未下载完成,请稍候...");return;}
		if (follow0.style.display!='block'){
			follow0.style.display="block";
			document.followImg0.src="images/<%=GBL_DefineImage%>frame/minus.gif";
			if (document.followImg0.loaded=="no"){document.frames["hiddenframe"].location.replace("User/ol.asp?id="+id+"&ur="+ur);}
			}else{
			follow0.style.display="none";
			document.followImg0.src="images/<%=GBL_DefineImage%>frame/plus.gif";
			}
		}
	</SCRIPT>
            <DIV onclick=ShowOnline(0,"")>
            <TABLE cellPadding=0 width="100%">
              <TBODY>
              <TR>
                <TD width="100%">读取中...</TD></TR></TBODY></TABLE></DIV></TD></TR>
	<%
		End If%>
	</table><br>
	<%
	Else
		If GBL_TableHeadString <> "" Then
			Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
			Response.Write GBL_TableHeadString
			Response.Write "</td></tr></table>"
		End If
	%>
	<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=1 cellpadding=6 align=center bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<form action=User/login.asp method="post">
	<tr bgcolor=<%=DEF_BBS_LightColor%> height=25 class=TBBG1>
		<td height=20><table><tr><td>有效期: </td><td><Select name=CkiExp>
							<option value="-1">无效
							<option value="365">一年
							<option value=1>一天
							<option value=2>两天
							<option value=7>一周
							<option value=31>一月
						</select>
				<input name=submitflag type=hidden value="ddddls-+++">
				</td><td>用户名: </td><td><input name=user type=text maxlength=20 size=10 value="<%=htmlencode(GBL_CHK_user)%>" class=fminpt></td><td>
				密码: </td><td><input name=pass type=password maxlength=20 size=10 value="<%=htmlencode(GBL_CHK_pass)%>" class=fminpt>
				</td><td><input type=submit value="登录" class=fmbtn>
				</td><td>&nbsp; [<a href=User/UserGetPass.asp>忘记密码了</a>]
				 [<a href=User/UserJoin.asp>新用户注册</a>]
				</td></tr>
	</form></table>
		</td>
	</tr>
	</table><%If GBL_TableBottomString <> "" Then
			%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%
		End If%><br><%
	End If

End Function

Function GetActiveUserNumber

	If isNumeric(application(DEF_MasterCookies & "ActiveUsers")) = False Then
		Application.Lock
		application(DEF_MasterCookies & "ActiveUsers") = 0
		Application.UnLock
	End If
	GBL_OnlineUserNum = cCur(application(DEF_MasterCookies & "ActiveUsers"))
	Dim TmpData
	If isArray(application(DEF_MasterCookies & "StatisticData")) = False Then ReloadStatisticData
	TmpData = Application(DEF_MasterCookies & "StatisticData")
	GBL_OnlineTime = cCur(TmpData(0,0))
	GBL_UserCount = cCur(TmpData(1,0))
	GBL_MaxOnline = cCur(TmpData(2,0))
	GBL_MaxolTime = cCur(TmpData(3,0))
	GBL_PageCount = cCur(TmpData(4,0))
	GBL_UploadNum = cCur(TmpData(5,0))
	GBL_MaxAnnounce = cCur(TmpData(6,0))
	GBL_MaxAncTime = cCur(TmpData(7,0))
	GBL_YesterdayAnc = cCur(TmpData(8,0))
	If GBL_OnlineUserNum > GBL_MaxOnline Then
		Con.ExeCute("Update LeadBBS_SiteInfo Set MaxOnline=" & GBL_OnlineUserNum & ",MaxolTime=" & GetTimeValue(DEF_Now))
		UpdateStatisticDataInfo GBL_OnlineUserNum,2,0
		UpdateStatisticDataInfo GetTimeValue(DEF_Now),3,0
	End If

End Function

Function DisplayUserOnline(BoardID,url)

	Dim Time1
	Time1 = Timer
	Const LMT_Max_OnlineUserList = 2000
	Dim ActiveUsers
	ActiveUsers = 0
	If BoardID > 0 and isArray(Application(DEF_MasterCookies & "BoardInfo" & BoardID)) = True Then ActiveUsers = cCur(Application(DEF_MasterCookies & "BDOL" & BoardID))

	%>
<table width=100%>
<script language=javascript>
var n=1;
var rguser=0;

function s(GetData0,GetData1,GetData2)
{
	var tempstr = ""
	if(GetData0 == "")return;
	if(n==1)tempstr+="<tr>";
	tempstr+="<td>&nbsp;";
	if(GetData1 == null || trim(GetData1) == "")
	{
		tempstr+="<font color=#8888ff>※</font><a href=<%=Url%>User/LookUserMoreInfo.asp?OlID=" + GetData0 + ">游客</a></td>";
	}
	else
	{
		rguser+=1;
		if (GetData1 == "隐身会员")
		{
			tempstr+="<font color=gray class=GrayFont>※</font><a href=<%=Url%>User/LookUserMoreInfo.asp?OlID=" + GetData0 + ">隐身会员</a></td>";
		}
		else
		{
			if(parseInt(GetData2)&(1<<(10-1))){tempstr+="<font color=Red class=RedFont>●</font>";}
			else
			{
				if(parseInt(GetData2)&(1<<(14-1))){tempstr+="<font color=Green class=GreenFont>●</font>";}
				else
				{
					if(parseInt(GetData2)&(1<<(8-1))){tempstr+="<font color=Blue class=BlueFont>●</font>";}
					else
					{
						if(parseInt(GetData2)&(1<<(2-1))){tempstr+="<font color=Gray class=GrayFont>●</font>";}
						else{tempstr+="<font color=green class=GreenFont>※</font>";}
					}
				}
			}
			tempstr+="<a href='<%=Url%>User/LookUserInfo.asp?name=" + GetData1 + "'>" + GetData1 + "</a></td>";
		}
	}
	n+=1;
	if(n>7)
	{
		tempstr+="</tr>";
		n=1;
	}
	document.write(tempstr);
}
function trim(str)
{
	var re = /( )/gi;
	var rv = str.replace(re,"");
	return(rv);
}
<%
	Dim Temp
	Temp = 0
	If ActiveUsers < Num + 1 Then ActiveUsers = Num + 1
	
	Dim Rs,SQL
	If BoardID = 0 Then
		SQL = "select TOP " & LMT_Max_OnlineUserList & " ID,UserName,HiddenFlag from LeadBBS_onlineUser order by id"
	Else
		SQL = "select TOP " & LMT_Max_OnlineUserList & " ID,UserName,HiddenFlag from LeadBBS_onlineUser where AtBoardID=" & boardID &" and UserID>0"
	End If

	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	Dim Num
	Dim GetData
	If Not rs.Eof Then
		Response.Write "s("""
		Response.Write Rs.GetString(,,""",""",""");" & VbCrLf & "s(""","")
		'Response.Write Rs.GetString(,,""",",");" & VbCrLf & "s(""","")
		Response.Write ""","""",0);"
	Else
		Num = -1
	End If
	Rs.close
	Set Rs = Nothing
	closeDataBase

	If ActiveUsers < Num Then ActiveUsers = Num
	Temp = Num
	If isNumeric(application(DEF_MasterCookies & "ActiveUsers")) = 0 Then
		Application.Lock
		application(DEF_MasterCookies & "ActiveUsers") = 0
		Application.UnLock
	End If
	If application(DEF_MasterCookies & "ActiveUsers") < Temp Then
		Application.Lock
		application(DEF_MasterCookies & "ActiveUsers") = Temp
		Application.UnLock
	End If
	Response.Write "var online=" & cCur(application(DEF_MasterCookies & "ActiveUsers")) & ";" & VbCrLf & "if(online<rguser)online=rguser;" & VbCrLf
	Response.Write "document.write(""<tr><td colspan=7><img src=" & url & "images/null.gif width=2 height=4><br>&nbsp;目前论坛总共有 "" + online + "" 人在线。"
	If BoardID > 0 Then
		Response.Write "此版面共 " & ActiveUsers & " 人在线，"
		Response.Write "其中注册会员 "" + rguser + "" 人，游客 "" + (" & ActiveUsers & "-rguser) + "" 人 "
	Else
		Response.Write "其中注册会员 "" + rguser + "" 人，游客 "" + (online-rguser) + "" 人 "
	End If
	Response.Write "在线人员显示消耗时间" & fix(abs(CDBL(Timer)*1000 - Time1*1000)) & "毫秒"
	If BoardID = 0 Then Response.Write "<br><img src=" & url & "images/null.gif height=7 width=2><br>&nbsp;图例： <font color=#8888ff>※</font>游客 &nbsp; <font color=gray class=GrayFont>※</font>隐身会员 &nbsp; <font color=Red class=RedFont>●</font>总版主 &nbsp; <font color=Green class=GreenFont>●</font>区版主 &nbsp; <font color=Blue class=BlueFont>●</font>论坛版主 &nbsp; <font color=Gray class=GrayFont>●</font>认证会员 &nbsp; <font color=green class=GreenFont>※</font> 注册会员"
	Response.Write "</td></tr>"");"
%>
</script>
</table>
<%

End Function

Main

%>