<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%
 '=========================================================
' File: toplist.asp
' Version:3.0
' Date: 2005-10-29
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
response.buffer=true
dim orders,ordername,Starname,StarVip
dim stat,OnlineTime
dim Srs
orders=checkStr(trim(Request("orders")))
if Cint(GroupSetting(1))=0 then
	Errmsg=Errmsg+"<br>"+"<li>您没有浏览本交友中心会员资料的权限，请<a href=login.asp>登陆</a>或者同管理员联系。"
	founderr=true
end if
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有<a href=login.asp>登陆</a>，不能查看会员排行！"
	Founderr=true
end if
call nav()
if founderr then
	call head_var("","")
	call Mslove_error()
else
call tumppages()
	if not isInteger(orders) or orders="" then
		orders=1
	else
		orders=orders
	end if
strFileName="toplist.asp?orders="&orders&""
	select case orders
	case 1
		ordername="最新100男会员"
	case 2
		ordername="最新100女会员"
	case 3
		ordername="最新VIP认证会员"
	case 4
		ordername="最新上传照片男会员"
	case 5
		ordername="最新上传照片女会员"
	case 6
		ordername="最有魅力的男士"
	case 7
		ordername="最有魅力的靓女"
	case 8
		ordername="人气最旺的会员"
	case 9
		ordername="登录最多会员"
	case 10
		ordername="日记总数Top50"
	case 11
		ordername="Top50大富翁"
	case 12
		ordername="相册总数Top50"
	case 13
		ordername="等待VIP审批会员"
	case 14
		ordername="被锁定屏蔽会员"
	case 15
		ordername="管理团队"
	case 16
		ordername="新进会员Top100"	
	end select
	stats=ordername
	call head_var("会员排行","toplist.asp")
	call main()
end if
call footer()
call activeonline()
sub main()
dim UserNum,Uploadph,Marrynum,Partynum,UserArt,Userdiary
	sql="select UserNum,Uploadph,Marrynum,Partynum,UserArt,Userdiary from Ms_setup where Cid=1"
	set rs=conn.execute(sql)
	UserNum=rs(0)
	Uploadph=rs(1)
	Marrynum=rs(2)
	Partynum=rs(3)
	UserArt=rs(4)
	Userdiary=rs(5)
	rs.close
%>
<table width="100%" align=center cellpadding=1 cellspacing=1 class=tableborder1>
  <tr align="center"> 
      <th height="25" colspan=12><b><%=ordername%></b> </th>
    </tr>
    <tr> 
      <td colspan=12 class=tablebody1><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            
          <td width="81%" height="27">&nbsp;注册用户数：<font color="#ff0000"><%=usernum%></font> 人 &nbsp;文章：<font color="#0000FF"><%=UserArt%></font> 篇 &nbsp;相册：<font color="#0000FF"><%=Uploadph%></font> 张 &nbsp;日记：<font color="#0000FF"><%=Userdiary%></font> 篇 &nbsp;约会：<font color="#0000FF"><%=Partynum%></font> 篇 &nbsp;征婚：<font color="#0000FF"><%=Marrynum%></font> 篇</td>
          </tr>
        </table></td>
    </tr>
  <tr align="center"> 
    <td width="132" height="31" class=tablebody2>用户名</td>
    <td width="51" class=tablebody2>性别</td>
    <td width="53" class=tablebody2>年龄</td>
    <td width="61" class=tablebody2>相册</td>
    <td width="66" class=tablebody2>日记</td>
    <td width="63" class=tablebody2>文章</td>
    <td width="63" class=tablebody2>人气</td>
    <td width="71" class=tablebody2>当前状态</td>
    <td width="83" class=tablebody2>会员等级</td>
    <td width="277" class=tablebody2>对象操作</td>
  </tr>
  <%
	set rs=server.createobject("adodb.recordset")
	select case orders
	case 1
		sql="select top 100 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where usersex=1 order by joinDate desc"
	case 2
		sql="select top 100 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where usersex=0 order by joinDate desc"
	case 3
		sql="select userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where uservip>=2 order by joinDate desc"
	case 4
		sql="select top 50 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where UserPics>0 and usersex=1 order by joinDate desc"
	case 5
		sql="select top 50 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where UserPics>0 and usersex=0 order by joinDate desc"
	case 6
		sql="select top 50 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where usersex=1 order by UserEP desc,joinDate"		
	case 7
		sql="select top 50 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where usersex=0 order by UserEP desc,joinDate"
	case 8
		sql="select userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] order by UserViews desc,userid"
	case 9
		sql="select  userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] order by UserLogins desc,userid"
	case 10
		sql="select top 50 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] order by Userdiary desc,userid"
	case 11
		sql="select top 50 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] order by UserWealth desc,userid"
	case 12
		sql="select top 50  userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] order by UserPics desc,userid"
	case 13
		sql="select  userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where UserVip=1 order by userid desc"
	case 14
		sql="select  userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where LockUser>=1 order by userid desc"	
	case 15
		sql="select  userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] where UserGroupID<=3 order by userid desc"
	case 16
		sql="select top 100 userid,LockUser,Username,UserVip,Usersex,Userbirthday,UserPics,Userdiary,Userart,UserViews,userclass from [Ms_user] order by userid desc"		
	end select
	rs.open sql,conn,1
	if rs.eof and rs.bof then
		response.write "<tr><td colspan=10 class=tablebody1 align=center>还没有任何用户数据。</td></tr>"
	else
call rspages()
	do while not rs.eof and page_count<Cint(MaxPerPage)
	Starname=rs("Username")
	StarVip=rs("UserVip")
if Supermaster or master then
	set Srs=conn.execute("select stats,startime from Ms_online where userid="&rs("userid"))
	else
	set Srs=conn.execute("select stats,startime from Ms_online where userid="&rs("userid")&" and userhidden=2")
	end if
	if Srs.eof and Srs.bof then
	stat=""
	OnlineTime="[离线]"
	else
	stat="当前位置：["&Srs(0)&"]"
	OnlineTime="[在线：" & datediff("n",Srs(1),Now()) & "Mins]"
	end if
	Srs.close
	set Srs=nothing
%>
  <tr> 
    <td height="27" class=tablebody1>&nbsp;<a href=dispuser.asp?Username=<%=Starname%> target=_blank><%=Starname%></a><%if StarVip>1 then
	response.write("&nbsp;<img src=Skins/Default/vip.gif title=Vip会员>")
	end if
	if rs("LockUser")=1 then
		response.write "&nbsp;<img src=Skins/Default/userlock.gif title=锁定状态 align=absmiddle>"
	elseif rs("LockUser")=2 then
		response.write "&nbsp;<img src=Skins/Default/useroff.gif title=屏蔽状态 align=absmiddle>"
	end if%></td>
    <td height="27" align="center" class=tablebody1><%if rs("Usersex")=1 then
	response.Write("酷哥")
	else
	response.Write("靓女")
	end if%></td>
    <td height="27" align="center" class=tablebody1><%=datediff("yyyy",rs("Userbirthday"),Now())%></td>
    <td align=center class=tablebody1><%=rs("UserPics")%></td>
    <td align=center class=tablebody1><%=rs("Userdiary")%></td>
    <td align=center class=tablebody1><%=rs("Userart")%></td>
    <td align=center class=tablebody1><%=rs("UserViews")%></td>
    <td align=center class=tablebody1><%if stat<>"" then
	response.write("<img src=Skins/Default/online1.gif title="&stat&OnlineTime&">")
	else
	response.write("<img src=Skins/Default/offline1.gif title="&OnlineTime&">")
	end if%></td>
    <td align=center class=tablebody1><%=rs("userclass")%></td>
    <td align=center class=tablebody1><a href="javascript:openScript('messanger.asp?action=new&touser=<%=htmlencode(Starname)%>',500,400)">短信</a> 
      <font color="#FF0000">|</font> <a href="friendlist.asp?action=addF&myFriend=<%=HTMLEncode(Starname)%>" target=_blank>好友</a> 
      <font color="#FF0000">|</font> <a href="mylove.asp?action=marqa&Typeid=2&touser=<%=HTMLEncode(Starname)%>">求爱</a><font color="#FF0000"> 
      | </font><a href="mylove.asp?action=maradd&Typeid=1&touser=<%=HTMLEncode(Starname)%>">求婚</a><font color="#FF0000"> 
      |</font> <a href="userbook.asp?action=add&ClassID=2&Touser=<%=HTMLEncode(Starname)%>" target=_blank></a> 
      <a href="userbook.asp?action=add&ClassID=2&Touser=<%=HTMLEncode(Starname)%>" target=_blank>留言</a></td>
  </tr>
  <%page_count=page_count+1
	rs.movenext
	loop
	end if
%>
  <tr> 
    <td height="26" colspan="10" align=center class=tablebody2> 
      <%if totalrec>0 then
		  	call showpage(strFileName)
		  end if%> </td>
  </tr>
</table>
<%
	rs.close
	set rs=nothing
end sub
%>




