<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="bbstop.asp"-->
<%	dim orders,ordername
	if request("orders")="" then
		orders=1
		ordername="发贴总数Top10"
	elseif request("orders")=1 then
		orders=1
		ordername="发贴总数Top10"
	elseif request("orders")=2 then
		orders=2
		ordername="最新用户注册"
	elseif not isInteger(request("orders")) then
		orders=1
		ordername="发贴总数Top10"
	else
		orders=1
		ordername="发贴总数Top10"
	end if
%>
<table width=762 bgcolor=#efefef cellspacing=0 border=0 align=center class=pian>
<tr><td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
    <tr bgcolor=#f9f9f9><td colspan=5 valign=top width=350>&nbsp;>> <B><%=ordername%></B> <<<BR><BR>
    &nbsp;总注册用户数： <%=allusers()%> 人 &nbsp; 发贴总数： <%=gettipnum()%> 篇</td>
    <td colspan=5 align=right>
<form method="POST" action="toplist.asp">
            <select name=orders>
            <option value=1>发贴总数Top10</option>
            <option value=2>最新注册用户</option>
            </select>
    <input type=submit value="排 序">
</td></form></tr>
	<tr bgcolor=#ffcc00>
		<td align=center><b>用户名</font></b></td>
		<td align=center><b>Email</font></b></td>
		<td align=center><b>OICQ</font></b></td>
		<td align=center><b>主页</font></b></td>
		<td align=center><b>短消息</font></td>
		<td align=center><b>注册时间</font></b></td>
		<td align=center><b>等级状态</font></b></td>
		<td align=center><b>发贴总数</font></b></td>
	</tr>
<%
	dim rs,sql
	set rs=server.createobject("adodb.recordset")
	if orders=1 then
		sql="select top 10 huiyuan,mail,userclass,oicq,homepage,article,sj from [huiyuan] order by article desc"
	elseif orders=2 then
		sql="select top 10 huiyuan,mail,userclass,oicq,homepage,article,sj from [huiyuan] order by sj desc"
	else
		sql="select top 10 huiyuan,mail,userclass,oicq,homepage,article,sj from [huiyuan] order by article desc"
	end if
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
%>
	<tr bgcolor=#ffffff>
		<td align=center>还没有任何用户数据。</td>
	</tr>

<%
	else
		do while not rs.eof
%>
	<tr bgcolor=#ffffff>
		<td>&nbsp;<a href='dispuser.asp?name=<%=htmlencode(rs("huiyuan"))%>' target=_blank><%=htmlencode(rs("huiyuan"))%></a></td>
		<td align=center><a href=mailto:<%=rs("mail")%>><img border=0 src=images/email.gif></a></td>
		<td align=center>
<%if trim(rs("oicq"))="" or isnull(trim(rs("oicq"))) then%>
没有
<%else%>
<a href=http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=rs("oicq")%> target=_blank><img src="images/oicq.gif" alt="查看 OICQ:<%=rs("oicq")%> 的资料" border=0 width=16 height=16></a>
<%end if%>
		</td>
		<td align=center>
<%if trim(rs("homepage"))="" or isnull(trim(rs("homepage"))) then%>
没有
<%else%>
<a href='<%=rs("homepage")%>' target=_blank><img border=0 src=images/homepage.gif></a>
<%end if%>
		</td>
		<td align=center><a href='messanger.asp?action=new&touser=<%=htmlencode(rs("huiyuan"))%>' target=_blank><img src=images/message.gif border=0></a></td>
		<td align=center><%=rs("sj")%></td>
		<td align=center>
<%=rs("userclass")%><br>
<%
	if rs("userclass")=user_level1 then response.write "<img src=images/"&level1_pic&">"
	if rs("userclass")=user_level2 then response.write "<img src=images/"&level2_pic&">"
	if rs("userclass")=user_level3 then response.write "<img src=images/"&level3_pic&">"
	if rs("userclass")=user_level4 then response.write "<img src=images/"&level4_pic&">"
	if rs("userclass")=user_level5 then response.write "<img src=images/"&level5_pic&">"
	if rs("userclass")=user_level6 then response.write "<img src=images/"&level6_pic&">"
	if rs("userclass")=user_level7 then response.write "<img src=images/"&level7_pic&">"
	if rs("userclass")=user_level8 then response.write "<img src=images/"&level8_pic&">"
	if rs("userclass")=user_level9 then response.write "<img src=images/"&level9_pic&">"
%>
		</td>
		<td align=center><%=rs("article")%></td>
</tr>
<%
		rs.movenext
		loop
	end if
	rs.close
	set rs=nothing
function allusers() 
    	tmprs=conn.execute("Select count(id) from [huiyuan]") 
    	allusers=tmprs(0) 
	set tmprs=nothing 
	if isnull(allusers) then allusers=0 
end function 
function gettipnum() 
    	tmprs=conn.execute("Select Count(announceID) from bbs_content") 
    	gettipnum=tmprs(0) 
	set tmprs=nothing 
	if isnull(gettipnum) then gettipnum=0 
end function 
%>
</table></td></tr>
</table>
<!-- #include file="bbsend.asp" -->