📄 online.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp"-->
<!-- #include file="inc/char.asp" -->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/grade.asp"-->
<!--#include file="inc/info.asp"-->
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0" CHARSET="GB2312">
<title><%=ForumName%></title>
<link rel="stylesheet" type="text/css" href="forum.css">
</head>
<body bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin=0 leftmargin=0>
<!--#include file="inc/theme.asp"-->
<br>
<TABLE border=0 width="750" align=center>
<TBODY>
<TR>
<TD vAlign=top width=30%><a href="<%=HostURL%>"><img border="0" src="<%=logo%>"></a></TD>
<TD valign=middle align=top>
<img src="<%=picurl%>closedfold.gif" border=0> <a href="index.asp"><%=ForumName%></a><br>
<img src="<%=picurl%>bar.gif" border=0 width=15 height=15><img src="<%=picurl%>openfold.gif" border=0> 论坛在线
</TD></TR></TBODY></TABLE>
<br>
<%
dim username
dim userstat
dim useradrr
dim userlogi
dim usermess
dim board
dim boardtype
dim sqltype
board = request("boardid")
response.write "<table width=""95%"" border=0 cellspacing=0 cellpadding=0 align=center>"&_
"<tr><td bgcolor="""&Tablebackcolor&""">"&_
"<table width=""100%"" border=0 cellspacing=1 cellpadding=4><tr>"&_
"<td bgcolor="""&aTabletitlecolor&""" colspan=7>论坛在线情况统计: 共<b> "& online()&" </b>人在线 </td></tr>"&_
"<tr align=center>"&_
"<td bgcolor="""&Tabletitlecolor&""" width=""20%"">用户呢称</td>"&_
"<td bgcolor="""&Tabletitlecolor&""" width=""26%"">用户状态</td>"&_
"<td bgcolor="""&Tabletitlecolor&""" width=""26%"">来源鉴定</td>"&_
"<td bgcolor="""&Tabletitlecolor&""">登陆时间</td>"&_
"<td bgcolor="""&Tabletitlecolor&""" width=""8%"">发送消息</td>"&_
"</tr>"
call Ouser()
response.write "</table></td></tr></table>"
function online()
guests="客人"
tmprs=conn.execute("Select count(id) from online")
online=tmprs(0)
set tmprs=nothing
if isnull(online) then online=0
end function
sub Ouser()
rem /*读取数据库表Online*/
set rs = server.createobject("Adodb.Recordset")
if request("boardid") = "" or request("boardid") = NULL then
sqltype = ""
else
set B_rs = server.createobject("adodb.recordset")
b_sql = "select boardtype from board where boardid='"&request("boardid")&"'"
B_rs.Open b_sql,conn,1,1
boardtype = B_rs("boardtype")
B_rs.close
set B_rs = nothing
set b_sql = nothing
sqltype = "where stats='"&boardtype&"'"
end if
sql = "select * from online "&sqltype
rs.open sql,conn,1,1
page = request("page")
if page="" or page = 0 then
page = 1
end if
'
rs.PageSize = 25
rs.AbsolutePage = page
tolnum = rs.pagecount
rem /*读取数据库表Online*/
if rs.eof and rs.bof then
rs.close : set rs=nothing
else
dim ii
ii = 0
do while not rs.eof and ii < (rs.pagesize - 1)
response.write "<tr align=center>"&_
"<td bgcolor="""&aTabletitlecolor&""" width=""20%"">"
response.write "<a href=javascript:openScript('dispuser.asp?name="&htmlencode(rs("username"))&"',350,300)>"&_
rs("username")&"</a></td>"&_
"<td bgcolor="""&aTabletitlecolor&""" width=""26%"">"&rs("stats")&"</td>"&_
"<td bgcolor="""&aTabletitlecolor&""" width=""26%"">"&address(rs("ip"))&"</td>"&_
"<td bgcolor="""&aTabletitlecolor&""">"&rs("startime")&"</td>"&_
"<td bgcolor="""&aTabletitlecolor&""" width=""8%"">"&_
"<a href=""javascript:openScript('messanger.asp?action=new&touser="&htmlencode(rs("username"))&"',350.300)"">"&_
"<img src=""pic/newmail.gif"" border=0></a></td>"&_
"</tr>"
ii = ii + 1
rs.movenext
loop
response.write "<tr bgcolor=""#ffffff"" align=right><td valign=top colspan=7>"&_
"共 <b>"&tolnum&"</b> 页 "&_
"<a href=online.asp?page=1&boardid="&request("boardid")&">首页</a> "
if page > 1 then
response.write "<a href=online.asp?page="&page-1&"&boardid="&request("boardid")&">上一页</a> "
else
response.write "<font color=""#cccccc"">上一页</font>"
end if
if Cint(page) < Cint(tolnum) then
response.write " <a href=online.asp?page="&page+1&"&boardid="&request("boardid")&">下一页</a> "
else
response.write " <font color=""#cccccc"">下一页</font> "
end if
response.write "<a href=online.asp?page="&tolnum&"&boardid="&request("boardid")&">末页</a>"&_
"</td></tr>"
rs.close
set rs = nothing
end if
end sub
%>
<!--#include file="footer.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -