<!-- #include file=../inc/BBSSetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->

<%
DEF_BBS_HomeUrl = "../"
GBL_CHK_PWdFlag = 0
initDatabase
Dim SQLEndString,DispString,dispno

Select Case Request.QueryString
	Case "1": 
		SQLEndString = " order by lastwritetime desc "
		DispString = "最后访问"
		dispno = 1
	Case "2": 
		SQLEndString =  " order by topicnum desc "
		DispString = "主题数量"
		dispno = 2
	Case "3": 
		SQLEndString =  " order by announcenum desc "
		DispString = "帖子总量"
		dispno = 3
	Case "4": 
		SQLEndString =  " order by goodnum desc "
		DispString = "精华总量"
		dispno = 4

	Case "5": 
		SQLEndString =  " order by todayannounce desc"
		DispString = "今日发帖"
		dispno = 5
	Case "7": 
		SQLEndString =  " and announcenum>0 and topicnum>0 order by announcenum/topicnum desc"
		DispString = "灌水度"
		dispno = 7
	Case Else: 
		SQLEndString =  " order by BoardAssort,OrderID ASC"
		DispString = "常规排行"
		dispno = 6
End Select

GBL_CHK_TempStr = ""
BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name & " 版面排行榜 - " & DispString,0," &gt;&gt; 版面排行榜 - " & DispString
UpdateOnlineUserAtInfo 0,"会员排行榜" & DispString

	If GBL_CHK_TempStr = "" Then
	%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td>
			<%DisplayboardTop%></td>
	</tr>
	</table><%
	Else
		%>
	<br>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td>
			<%=GBL_CHK_TempStr%></td>
	</tr>
	</table>
	<%
	End If


closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString



Function DisplayboardTop

	Dim Rs,SQL
	
	SQL = "select boardID,boardName,lastwritetime,topicnum,announcenum,goodnum,todayannounce,orderid From LeadBBS_Boards where HiddenFlag = 0 " & SQLEndString

	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Not rs.Eof Then%>
	<script language=javascript>
	var Number=1,i,t=1;
	function s(d0,d1,d2,d3,d4,d5,d6,d7)
	{
		if(d0==0)return;
		document.write("<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9 height=30>");
		document.write("<td height=20 align=center>" + t + "</td>");
		document.write("<td>&nbsp;<a href=../Board/Board.asp?BoardID=" + d0 + ">" + d1 + "</a></td>");
	        document.write("<td>&nbsp;" + d2.substr(0,4) + "-" + d2.substr(4,2) + "-" + d2.substr(6,2) + " " + d2.substr(8,2) + ":" + d2.substr(10,2) + ":" + d2.substr(12,2) +"</td>");
		document.write("<td>&nbsp;" + d3 + "</td>");
		document.write("<td>&nbsp;" + d4 + "</td>");
		if((d3-d4)<0){
			document.write("<td>&nbsp;<IMG SRC=../images/blueblock.gif title=灌水量：" + (d4-d3) + " WIDTH=" + (1-d3/d4)*100 + " HEIGHT=10  BORDER=0><IMG SRC=../images/greenblock.gif title=主题量：" + d3 + " WIDTH=" + (d3/d4)*100 + " HEIGHT=10  BORDER=0></td>");
		}
		else{
			document.write("<td>&nbsp;None</td>");
		}
		
		document.write("<td>&nbsp;" + d5 + "</td>");
		document.write("<td>&nbsp;" + d6 + "</td>");
		
		document.write("</tr>");
		t+=1;
	}
	</script>
	<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
	<tr bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1><td  height=30>
		<b><font color=ff0000 class=RedFont>论坛版面排行榜</font> - <%=DispString%></b>   （分类点击下面表头文字选择排行类型）
		</td>
	</tr>
	</table>
	<table width="100%" border="0" cellspacing="1" cellpadding="3">
                    <tr bgcolor=<%=DEF_BBS_LightDarkColor%> class=TBHead2 height=30 >
                    	<td align=center><b>排名</b></td>
                    	<td >&nbsp;<A HREF="List_board.asp?6"><FONT COLOR=<%if dispno=6 then Response.Write "red"%>><b>版面名称</b></FONT></A></td>
                    	<td >&nbsp;<A HREF="List_board.asp?1"><FONT COLOR=<%if dispno=1 then Response.Write "red"%>><b>最近关注</b></FONT></A></td>
                    	<td >&nbsp;<A HREF="List_board.asp?2"><FONT COLOR=<%if dispno=2 then Response.Write "red"%>><b>主题数量</b></FONT></A></td>
                    	<td >&nbsp;<A HREF="List_board.asp?3"><FONT COLOR=<%if dispno=3 then Response.Write "red"%>><b>帖子总量</b></FONT></A></td>
                    	<td >&nbsp;<A HREF="List_board.asp?7"><FONT COLOR=<%if dispno=7 then Response.Write "red"%>><b>灌水度</b></FONT>(回复量/主题量)</td>
                    	<td >&nbsp;<A HREF="List_board.asp?4"><FONT COLOR=<%if dispno=4 then Response.Write "red"%>><b>精华数量</b></FONT></A></td>
                    	<td >&nbsp;<A HREF="List_board.asp?5"><FONT COLOR=<%if dispno=5 then Response.Write "red"%>><b>新帖</b></FONT></A></td>
                    </tr><script language=javascript>
<%	
		Response.Write "" & VbCrLf & "s("""
		Response.Write Rs.GetString(,,""",""",""");" & VbCrLf & "s(""","")
		Rs.Close
		Set Rs = Nothing
		Response.Write ""","""","""","""");"
%></script>
       </table>
	<%
	Else
		Rs.close
		Set Rs = Nothing
		Response.Write "<br>		<TR><td><br><p>找不到会员。</td></tr>" & VbCrLf
	End If


End Function
%>
