📄 userlist.asp
字号:
<%
if Request.Cookies("bookbaby")("username")="" then
Response.Write "<script>javascript:alert('您需要登陆,才能查看注册用户资料!');window.close();</script>"
Response.End
end if
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<!--#include file="top.asp"-->
<img src="" width="1" height="3">
<table border="0" width="680" cellspacing="1" cellpadding="1" bgcolor="<%=tablebackcolor%>" align="center">
<tr>
<td width="70%" valign="top" align="center" bgcolor="<%=tablebodycolor%>">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from user order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有会员注册</p>"
else
PageUrl="UserList.asp"
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
end if
rs.close
sub showContent
%>
<table border="0" width="90%" cellspacing="1" cellpadding="0" class="TableLine" bordercolorlight="<%=MainBColor%>" bgcolor="<%=tablebackcolor%>">
<tr bgcolor="<%=tabletitlecolor%>">
<td width="10%" height=25 align=center><font color="#000000">ID</font></td>
<td width="20%" height=25 align=center><font color="#000000">会员</font></td>
<td width="10%" height=22 align=center><font color="#000000">性别</font></td>
<td width="30%" height=22 align=center><font color="#000000">信箱</font></td>
<td width="20%" height=22 align=center><font color="#000000">主页</font></td>
<td width="10%" height=25 align=center><font color="#000000">OICQ</font></td>
</tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<tr bgcolor="<%=tablebodyacolor%>">
<td align=center height="25">
<%'=rs("id")%>
<%=totalPut-(i+MaxPerPage*(currentpage-1)-1)%> </td>
<td align=center height="25"><a href=userinf.asp?id=<%=rs("id")%> target=_blank ><font color="#ff8000"><%=rs("UserName")%></font></a>
</td>
<td align=center>
<%if rs("sex") then%>
男
<%else%>
<font color="<%=AlertFColor%>">女</font>
<%end if%>
</td>
<td align=center><%=rs("Email")%> </td>
<td align=center><a href="<%=rs("UserWebUrl")%>" target=_blank><%=rs("UserWebName")%></a> </td>
<td align=center height="25"><%=rs("oicq")%> </td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=post action="&filename&">"
if CurrentPage<2 then
response.write " 首页 | 上一页 |"
else
response.write " <a href="&filename&"?boardid="&boardid&"&page=1>首页</a> | <a href="&filename&"?boardid="&boardid&"&page="&CurrentPage-1&">上一页</a> |"
end if
if n-currentpage<1 then
response.write " 下一页 | 末页"
else
response.write " <a href="&filename&"?boardid="&boardid&"&page="&CurrentPage+1&">下一页</a> |"&_
" <a href="&filename&"?boardid="&boardid&"&page="&n&">末页</a>"
end if
response.write " | 页次:<strong>"&CurrentPage&"/"&n&"</strong>页 | 转到:<select name='page' size='1' onchange='javascript:submit()'>"
for i = 1 to n
response.write "<option value="&i
if cint(CurrentPage)=cint(i) then response.write " selected "
response.write ">第"&i&"页</option>"
next
response.write "</select></form>"
end function
%>
</td>
</tr>
</table>
<!--#include file="copyright.asp"-->
<%
stat="注册用户列表"
if Request.Cookies("bookbaby")("username")<>"" then
set rs1=conn.execute("select username from online where username='"&Request.Cookies("bookbaby")("username")&"'")
if not rs1.eof then
conn.execute("update online set stat='"&stat&"',lasttime='"&now()&"' where username='"&Request.Cookies("bookbaby")("username")&"'")
else
conn.execute "insert into online(username,sex,stat,lasttime) values ('"&Request.Cookies("bookbaby")("username")&"',"&Request.Cookies("bookbaby")("usersex")&",'"&stat&"','"&now()&"')"
end if
set rs1=nothing
else
conn.execute("delete * from online where datediff('n',lasttime,now())>20")
end if
set rs=nothing
conn.close
set conn=nothing%></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -