<!-- #include file=../inc/BBSSetup.asp -->
<!-- #include file=../inc/User_Setup.ASP -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=inc/UserTopic.asp -->
<%
DEF_BBS_HomeUrl = "../"
GBL_CHK_PWdFlag = 0
initDatabase
SiteHead(DEF_SiteNameString & " - 会员会员区")
UpdateOnlineUserAtInfo GBL_board_ID,"会员排行榜"

UserTopicTopInfo
DisplayUserNavigate("会员排行榜")%>
<p><img src=<%=DEF_BBS_HomeUrl & "images/" & GBL_DefineImage%>splt.gif align=absmiddle width=7 height=15>
<a href=UserTop.asp?1>积分排行榜</a>
<img src=<%=DEF_BBS_HomeUrl & "images/" & GBL_DefineImage%>splt.gif align=absmiddle width=7 height=15>
<a href=UserTop.asp?2>存款排行榜</a>
<img src=<%=DEF_BBS_HomeUrl & "images/" & GBL_DefineImage%>splt.gif align=absmiddle width=7 height=15>
<a href=UserTop.asp?3>经验排行榜</a>
<img src=<%=DEF_BBS_HomeUrl & "images/" & GBL_DefineImage%>splt.gif align=absmiddle width=7 height=15>
<a href=UserTop.asp?4>灌水排行榜</a>
<img src=<%=DEF_BBS_HomeUrl & "images/" & GBL_DefineImage%>splt.gif align=absmiddle width=7 height=15>
<a href=UserTop.asp?5>新入会员</a>
<img src=<%=DEF_BBS_HomeUrl & "images/" & GBL_DefineImage%>splt.gif align=absmiddle width=7 height=15>
<%
Select Case Request.QueryString
	Case "1": DisplayUserPointsTop(DEF_MaxListNum)
	Case "2": DisplayUserSavePointsTop(DEF_MaxListNum)
	Case "3": DisplayUserOnlineTimeTop(DEF_MaxListNum)
	Case "4": DisplayUserAncTop(DEF_MaxListNum)
	Case "5": DisplayUserNewest(DEF_MaxListNum)
	Case Else: DisplayUserPointsTop(DEF_MaxListNum)
End Select
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function DisplayUserPointsTop(Numer)

	Dim Rs,SQL
	
	Rem Order by Points跟Order by LeadBBS_User.Points是不一样的(特指Access中),可恶的Access经常会将points为0的排到最前面
	Rem 还有,加上一个Where判断,可能有让Access重辨索引的效果
	SQL = "select TOP " & Numer & " LeadBBS_User.ID,LeadBBS_User.UserName,LeadBBS_User.Points,LeadBBS_User.ApplyTime,LeadBBS_User.Lastdoingtime,LeadBBS_User.UserLevel from LeadBBS_User where LeadBBS_User.Points > 0 Order by LeadBBS_User.Points DESC"

	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Not rs.Eof Then%>
	<script language=javascript>
	var Number=1,i,t=1;
	var DEF_UserLevelString=new Array(<%
		Response.Write """" & DEF_UserLevelString(0) & """"
		for SQL = 1 to DEF_UserLevelNum
			Response.Write ",""" & DEF_UserLevelString(SQL) & """"
		Next
	%>);
	function s(d0,d1,d2,d4,d5,d6)
	{
		if(d0=="")return;
		document.write("<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9");
		document.write("><td height=20>" + t + "</td><td><a href=LookUserInfo.asp?id=" + d0 + ">" + d1 + "</a></td><td>" + d2 + "</td>");
        document.write("<td>" + d4.substr(0,4) + "-" + d4.substr(4,2) + "-" + d4.substr(6,2) + "</td>");
		document.write("<td>" + d5.substr(0,4) + "-" + d5.substr(4,2) + "-" + d5.substr(6,2) + "</td>");
		document.write("<td>" + DEF_UserLevelString[parseInt(d6)] + "</td></tr>");
		t+=1;
	}
	</script>
	<p align=center><b><font color=ff0000 class=RedFont>会员<%=DEF_PointsName%>排行榜</font></b></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="5" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
                    <tr bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
                    	<td width=8%><b>排名</b></td>
                    	<td width=30%><b>名称</b></td>
                    	<td width=15%><b><%=DEF_PointsName%></b></td>
                    	<td width=15%><b>注册时间</b></td>
                    	<td width=15%><b>最近光临</b></td>
                    	<td width=17%><b>等级身份</b></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

Function DisplayUserSavePointsTop(Numer)

	Dim Rs,SQL
	
	Rem Order by Points跟Order by LeadBBS_User.Points是不一样的(特指Access中),可恶的Access经常会将points为0的排到最前面
	Rem 还有,加上一个Where判断,可能有让Access重辨索引的效果
	SQL = "select TOP " & Numer & " LeadBBS_User.ID,LeadBBS_User.UserName,LeadBBS_User.SavePoints,LeadBBS_User.ApplyTime,LeadBBS_User.Lastdoingtime,LeadBBS_User.UserLevel from LeadBBS_User where LeadBBS_User.SavePoints > 0 Order by LeadBBS_User.SavePoints DESC"

	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Not rs.Eof Then%>
	<script language=javascript>
	var Number=1,i,t=1;
	var DEF_UserLevelString=new Array(<%
		Response.Write """" & DEF_UserLevelString(0) & """"
		for SQL = 1 to DEF_UserLevelNum
			Response.Write ",""" & DEF_UserLevelString(SQL) & """"
		Next
	%>);
	function s(d0,d1,d2,d4,d5,d6)
	{
		if(d0=="")return;
		document.write("<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9");
		document.write("><td height=20>" + t + "</td><td><a href=LookUserInfo.asp?id=" + d0 + ">" + d1 + "</a></td><td>" + d2 + "</td>");
        document.write("<td>" + d4.substr(0,4) + "-" + d4.substr(4,2) + "-" + d4.substr(6,2) + "</td>");
		document.write("<td>" + d5.substr(0,4) + "-" + d5.substr(4,2) + "-" + d5.substr(6,2) + "</td>");
		document.write("<td>" + DEF_UserLevelString[parseInt(d6)] + "</td></tr>");
		t+=1;
	}
	</script>
	<p align=center><b><font color=ff0000 class=RedFont>会员<%=DEF_PointsName%>存款排行榜</font></b></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="5" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
                    <tr bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
                    	<td width=8%><b>排名</b></td>
                    	<td width=30%><b>名称</b></td>
                    	<td width=15%><b><%=DEF_PointsName%></b></td>
                    	<td width=15%><b>注册时间</b></td>
                    	<td width=15%><b>最近光临</b></td>
                    	<td width=17%><b>等级身份</b></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

Function DisplayUserOnlineTimeTop(Numer)

	Dim Rs,SQL
	SQL = "select TOP " & Numer & " LeadBBS_User.ID,LeadBBS_User.UserName,LeadBBS_User.OnlineTime,LeadBBS_User.ApplyTime,LeadBBS_User.Lastdoingtime,LeadBBS_User.UserLevel from LeadBBS_User where LeadBBS_User.OnlineTime > 0 Order by LeadBBS_User.OnlineTime DESC"
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	Dim Num
	Dim GetData
	If Not rs.Eof Then%>
	<script language=javascript>
	var Number=1,i,t=1;
	var DEF_UserLevelString=new Array(<%
		Response.Write """" & DEF_UserLevelString(0) & """"
		for SQL = 1 to DEF_UserLevelNum
			Response.Write ",""" & DEF_UserLevelString(SQL) & """"
		Next
	%>);
	function s(d0,d1,d2,d4,d5,d6)
	{
		if(d0=="")return;
		document.write("<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9");
		document.write("><td height=20>" + t + "</td><td><a href=LookUserInfo.asp?id=" + d0 + ">" + d1 + "</a></td><td>" + parseInt(d2/60) + "</td>");
        document.write("<td>" + d4.substr(0,4) + "-" + d4.substr(4,2) + "-" + d4.substr(6,2) + "</td>");
		document.write("<td>" + d5.substr(0,4) + "-" + d5.substr(4,2) + "-" + d5.substr(6,2) + "</td>");
		document.write("<td>" + DEF_UserLevelString[parseInt(d6)] + "</td></tr>");
		t+=1;
	}
	</script>
	<p align=center><b><font color=ff0000 class=RedFont>会员经验排行榜</font></b></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="5" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
                    <tr bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
                    	<td width=8%><b>排名</b></td>
                    	<td width=30%><b>名称</b></td>
                    	<td width=15%><b>经验</b></td>
                    	<td width=15%><b>注册时间</b></td>
                    	<td width=15%><b>最近光临</b></td>
                    	<td width=17%><b>等级身份</b></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

Function DisplayUserAncTop(Numer)

	Dim Rs,SQL
	
	SQL = "select TOP " & Numer & " LeadBBS_User.ID,LeadBBS_User.UserName,LeadBBS_User.AnnounceNum,LeadBBS_User.ApplyTime,LeadBBS_User.Lastdoingtime,LeadBBS_User.UserLevel from LeadBBS_User where LeadBBS_User.AnnounceNum > 0 Order by LeadBBS_User.AnnounceNum DESC"

	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Not rs.Eof Then%>
	<script language=javascript>
	var Number=1,i,t=1;
	var DEF_UserLevelString=new Array(<%
		Response.Write """" & DEF_UserLevelString(0) & """"
		for SQL = 1 to DEF_UserLevelNum
			Response.Write ",""" & DEF_UserLevelString(SQL) & """"
		Next
	%>);
	function s(d0,d1,d2,d4,d5,d6)
	{
		if(d0=="")return;
		document.write("<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9");
		document.write("><td height=20>" + t + "</td><td><a href=LookUserInfo.asp?id=" + d0 + ">" + d1 + "</a></td><td>" + d2 + "</td>");
        document.write("<td>" + d4.substr(0,4) + "-" + d4.substr(4,2) + "-" + d4.substr(6,2) + "</td>");
		document.write("<td>" + d5.substr(0,4) + "-" + d5.substr(4,2) + "-" + d5.substr(6,2) + "</td>");
		document.write("<td>" + DEF_UserLevelString[parseInt(d6)] + "</td></tr>");t+=1;
	}
	</script>
	<p align=center><b><font color=ff0000 class=RedFont>会员灌水排行榜</font></b></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="5" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
                    <tr bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
                    	<td width=8%><b>排名</b></td>
                    	<td width=30%><b>名称</b></td>
                    	<td width=15%><b>发帖</b></td>
                    	<td width=15%><b>注册时间</b></td>
                    	<td width=15%><b>最近光临</b></td>
                    	<td width=17%><b>等级身份</b></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

Function DisplayUserNewest(Numer)

	Dim Rs,SQL
	SQL = "select TOP " & Numer & " ID,UserName,Points,OnlineTime,ApplyTime,Prevtime from LeadBBS_User Order by ID DESC"
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	Dim Num
	If Not rs.Eof Then	
	%>
	<script language=javascript>
	function s(d0,d1,d2,d3,d4,d5)
	{
		if(d0=="")return;
		document.write("<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9");
		document.write("><td height=20>" + d0 + "</td><td><a href=LookUserInfo.asp?id=" + d0 + ">" + d1 + "</a></td><td>" + d2 + "</td>");
		document.write("<td>" + parseInt(parseInt(d3)/60) + "</td>");
        document.write("<td>" + d4.substr(0,4) + "-" + d4.substr(4,2) + "-" + d4.substr(6,2) + "</td>");
		document.write("<td>" + d5.substr(0,4) + "-" + d5.substr(4,2) + "-" + d5.substr(6,2) + "</td></tr>");
	}
	</script>
	<p align=center><b><font color=ff0000 class=RedFont>论坛最新注册会员</font></b></p>
	<table width="100%" border="0" cellspacing="1" cellpadding="5" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
		<tr bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
			<td width=8%><b>编号</b></td>
			<td width=30%><b>名称</b></td>
			<td width=15%><b><%=DEF_PointsName%></b></td>
			<td width=15%><b>经验</b></td>
			<td width=15%><b>注册时间</b></td>
			<td width=17%><b>最后登录</b></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%>