📄 userlist.asp
字号:
<!--#INCLUDE FILE="../inc/db_inc.asp"-->
<!--#INCLUDE FILE="../inc/char_inc.asp"-->
<!--#INCLUDE FILE="../header.asp"-->
<HTML>
<HEAD>
<TITLE>用户列表 - <%= boardtitle %></TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type="text/css">
<!--
a { font-family: "Tahoma", "Verdana"; font-size: 12px; color: #333333}
body { font-family: "Tahoma", "Verdana"; font-size: 12px; color: #333333}
td { font-family: "Tahoma", "Verdana"; font-size: 12px; color: #333333; word-wrap: break-word}
-->
</STYLE>
</HEAD>
<BODY bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="20">
<center>
<form method="post" action="userlist.asp" name="post">
<select name="mode">
<option value="">---选择查看方式---</option>
<option value="posts">以发帖量排序</option>
<option value="regdate">以注册日期排序</option>
</select>
<input type="submit" value="提 交">
</form>
<%
mode = "posts"
if request("mode") = "posts" then
mode = "posts"
end if
if request("mode") = "regdate" then
mode = "regdate"
end if
if mode = "posts" then response.write "当前以发帖量排序"
if mode = "regdate" then response.write "当前以注册日期排序"
response.write "<BR><BR>"
page = request("page")
if page = "" then
page = 1
else
if not IsNumeric(page) then
page = 1
else
page = clng(page)
end if
end if
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
Set rs = Server.CreateObject("ADODB.Recordset")
strsql = "select userid, username, posts, country, joindate, lastposttitle, lastpostid from sf_user"
if mode = "regdate" then strsql = strsql & " order by userid DESC"
if mode = "posts" then strsql = strsql & " order by posts DESC"
rs.Open strsql, Conn, 1, 1
if not (rs.bof or rs.eof) then
i = 1
rs.PageSize = 30
if page > rs.PageCount then page = rs.PageCount
rs.AbsolutePage = page
pagecount = rs.PageCount
StrHtml = "<table width=""98%"" border=""0"" cellspacing=""1"" cellpadding=""4"" align=""center"">"
StrHtml = StrHtml & "<tr bgcolor=""#659EBB""><td width=""20%"" align=""center"">用户</td><td width=""10%"" align=""center"">发帖数</td><td width=""20%"" align=""center"">来自</td><td width=""20%"" align=""center"">注册日期</td><td width=""30%"" align=""center"">最后发表</td></tr>"
do until rs.eof or i > rs.PageSize
if (i mod 2) = 0 then
StrHtml = StrHtml & "<tr bgcolor=""#FFFFFF"">"
else
StrHtml = StrHtml & "<tr bgcolor=""#F5F5F5"">"
end if
StrHtml = StrHtml & "<td><a href=""../showuser.asp?userid=" & rs("userid") & """ target=_blank>" & rs("username") & "</a></td>"
StrHtml = StrHtml & "<td align=""center"">" & rs("posts") & "</td>"
StrHtml = StrHtml & "<td>" & rs("country") & "</td>"
StrHtml = StrHtml & "<td>" & rs("joindate") & "</td>"
if rs("lastposttitle") = "" then
StrHtml = StrHtml & "<td></td>"
else
StrHtml = StrHtml & "<td><a href=""../showthread.asp?threadid=" & rs("lastpostid") & """ target=_blank>" & rs("lastposttitle") & "</a></td>"
end if
StrHtml = StrHtml & "</tr>"
i = i + 1
rs.MoveNext
loop
StrHtml = StrHtml & "</table><br><br>"
response.write StrHtml & "论坛当前共"& rs.RecordCount & "名注册用户, 当前为第" & page & "页<BR>选择页数:"
Set Conn = nothing
Set rs = nothing
for i=1 to pagecount
if i = page then
response.write " <b>" & i & "</b>"
else
response.write " <a href=""userlist.asp?mode=" & mode & "&page=" & i & """>" & i & "</a>"
end if
next
else
response.write "无注册用户"
end if
%>
<br><br><b>userlist v1.02</b> for SF2
</center>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -