<!-- #include file="BBSsetup.asp" -->
<!-- #include file="Board_Popfun.asp" -->
<!-- #include file="Constellation.asp" -->
<!-- #include file="User_Setup.ASP" -->
<!--#include file="../Service/HomePageStar/HomePageStar.asp"-->
<%
sub new_user  '新进社员
     Dim Rs,SQL,con,username,rows,id
	 set con = Server.CreateObject("ADODB.Connection")
	 Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(DEF_BBS_HomeUrl & DEF_AccessDatabase)
	 con.open
	 SQL = "select TOP 8 ID,UserName from LeadBBS_User Order by ID DESC"
	 Set Rs = con.ExeCute(SQL)
	if rs.eof and rs.bof then
	response.write "暂时没有社员"
	else
	rows=0
	while not(rs.eof) and rows<8
	username=rs("username")
	id=rs("id")
	Response.Write "&nbsp;&nbsp;&nbsp;<a href=" & DEF_BBS_HomeUrl & "User/LookUserInfo.asp?id="&id&" target=_blank><span class=NavColor name=pubm id=pubm>"&username&"</a><br>"
    rows=rows+1
    rs.movenext
    wend
	end if
           Rs.Close
           Set Rs = Nothing
		   con.close
		   Set con = Nothing
End sub

Sub index_gg(num,text)  '首页公告
     Dim Rs,SQL,con,rows,title,Touser
	 set con = Server.CreateObject("ADODB.Connection")
	 Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(DEF_BBS_HomeUrl & DEF_AccessDatabase)
	 con.open
	 SQL = "select ID,Title,Touser,Content from LeadBBS_InfoBox Order by ID DESC"
	 Set Rs = con.ExeCute(SQL)
     if rs.eof and rs.bof then
	response.write "暂时没有公告"
	else
	rows=0
	while not(rs.eof) and rows < num
	ToUser=rs("Touser")
	IF ToUser="" Then
	title=left(rs("title"),""&text&"")
	Response.Write "<font face=Wingdings color=#FFAA39>w</font>&nbsp;<a href=" & DEF_BBS_HomeUrl & "User/LookMessage.asp#"&rows&" target=_blank><span class=NavColor name=pubm id=pubm>"&title&"</a><br>"
    rows=rows+1
	End if
    rs.movenext
    wend
	
	end if
	Rs.Close
    Set Rs = Nothing
	con.close
	Set con = Nothing
End Sub

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

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

Dim Blist,BoardNum
Blist = Application(DEF_MasterCookies & "BList")
Dim HomeUrl,PithFlag,Number,Hits
%>


<%
sub index_dy(BoardID,Hotflag,PithFlag,Hits,STime,Number,StrLen,NewWindow)   '帖子调用
	Dim ListNum
	
	DEF_BBS_HomeUrl = ""
OpenDatabase

	BoardID=""&BoardID&""
	Hotflag=""&Hotflag&""
	PithFlag=""&PithFlag&""
	Hits=""&Hits&""
	STime=""&STime&""
	Number=""&Number&""
	StrLen=""&StrLen&""
	NewWindow=""&NewWindow&""
	
	BoardID = Left(BoardID,14)
	ListNum = Left(Number,14)
	StrLen = Left(StrLen,14)
	If isNumeric(StrLen) = False or StrLen = "" Then StrLen = 20
	StrLen = Fix(cCur(StrLen))
	If isNumeric(ListNum) = False or ListNum = "" Then ListNum = 10
	If isNumeric(BoardID) = False Then BoardID = 0
	BoardID = Fix(cCur(BoardID))
	
	ListNum = Fix(cCur(ListNum)) 
	If ListNum < 1 or ListNum > 100 Then ListNum = 10
	If StrLen < 1 or StrLen > 255 Then StrLen = 255
	
	'--- By simeonz
	Dim TORA,POLL,NOWTIME
	TORA = ""&TORA&""
	POLL = ""&POLL&""
	
	If NewWindow <> "yes" Then
		NewWindow = ""
	Else
		NewWindow = " target=_blank"
	End If


	Select Case STime
	Case "" 
	Stime = 10
	Case 0 
	Stime = 0
	Case 1
	Stime = 16
	Case 2
	Stime = 10
	Case Else
	Stime = 10
	End Select


	If TORA <> "1" Then
		TORA = "LeadBBS_Announce"
	Else
		TORA = "LeadBBS_Topic"
	End If
   
    NOWTIME = CCUR(GetTimeValue(Now()))
	
	Dim Rs,SQL

	'--- 精华调用
	If PithFlag = "1" Then
		If BoardID = "0" Then
			IF POLL="1" then
			SQL = "select DISTINCT TOP " & ListNum & " TA.ID,TA.Title,TA.TitleStyle,TA.BoardID,TA.LastTime,TA.UserName,TA.hits from " &TORA & " AS TA INNER JOIN LeadBBS_VoteItem AS TB on TA.ID=TB.AnnounceID Where TA.GoodFlag=1 and TA.TopicType=80 and (TB.ExpiresTime=0 or TB.ExpiresTime>" & NOWTIME & ") and TA.Layer=1 Order by TA.ID DESC"
			Else
			SQL = "select TOP " & ListNum & " ID,Title,TitleStyle,BoardID,LastTime,UserName,hits from " &TORA& " Where GoodFlag=1 and Layer=1 Order by ID DESC"		  
			End if			
		Else
		  	IF POLL="1" then
			SQL = "select DISTINCT TOP " & ListNum & " TA.ID,TA.Title,TA.TitleStyle,TA.BoardID,TA.LastTime,TA.UserName,TA.hits from " &TORA & " AS TA INNER JOIN LeadBBS_VoteItem AS TB on TA.ID=TB.AnnounceID Where TA.BoardID=" & BoardID & " and TA.GoodFlag=1 and TA.TopicType=80 and (TB.ExpiresTime=0 or TB.ExpiresTime>" & NOWTIME & ") and TA.Layer=1 Order by TA.ID DESC"		  
          		Else
			SQL = "select TOP " & ListNum & " ID,Title,TitleStyle,BoardID,LastTime,UserName,hits from " &TORA& " Where GoodFlag=1 and BoardID=" & BoardID & " and Layer=1 Order by ID DESC"
		  	End if			
		End If
	
	'---- 热帖调用
	ElseIf  HotFlag = "1" Then
	
	Dim WTime,NTime,YTime,MTime
	'每日
	NTime = cCur(Left(GetTimeValue(DEF_Now),8) & "000000")

	'每周
	WTime = cCur(Left(GetTimeValue(DateAdd("d",0-WeekDay(DEF_Now,2),DEF_Now)),8) & "000000")

	'本年
	YTime = cCur(Left(GetTimeValue(DEF_Now),4) & "0000000000")

	'本月
	MTime = cCur(Left(GetTimeValue(DEF_Now),6) & "00000000")
	
		If BoardID = "0" Then
		    	If POLL="1" then
			  SQL = "select DISTINCT TOP " & ListNum & " TA.ID,TA.Title,TA.TitleStyle,TA.BoardID,TA.LastTime,TA.UserName,TA.hits from " &TORA & " AS TA INNER JOIN LeadBBS_VoteItem AS TB on TA.ID=TB.AnnounceID Where TA.TopicType=80 and (TB.ExpiresTime=0 or TB.ExpiresTime>" & NOWTIME & ") and NDateTime>=" & WTime & " and TA.Layer=1 Order by TA.hits DESC,TA.ID DESC"
			Else
			  SQL = "select TOP " & ListNum & " ID,Title,TitleStyle,BoardID,LastTime,UserName,hits from " &TORA & " Where BoardID<>444 and BoardID<>601 and BoardID<>602 and NDateTime>=" & WTime & " and Layer=1 Order by hits DESC,ID DESC"			
			End if
		Else
		select case ""&BoardID&""
		case 1
			boardID="100,101,102,103,104,105,106,107,108,109"
		case 2
			boardID="201,202,203,204,205"
		case 3
			boardID="301,302,303,304,305"
		case 4
			boardID="401,402,403"
		case 5
			boardID="501,502,503,504,505"
		case 6
			boardID="601,602,603"
		end select
		    	IF POLL="1" then
			  SQL = "select DISTINCT TOP " & ListNum & " TA.ID,TA.Title,TA.TitleStyle,TA.BoardID,TA.LastTime,TA.UserName,TA.hits from " &TORA & " AS TA INNER JOIN LeadBBS_VoteItem AS TB on TA.ID=TB.AnnounceID Where TA.BoardID IN("& BoardID &") and TA.TopicType=80 and (TB.ExpiresTime=0 or TB.ExpiresTime>" & NOWTIME & ") and NDateTime>=" & WTime & " and TA.Layer=1 Order by TA.hits DESC, TA.ID DESC"
            		Else
 			  SQL = "select TOP " & ListNum & " ID,Title,TitleStyle,BoardID,LastTime,UserName,hits from " &TORA& " Where BoardID IN("& BoardID &") and NDateTime>=" & WTime & " and Layer=1 Order by hits DESC,ID DESC"
			End if			  
		End If
	
	'--- 新帖调用
	Else
		If BoardID = "0" Then
		    	If POLL="1" then
			  SQL = "select DISTINCT TOP " & ListNum & " TA.ID,TA.Title,TA.TitleStyle,TA.BoardID,TA.LastTime,TA.UserName,TA.hits from " &TORA & " AS TA INNER JOIN LeadBBS_VoteItem AS TB on TA.ID=TB.AnnounceID Where TA.TopicType=80 and (TB.ExpiresTime=0 or TB.ExpiresTime>" & NOWTIME & ") and TA.Layer=1 Order by TA.ID DESC"
			Else
			  SQL = "select TOP " & ListNum & " ID,Title,TitleStyle,BoardID,LastTime,UserName,hits from " &TORA & " Order by ID DESC"			
			End if
		Else
		select case ""&BoardID&""
		case 1
			boardID="100,101,102,103,104,105,106,107,108,109"
		case 2
			boardID="201,202,203,204,205,206"
		case 3
			boardID="301,302,303,304,305"
		case 4
			boardID="401,402,403"
		case 5
			boardID="501,502,503,504,505"
		case 6
			boardID="601,602,603"
		end select
		    	IF POLL="1" then
			  SQL = "select DISTINCT TOP " & ListNum & " TA.ID,TA.Title,TA.TitleStyle,TA.BoardID,TA.LastTime,TA.UserName,TA.hits from " &TORA & " AS TA INNER JOIN LeadBBS_VoteItem AS TB on TA.ID=TB.AnnounceID Where TA.BoardID IN("& BoardID &") and TA.TopicType=80 and (TB.ExpiresTime=0 or TB.ExpiresTime>" & NOWTIME & ") and TA.Layer=1 Order by TA.ID DESC"
            		Else
 			  SQL = "select TOP " & ListNum & " ID,Title,TitleStyle,BoardID,LastTime,UserName,hits from " &TORA& " Where BoardID IN("& BoardID &") and Layer=1 Order by ID DESC"
			End if
		End If
	End if
	
	
	Set Rs = Con.ExeCute(SQL)
	Dim Num
	Dim GetData
	If Not rs.Eof Then
		GetData = Rs.GetRows(-1)
		Num = Ubound(GetData,2)
	Else
		Num = -1
		Response.Write "很遗憾！暂时没有！"
	End If
	Rs.close
	Set Rs = Nothing
	Response.Write "<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><table width=100% border=0 cellspacing=0 cellpadding=0>"
	For SQL = 0 to Num
		If GetData(2,SQL) = 1 Then GetData(1,SQL) = KillHTMLLabel(GetData(1,SQL))
		
		Dim FullTitle
		FullTitle = GetData(1,SQL)
		
		If Len(GetData(1,SQL)) > StrLen/2 Then
			If StrLength(GetData(1,SQL)) > StrLen Then
				GetData(1,SQL) = LeftTrue(GetData(1,SQL),StrLen - 3) & "..."
			End If
		End If
		
		dim sql2,rs2,BoardName,BoardID2
		'BoardID2="" & GetData(3,SQL) & ""
		'SQL2 = "select BoardID,BoardName from LeadBBS_Boards Where BoardID="&BoardID2&" Order by BoardID DESC"
		'Set Rs2 = Con.ExeCute(SQL2)
		'BoardName=rs2("BoardName")
		'Rs2.close
		'Set Rs2 = Nothing
		select case "" & GetData(3,SQL) & ""
		case 100
			BoardName="孝感城事"
		case 101
			BoardName="同城相约"
		case 102
			BoardName="朋友圈"
		case 103
			BoardName="论客杂谈"
		case 104
			BoardName="槐荫树旁"
		case 105
			BoardName="灌水专区"
		case 106
			BoardName="图文天下"
		case 107
			BoardName="文昌阁下"
		case 108
			BoardName="董永故里"
		case 109
			BoardName="预留版块"
		case 201
			BoardName="时尚馆"
		case 202
			BoardName="美食馆"
		case 203
			BoardName="文艺馆"
		case 204
			BoardName="医疗馆"
		case 205
			BoardName="展览馆"
		case 206
			BoardName="PC电脑馆"
		case 301
			BoardName="音乐潮流"
                case 302
			BoardName="动漫世界"
                case 303
			BoardName="家庭影院"
		case 304
			BoardName="游戏人间"
		case 305
			BoardName="笑话连篇"
		case 401
			BoardName="中学时代"
		case 402
			BoardName="我的大学"
		case 403
			BoardName="青涩校园"
		case 501
			BoardName="信息发布"
		case 502
			BoardName="城市资讯"
		case 503
			BoardName="市场供求"
		case 504
			BoardName="人才交流"
		case 505
			BoardName="广告专区"
		case 601
			BoardName="意见建议"
		case 602
			BoardName="社区事务"
		case 603
			BoardName="回收站"
		end select
				
		Response.Write "<tr><td width='68%'><font face=Wingdings color=#FFAA39>w</font>&nbsp;<a href=announce/announce.asp?BoardID=" & GetData(3,SQL) & "&id=" & GetData(0,SQL) & NewWindow &_
		               " title=' 主题：" & FullTitle & " 作者：" &Replace(htmlencode(GetData(5,SQL)),"\","\\") & "&nbsp;" &Left(Replace(htmlencode(RestoreTime(GetData(4,SQL))),"\","\\"),20) & " (Hits:" & GetData(6,SQL) &")'>" &_
		               Replace(htmlencode(GetData(1,SQL)),"\","\\") & "</a></td><td align=center width='32%'>&nbsp;&nbsp;<a href=Board/Board.asp?BoardID=" & GetData(3,SQL) & "><font color=#7D7D7D>["&BoardName&"]</font></a></td>" 
		'Response.write "<td><font color=gray><i>" & Left(Replace(htmlencode(RestoreTime(GetData(4,SQL))),"\","\\"),STime) & "</i></font></td>"
				
			Dim Temp
			Temp = htmlencode(RestoreTime(GetData(4,SQL)))
			If DateDiff("d",Temp,now)<1 Then 
			Response.write "<td><font color=red><i>" & Left(Replace(htmlencode(RestoreTime(GetData(4,SQL))),"\","\\"),STime) & "</i></font></td>"
			Else
			Response.write "<td><font color=gray><i>" & Left(Replace(htmlencode(RestoreTime(GetData(4,SQL))),"\","\\"),STime) & "</i></font></td>"
			End if
		
		If Hits = "0" Then  
		Response.Write "<tr>"             
		Else
		Response.write "<td>(hits:<font color=red>" & GetData(6,SQL) & "</font>)</td></tr>"
		End if
		               
		'Response.Write "<TR><TD colspan='4' background=" &HomeUrl& "other/article/vdot.gif height=1><img src=" &HomeUrl& "other/article/vdot.gif height=1 width=1></TD><TR>"					   
	Next
	Response.Write "</table></td></tr></table>"

closeDataBase
End Sub

Function DisplayOfficerString(Officer)   '社员荣誉判断

	Dim Officer_Temp,Temp_N,dotFlag
	dotFlag = 0
	Officer_Temp = split(Officer,",")
	For Temp_N = 0 to Ubound(Officer_Temp,1)
		If isNumeric(Officer_Temp(Temp_N)) Then
			Officer_Temp(Temp_N) = cCur(Officer_Temp(Temp_N))
			If Officer_Temp(Temp_N)>=0 and Officer_Temp(Temp_N)<=DEF_UserOfficerNum Then
				If dotFlag = 0 Then
					dotFlag = 1
					DisplayOfficerString = DisplayOfficerString & DEF_UserOfficerString(Officer_Temp(Temp_N))
				Else
					DisplayOfficerString = DisplayOfficerString & "," & DEF_UserOfficerString(Officer_Temp(Temp_N))
				End If
			End If
		End If
	Next
End Function

Function GetActiveUserNumber  '社员部分相关信息获取
OpenDatabase

	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))
				'GBL_TopicNum = GBL_TopicNum + cCur(TmpData(29,0))
			'GBL_AnnounceNum = GBL_AnnounceNum + cCur(TmpData(30,0))
			'GBL_GoodNum = GBL_GoodNum + cCur(TmpData(32,0))
			'GBL_TodayAnnounce = GBL_TodayAnnounce + cCur(TmpData(31,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

closeDataBase
End Function

Sub Index_info   '社区信息
	GBL_TodayAnnounce=0
	GBL_AnnounceNum=0
     Dim Rs,SQL,con,username,rows,id
	 set con = Server.CreateObject("ADODB.Connection")
	 Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(DEF_BBS_HomeUrl & DEF_AccessDatabase)
	 con.open
	 SQL = "select BoardID,TodayAnnounce,AnnounceNum from LeadBBS_Boards"
	 Set Rs = con.ExeCute(SQL)
	if rs.eof and rs.bof then
	GBL_TodayAnnounce=0
	else
	rows=0
	while not(rs.eof) and rows<30
	GBL_TodayAnnounce=GBL_TodayAnnounce+rs("TodayAnnounce")
	GBL_AnnounceNum=GBL_AnnounceNum+rs("AnnounceNum")
    rows=rows+1
    rs.movenext
    wend
	end if
           Rs.Close
           Set Rs = Nothing
		   con.close
		   Set con = Nothing


GetActiveUserNumber
Dim Temp,GetData,LMT_SimpleHomePage

Response.Write "在&nbsp;&nbsp;线："
call UserOnline(0,"")
	
	Response.Write "社&nbsp;&nbsp;员：" & GBL_UserCount & "<br>"
	Response.Write "总帖量：" & GBL_AnnounceNum & "<br>"
	'Response.Write "主题帖子：" & GBL_TopicNum & "<br>"
	'Response.Write "回复帖子：" & (GBL_AnnounceNum-GBL_TopicNum) & "<br>"
	Response.Write "今日帖：" & GBL_TodayAnnounce & "<br>"
	Response.Write "昨日帖：" & GBL_YesterdayAnc & "<br>"
	'Response.Write "精华帖子：" & GBL_GoodNum & " 帖<br>"
	'If BoardNum<0 Then BoardNum=0 end if
	'Response.Write "可见版面：" & BoardNum+1 & " 个<br>"
	'Response.Write "</td><td>"
	'Response.Write "总 在 线："
	'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 "附件：" & GBL_UploadNum & "<br>"
	'Response.Write "浏览量：" & GBL_PageCount+application(DEF_MasterCookies & "SitePageCount") & "<br>"
	'Response.Write "</td></tr><tr><td colspan=2 align=left>"
	Response.Write "最高在线数 " & GBL_MaxOnline & " 人<br>"
	Response.Write "最高日发帖 " & GBL_MaxAnnounce & " 帖"

End Sub

Sub UserOnline(BoardID,url)  '社员在线
OpenDatabase
	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))

	%>
<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

	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(""""+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 "<br>"");"
%>
</script>
<%
closeDataBase
End Sub

Sub Index_BoardsTop(Assort)  '版块帖子排行
     Dim Rs,SQL,con,username,rows,id,BoardID,BoardName,TopicNum_All,AnnounceNum_All
	 set con = Server.CreateObject("ADODB.Connection")
	 Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(DEF_BBS_HomeUrl & DEF_AccessDatabase)
	 con.open
	 if assort <> 0 then
	 SQL = "select BoardID,BoardAssort,BoardName,TopicNum_All,AnnounceNum_All from LeadBBS_Boards where BoardAssort="&Assort&" and BoardID<>444 Order by AnnounceNum_All DESC"
	 else
	 SQL = "select BoardID,BoardAssort,BoardName,TopicNum_All,AnnounceNum_All from LeadBBS_Boards where BoardID<>444 Order by AnnounceNum_All DESC"
	 end if
	 Set Rs = con.ExeCute(SQL)
	if rs.eof and rs.bof then
	response.write "<br><p align='center'>暂时没有排行</p>"
	else
	rows=0
	Response.Write "<table border='0' cellspacing='0' cellpadding='0' width='85%' align='center'>"
	Response.Write "<tr><td width='50%' align='left'><strong>&nbsp;&nbsp;名&nbsp;&nbsp;称</strong></td><td width='25%' align='center'><strong>主题</strong></td><td width='25%' align='center'><strong>总量</strong></td></tr>"
	while not(rs.eof) and rows<8
	BoardName=rs("BoardName")
	BoardID=rs("BoardID")
	TopicNum_All=rs("TopicNum_All")
	AnnounceNum_All=rs("AnnounceNum_All")
	Response.Write "<tr><td align='left'><a href=" & DEF_BBS_HomeUrl & "Board/Board.asp?BoardID="&BoardID&" target=_blank><span class=NavColor name=pubm id=pubm>"&BoardName&"</a></td><td align='center'>"&TopicNum_All&"</td><td align='center'>"&AnnounceNum_All&"</td></tr>"
    rows=rows+1
    rs.movenext
    wend
	Response.Write "</table>"
	end if
           Rs.Close
           Set Rs = Nothing
		   con.close
		   Set con = Nothing
End sub
%>