📄 mainnote.asp
字号:
<!-- #include file="config.inc" -->
<html>
<head><title></title>
<style>
<!--
.class1{font:10pt;color:#000080;border-width:1;}
td{font:10pt;}
-->
</style>
</head><body style="font:10pt;margin-left:4pt">
<font color="#ff0000">您的位置:会员社区</font><hr color="#999933" size=1>
<br><a style="color:blue;cursor:hand;font:10pt;text-decoration:underline" onclick="window.open('noteadd.htm','_blank','toolbars=no,scrollbars=yes,width=470,height=440')">添加新留言</a> <font style="font:10pt;color:#CC66FF">如果您看不到自己的留言,单击刷新按钮,稍侯即可</font>
<table width=570 border=0 cellPadding=0 cellSpacing=1 bordercolor=#baccff>
<%
dim ipagesize ' 每页显示记录数
ipagesize=15
page=request.querystring("page")
if page="" then
page=1
end if ' 如果是第1次浏览该页,则说明page是空,那么就将它的值设为1
' 连接数据库
set conn=server.createobject("adodb.connection")
conn.open connstring
set objnoters=server.createobject("adodb.recordset")
ssql="select * from notebook order by notetime desc"'将最新的留言显示在最前面
objnoters.open ssql,conn,1,3
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' 到此完成数据库打开操作
if objnoters.eof then
response.write "目前还没有任何文章信息!"
response.end
end if
' 制作显示留言的表头
response.write "<tr bgcolor=#baccff class=class1 align=center><td width=50>序号</td><td width=140>主题</td><td width=70>作者</td><td width=140>E-mail</td><td width=130>留言时间</td><td width=40>阅读数</td></tr>"
' 输出所有留言
objnoters.pagesize=ipagesize ' 设置每页显示记录数
pagetotal=objnoters.pagecount ' 根据pagesize计算总页数
objnoters.absolutepage=page ' 转到要显示的页
response.write "<tr><td colspan=""6""><table width=""100%"" border=0 cellspacing=0 cellpadding=2 bgcolor=#eeeeee>"
for position=1 to ipagesize
response.write "<tr align=center><td width=50>"
if objnoters("status")=0 then ' 表明这个留言记录是原创文章
response.write cint(right(objnoters("noteid"),5)) ' 打印出此留言的编号(原文编号,没有计回文)
else
response.write "<font color=#FF00FF>回文</font>"
end if
response.write "</td>" ' 下面打印出此条留言的其他部分
response.write "<td width=150>"
%><a style="cursor:hand;color:blue;text-decoration:underline" onclick="window.open('noteview.asp?noteid=<%=objnoters("noteid")%>','_blank','toolbars=no,scrollbars=yes,width=320,height=300')"><%=objnoters("subject")%></a>
<%
response.write "</td>"
response.write "<td width=70>"& objnoters("userid") & "</td>"
response.write "<td width=140>"
%><a href="mailto:<%=objnoters("email")%>"><%=objnoters("email")%></a>
<%
response.write "</td>"
response.write "<td width=130>"& objnoters("notetime")&"</td>"
response.write "<td width=40>"& objnoters("readnum") &"</td></tr>"
objnoters.movenext
if objnoters.eof then
exit for ' 已经到了表的尾
end if
next
%></table></td></tr>
</table>
<%
response.write " 页码:"
for pagetemp=1 to pagetotal
if pagetemp=cint(page) then ' 如果是当前页面则不予超级链接
response.write "<font color=#CC00FF>"& pagetemp & "></font>"
else ' 给其他页面提供超级链接
%>
<font color=#009900>
<A HREF="mainnote.asp?page=<%=pagetemp%>"><%=pagetemp%></A>></font>
<%
end if
next
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -