<!--#include file="conn.asp"-->
<% 
    dim rs,sql,TopicNum,BbsNum,TodayNum,UserNum,lastUser,tmprs
    dim n
    if request("orders")=1 then
       call tongji()
    elseif request("orders")=2 then
       call topuser()
    else
       call tongji()
       end if



function online() 
     tmprs=conn.execute("Select count(id) from online")  
     online=tmprs(0)  
 set tmprs=nothing  
 if isnull(online) then online=0 
end function
  
function gettipnum()  
dim tmprs  
    tmprs=conn.execute("Select Count(announceID) from bbs1")  
    gettipnum=tmprs(0)  
 set tmprs=nothing  
 if isnull(gettipnum) then gettipnum=0  
end function  
            
function allusers()  
dim tmprs  
    tmprs=conn.execute("Select count(userid) from [user]")  
    allusers=tmprs(0)  
 set tmprs=nothing  
 if isnull(allusers) then allusers=0  
end function

 sub tongji()
   n=request("n")
   

sql="select top 1 TopicNum,BbsNum,TodayNum,UserNum,lastUser from config"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,1
        topicnum=rs(0)
        BbsNum=rs(1)
        TodayNum=rs(2)
        UserNum=rs(3)
        lastUser=rs(4)
       rs.close
   set rs=nothing
%> 
 document.write('贴数 <font color=green><%=gettipnum()%></font><br>会员 <font color=green><%=allusers()%></font><br>在线 <font color=red><%=online()%></font><br>主题 <font color=green><%=topicnum%></font><br>今帖 <font color=red><%=TodayNum%></font><br>新注 <font color=red><%=lastUser%></font>')


<% end sub
sub topuser()
	set rs=server.createobject("adodb.recordset")
	sql="select top "&request("n")&" username,useremail,userclass,oicq,homepage,article,addDate  from [user] order by article desc"
	rs.open sql,conn,1,1
	do while Not RS.Eof

	response.write "document.write('<FONT color=#b70000>□</FONT><span style=""font-size:9pt;line-height: 15pt""><a href=dispuser.asp?name="& rs(0) &" target=_blank title=查看"&rs(0)&"的个人资料>');"
        response.write "document.write('"&rs(0)&"</a>');"
	response.write "document.write('</span><br>');"

	rs.MoveNext
	Loop
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing

end sub
%>