<% '========================================================= ' File: boardstat.asp ' Version:5.0 ' Date: 2002-9-12 ' Script Written by fssunwin,modify by satan '========================================================= ' Copyright (C) 2001,2002 AspSky.Net. All rights reserved. ' Web: http://www.aspsky.net,http://www.dvbbs.net ' Email: info@aspsky.net,eway@aspsky.net '========================================================= stats="论坛状态图例" dim bbsnums,topicnums,todaynums dim allbbsnums,alltopicnums,alltodaynums dim sinfo dim allnum dim td1,td2,td3 set rs=conn.execute("select TopicNum,BbsNum,TodayNum,UserNum from config where active=1") allbbsnums=rs("bbsnum") alltopicnums=rs("topicnum") alltodaynums=rs("todaynum") set rs=nothing if boardid<>"" and boardid<>0 then bbsnums=lastbbsnum topicnums=LastTopicNum todaynums=todaynum boardtype=boardtype else bbsnums=allbbsnums topicnums=alltopicnums todaynums=alltodaynums boardtype=Forum_info(0) end if td1="id=tdbg" td2="id=tdbg" td3="id=tdbg" if request("action")="lastbbsnum" then sinfo="lastbbsnum" allnum=allbbsnums stats="总帖数" td1="" elseif request("action")="lasttopicnum" then sinfo="lasttopicnum" allnum=alltopicnums stats="主题数" td2="" elseif request("reaction")<>"" then if boardid=0 then stats="论坛总在线" else stats=BoardType & "在线" end if else sinfo="todayNum" allnum=alltodaynums stats="今日帖数" td3="" end if call nav() if boardid=0 then call head_var(2,0,"","") else call head_var(1,BoardDepth,0,0) end if call stat_var() if request("reaction")="onlineinfo" then call onlinemain() elseif request("reaction")="onlineUserinfo" then call userinfo(BOARDID) elseif request("reaction")="online" then call onlineinfo() else call main(sinfo) end if call activeonline() call footer() sub main(SINFO) %> <% dim g,allrs dim wid g=1 set rs=server.createobject("adodb.recordset") sql="select "&SINFO&",boardid,BoardType from board order by "&SINFO&" desc" set rs=conn.execute(sql) if rs.eof and rs.bof then response.write "" else do while not rs.eof g=g+1 if g=11 then g=1 if allnum=0 then allnum=1 if cint(rs(0)/allnum)>1 then allrs=conn.execute("Select sum("&SINFO&") from board ") allnum=allrs(0) set allrs=nothing if isnull(allnum) then allnum=1 end if wid=Cint(replace(FormatPercent(rs(0)/allnum),"%",""))*5.1 response.write "" response.write "" response.write "" response.write "" response.write "" rs.MoveNext loop end if rs.close set rs=nothing response.write "
论坛名称 图形比例 <%=stats%>
  还没有任何数据。
"&rs(2)&""&rs(0)&"
" END SUB sub stat_var() %>
今日帖数图例 主题数图例 总帖数图例 在线图例 在线情况 用户组在线图例
<% if request("reaction")<>"" then if boardid>0 then response.write "当前论坛共有"&allonline()&"位用户在线,其中"&boardtype&"有"&online(boardid)&"位在线用户与"&guest(boardid)&"位客人" else response.write "当前论坛共有"&allonline()&"位用户在线" end if else %> 目前<%=boardtype%> 今日帖数:<%=todaynums%> 帖子总数: <%=bbsnums%> 主题总数:<%=topicnums%> <%end if%>

<% end sub sub onlinemain() dim guests,page_count,Pcount dim totalrec,endpage call activeonline() dim mysql dim onlinename if BoardID="" then mysql="select username,stats,browser,startime,ip,userhidden from online order by usergroupid" elseif not isInteger(BoardID) then mysql="select username,stats,browser,startime,ip,userhidden from online order by usergroupid" elseif boardid=0 then mysql="select username,stats,browser,startime,ip,userhidden from online order by usergroupid" else BoardID=clng(request("BoardID")) mysql="select username,stats,browser,startime,ip,userhidden from online where boardid="&boardid&" order by usergroupid" end if dim totalPages,currentPage currentPage=request.querystring("page") if currentpage="" or not isInteger(currentpage) then currentpage=1 else currentpage=clng(currentpage) end if response.write "" response.write " " response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" set rs=server.createobject("adodb.recordset") rs.open mysql,conn,1,1 if rs.eof and rs.bof then response.write "" else rs.AbsolutePage=currentpage page_count=0 totalrec=rs.recordcount while (not rs.eof) and (not page_count = Cint(Forum_Setting(11))) if rs("userhidden")=1 then if master or superboardmaster or trim(rs(0))=membername then onlinename=htmlencode(rs("username")) else onlinename="隐身会员" end if else onlinename=htmlencode(rs("username")) end if response.write " " response.write "" response.write "" response.write "" response.write "" response.write "" page_count = page_count + 1 rs.movenext wend end if response.write "
用户名当前位置用户信息来源鉴定登陆时间
  还没有任何用户数据。
"&onlinename&""&htmlencode(rs("stats"))&""&replace(usersysinfo(rs("browser"),2),"操作系统:","")&","&replace(replace(usersysinfo(rs("browser"),1),"浏 览 器:",""),"Internet Explorer","IE")&"" if Cint(GroupSetting(30))=1 then response.write ""&rs("ip")&"" else response.write "已设置保密" end if response.write ""&formatdatetime(rs("startime"),2)&" "&formatdatetime(rs("startime"),4)&"
" if totalrec mod Forum_Setting(11)=0 then Pcount= totalrec \ Forum_Setting(11) else Pcount= totalrec \ Forum_Setting(11)+1 end if response.write "" response.write "" response.write "
" response.write "页次:"¤tpage&"/"&Pcount&"页" response.write " 每页"&Forum_Setting(11)&" 总数"&totalrec&"分页:" if currentpage > 4 then response.write "[1] ..." end if if Pcount>currentpage+3 then endpage=currentpage+3 else endpage=Pcount end if for i=currentpage-3 to endpage if not i<1 then if i = clng(currentpage) then response.write " ["&i&"]" else response.write " ["&i&"]" end if end if next if currentpage+3 < Pcount then response.write "... ["&Pcount&"]" end if response.write "
" rs.close set rs=nothing end sub function INDEXonline() dim tmprs tmprs=conn.execute("Select count(id) from online WHERE boardid=0") INDEXonline=tmprs(0) set tmprs=nothing if isnull(INDEXonline) then INDEXonline=0 end function sub onlineinfo() %> <% dim rsinfo1,rsinfo2,sqlinfo,onlineNum dim bid dim tmprs dim g g=1 sqlinfo="select boardid,BoardType from board" set rsinfo1=conn.execute(sqlinfo) if rsinfo1.eof and rsinfo1.bof then response.write "" else do while not rsinfo1.eof bid=rsinfo1(0) set rsinfo2=conn.execute("Select Count(id) From online Where boardid="&bid&" ") onlineNum=rsinfo2(0) if isnull(onlineNum) then onlineNum=0 g=g+1 if g=11 then g=1 response.write "" response.write "" response.write "" response.write "" response.write "" rsinfo1.MoveNext loop end if set rsinfo1=nothing set rsinfo2=nothing response.write "
论坛名称 图形比例 在线人数
论坛其它位置 bar10.gif width="<%=Cint(replace(FormatPercent(INDEXonline()/allonline()),"%",""))*5.1%>" height=8> <%=INDEXonline()%>
  还没有任何用户数据。
"&rsinfo1(1)&""&onlineNum&"
" end sub sub userinfo(boardid) dim sfind if boardid<>"" and boardid<>0 then sfind=" boardid="&boardid&" and " else sfind="" end if %> <% dim trs,g,onlineNum g=1 set rs=conn.execute("select UserGroupID,title from UserGroups order by UserGroupID") do while not rs.eof set trs=conn.execute("select count(*) from online where UserGroupID="&rs(0)) onlineNum=trs(0) if isnull(onlineNum) then onlineNum=0 g=g+1 if g=11 then g=1 response.write "" response.write "" response.write "" response.write "" response.write "" rs.movenext loop set trs=nothing set rs=nothing %>
用户组别 图形比例 在线人数
"&rs(1)&""&onlineNum&"
<%END SUB%>