📄 online.asp
字号:
<!-- #include file="Setup.asp" -->
<%
top
count=Conn.execute("Select count(sessionid)from [BBSXP_UsersOnline]")(0)
regOnline=Conn.execute("Select count(sessionid)from [BBSXP_UsersOnline] where UserName<>''")(0)
ForumThreads=Conn.execute("Select SUM(ForumThreads)from [BBSXP_Forums]")(0)
tolReTopic=Conn.execute("Select SUM(ForumPosts)from [BBSXP_Forums]")(0)
%>
<table border=0 width=100% align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25> <img src=images/Forum_nav.gif> <%ClubTree%> → 查看论坛状态</td>
</tr>
</table><br>
<TABLE cellspacing="1" cellpadding="4" width="100%" align="center" border="0" class="a2">
<TR class="a1" id=TableTitleLink>
<Td width="16%" align="center" height="10"><b><font color="FFFFFF"><a href="Online.asp">
在线情况</a></font></TH> </b>
<TD width="16%" align="center" height="10"><b><font color="FFFFFF"> <a href="Online.asp?menu=cutline">在线图例</TH>
</a> </font> </b>
<TD width="16%" align="center" height="10">
<b>
<a href="Online.asp?menu=UserSex">性别图例</a></b><TD width="16%" align="center" height="10">
<b><a href="Online.asp?menu=TodayPage">今日图例</a></b><TD width="16%" align="center" height="10"><b><font color="FFFFFF"><a href="Online.asp?menu=board">
主题图例</a></font></TH> </b>
<TD width="16%" align="center" height="10"><b><font color="FFFFFF"> <a href="Online.asp?menu=ForumPosts">帖子图例</TH>
</a> </font> </b>
<TR class=a3>
<Td width="48%" align="center" height="10" colspan="3">总帖数 <%=tolReTopic%> 篇。其中主题 <%=ForumThreads%> 篇,回帖 <%=tolReTopic-ForumThreads%>
篇。<Td width="48%" align="center" height="10" colspan="3">总在线 <%=count%> 人。其中注册用户 <%=regOnline%> 人,访客 <%=count-regOnline%> 人。</TABLE>
<br>
<%
select case Request("menu")
case ""
index
case "cutline"
cutline
case "board"
board
case "ForumPosts"
ForumPosts
case "TodayPage"
TodayPage
case "UserSex"
UserSex
end select
sub index
ip=HTMLEncode(Request.Form("ip"))
UserName=HTMLEncode(Request.Form("UserName"))
if ip<>"" then SqlIP=" where ip='"&ip&"'"
if UserName<>"" then SqlUserName=" where UserName='"&UserName&"' and eremite=0"
sql="select * from [BBSXP_UsersOnline] "&SqlIP&" "&SqlUserName&" order by lasttime Desc"
Rs.Open sql,Conn,1
PageSetup=20 '设定每页的显示数量
Rs.Pagesize=PageSetup
TotalPage=Rs.Pagecount '总页数
PageCount = cint(Request.QueryString("PageIndex"))
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>0 then Rs.absolutePage=PageCount '跳转到指定页数
i=0
Do While Not Rs.EOF and i<PageSetup
i=i+1
if membercode<4 then
ips=split(Rs("ip"),".")
ip=""&ips(0)&"."&ips(1)&".*.*"
else
ip=""&Rs("ip")&""
end if
if Rs("UserName")="" then
UserName="访 客"
elseif Rs("eremite")=1 and membercode<4 then
UserName="隐 身"
else
UserName="<a href=Profile.asp?UserName="&Rs("UserName")&">"&Rs("UserName")&"</a>"
end if
place2=""
if Rs("act")<>"" then
place2 = "<a href="&Rs("acturl")&">"&Rs("act")&"</a>"
place = "『 "&Rs("ForumName")&" 』"
else
place = "『 <a href="&Rs("acturl")&">"&Rs("ForumName")&"</a> 』"
end if
allline=""&allline&"<TR align=middle class=a4><TD height=24>"&ip&"</TD><TD height=24>"&Rs("cometime")&"</TD><TD height=24>"&UserName&"</TD><TD height=24>"&place&"</TD><TD height=24>"&place2&"</TD><TD height=24>"&Rs("lasttime")&"</TD></TR>"
Rs.Movenext
loop
Rs.close
%>
<TABLE cellSpacing=1 cellPadding=1 width=100% align=center border=0 class=a2>
<TR align=middle class=a1>
<TD height=23>IP地址</TD>
<TD height=23>登录时间</TD>
<TD height=23>用户名</TD>
<TD height=23>所在论坛</TD>
<TD height=23>所在主题</TD>
<TD height=23>活动时间</TD>
</TR>
<%=allline%>
</TABLE>
<center>
<table border=0 width=100% cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom">
<script>ShowPage(<%=TotalPage%>,<%=PageCount%>,"")</script>
</td> <td align="right"> <form action="Online.asp" method="POST">查询IP:<input size="15" value="<%=Request.Form("ip")%>" name="ip"> <input type="submit" value=" 确定 "></td></form>
<td align="right"><form action="Online.asp" method="POST">查询用户:<input size="15" value="<%=Request.Form("UserName")%>" name="UserName"> <input type="submit" value=" 确定 "></td></form>
</tr>
</table>
<p><br>
</p>
<%
end sub
sub cutline
sql="select * from [BBSXP_Forums] where followid<>0 and ForumHide=0"
Set Rs=Conn.Execute(sql)
%>
<table class="a2" cellSpacing="1" cellPadding="4" width="100%" align="center" border="0">
<tr>
<td class="a1" vAlign="bottom" align="middle" height="20">论坛名称</td>
<td class="a1" vAlign="bottom" align="middle" height="20">图形比例</td>
<td class="a1" vAlign="bottom" align="middle" height="20">在线人数</td>
</tr>
<%
i=0
Do While Not Rs.EOF
Onlinemany=Conn.execute("Select count(sessionid)from [BBSXP_UsersOnline] where ForumID="&Rs("id")&"")(0)
%>
<tr class="a3">
<td width="21%" height="2" align="center">
<a href="ShowForum.asp?ForumID=<%=Rs("id")%>"><%=Rs("ForumName")%></a></td>
<td width="65%" height="2"><IMG height=8 src="images/bar/<%=i%>.gif" width="<%=Onlinemany/count*100%>%"></td>
<td align="center" width="12%" height="2"><%=Onlinemany%></td></tr>
<%
i=i+1
if i=10 then i=0
Rs.MoveNext
loop
Rs.Close
%></table>
<%
end sub
sub board
sql="select * from [BBSXP_Forums] where followid<>0 and ForumHide=0 order by ForumThreads Desc"
Set Rs=Conn.Execute(sql)
%>
<table class="a2" cellSpacing="1" cellPadding="4" width="100%" align="center" border="0">
<tr>
<td class="a1" vAlign="bottom" align="middle" height="20">论坛名称</td>
<td class="a1" vAlign="bottom" align="middle" height="20">图形比例</td>
<td class="a1" vAlign="bottom" align="middle" height="20">主题数</td>
</tr>
<%
i=0
Do While Not Rs.EOF
%>
<tr class="a3">
<td width="21%" height="2" align="center"><a href="ShowForum.asp?ForumID=<%=Rs("id")%>"><%=Rs("ForumName")%></a></td>
<td width="65%" height="2"><IMG height=8 src="images/bar/<%=i%>.gif" width="<%=Rs("ForumThreads")/ForumThreads*100%>%"></td>
<td align="center" width="12%" height="2"><%=Rs("ForumThreads")%></td></tr><%
i=i+1
if i=10 then i=0
Rs.MoveNext
loop
Rs.Close
%></table>
<%
end sub
sub ForumPosts
sql="select * from [BBSXP_Forums] where followid<>0 and ForumHide=0 order by ForumPosts Desc"
Set Rs=Conn.Execute(sql)
%>
<table class="a2" cellSpacing="1" cellPadding="4" width="100%" align="center" border="0">
<tr>
<td class="a1" vAlign="bottom" align="middle" height="20">论坛名称</td>
<td class="a1" vAlign="bottom" align="middle" height="20">图形比例</td>
<td class="a1" vAlign="bottom" align="middle" height="20">帖子数</td>
</tr>
<%
i=0
Do While Not Rs.EOF
%>
<tr class="a3">
<td width="21%" height="2" align="center"><a href="ShowForum.asp?ForumID=<%=Rs("id")%>"><%=Rs("ForumName")%></a></td>
<td width="65%" height="2"><IMG height=8 src="images/bar/<%=i%>.gif" width="<%=Rs("ForumPosts")/tolReTopic*100%>%"></td>
<td align="center" width="12%" height="2"><%=Rs("ForumPosts")%></td></tr><%
i=i+1
if i=10 then i=0
Rs.MoveNext
loop
Rs.Close
%></table>
<%
end sub
sub TodayPage
tolForumToday=Conn.execute("Select SUM(ForumToday)from [BBSXP_Forums]")(0)
if tolForumToday=0 then tolForumToday=1
sql="select * from [BBSXP_Forums] where followid<>0 and ForumHide=0 order by ForumToday Desc"
Set Rs=Conn.Execute(sql)
%>
<table class="a2" cellSpacing="1" cellPadding="4" width="100%" align="center" border="0">
<tr>
<td class="a1" vAlign="bottom" align="middle" height="20">论坛名称</td>
<td class="a1" vAlign="bottom" align="middle" height="20">图形比例</td>
<td class="a1" vAlign="bottom" align="middle" height="20">今日帖数</td>
</tr>
<%
i=0
Do While Not Rs.EOF
%>
<tr class="a3">
<td width="21%" height="2" align="center"><a href="ShowForum.asp?ForumID=<%=Rs("id")%>"><%=Rs("ForumName")%></a></td>
<td width="65%" height="2"><IMG height=8 src="images/bar/<%=i%>.gif" width="<%=Rs("ForumToday")/tolForumToday*100%>%"></td>
<td align="center" width="12%" height="2"><%=Rs("ForumToday")%></td></tr><%
i=i+1
if i=10 then i=0
Rs.MoveNext
loop
Rs.Close
%></table>
<%
end sub
sub UserSex
count=Conn.execute("Select count(id)from [BBSXP_Users]")(0)
male=Conn.execute("Select count(id)from [BBSXP_Users] where UserSex='male'")(0)
female=Conn.execute("Select count(id)from [BBSXP_Users] where UserSex='female'")(0)
%>
<table class="a2" cellSpacing="1" cellPadding="4" width="100%" align="center" border="0">
<tr>
<td class="a1" vAlign="bottom" align="middle" height="20">性别</td>
<td class="a1" vAlign="bottom" align="middle" height="20">图形比例</td>
<td class="a1" vAlign="bottom" align="middle" height="20">人数</td>
</tr>
<tr class="a3">
<td width="10%" height="2" align="center">
<img src=images/male.gif></td>
<td width="75%" height="2"><IMG height=8 src="images/bar/7.gif" width="<%=male/count*100%>%"></td>
<td align="center" width="12%" height="2"><%=male%></td></tr>
<tr class="a3">
<td width="10%" height="2" align="center">
<img src=images/female.gif></td>
<td width="75%" height="2"><IMG height=8 src="images/bar/0.gif" width="<%=female/count*100%>%"></td>
<td align="center" width="12%" height="2"><%=female%></td></tr>
<tr class="a3">
<td width="10%" height="2" align="center">未知</td>
<td width="75%" height="2"><IMG height=8 src="images/bar/2.gif" width="<%=(count-male-female)/count*100%>%"></td>
<td align="center" width="12%" height="2"><%=count-male-female%></td></tr>
</table>
<%
end sub
htmlend
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -