<%
sql="select * from [book] where passed=0 order by zd desc,id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<% else %>
<%
rs.PageSize =book_ts
iCount=rs.RecordCount
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request.querystring("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
end if
For i=1 To x %>
<%=rs("book_name")%>
Time:<%=FormatDateTime(rs("add_date"),2)%> / IP:<%=replaceip(rs("add_ip"))%> / <%if rs("yc_email")=0 then%>
">邮箱 <% else %> *** <%end if%>/ <%if rs("yc_qq")=0 then%>
&Site=XYCMS留言板&Menu=yes>QQ<% else %> *** <%end if%>
[带"*"号为隐藏内容]
<%=rs("book_body")%>
<%
sqlhf="select * from [book_hf] where book_id="&rs("id")&" and passed=0 order by pl_id desc,id desc"
set rshf=server.createobject("adodb.recordset")
rshf.open sqlhf,conn,1,1
if rshf.eof and rshf.bof then%>
回复: 此留言暂无人员回复!
<% else
do while not rshf.eof
%>
<%=rshf("reply_name")%> 回复: <%=rshf("reply_body")%>
Response Time:<%=rshf("reply_date")%>
<%
rshf.movenext
loop
rshf.close
set rshf=nothing
end if
%>
<%
response.Write("页次:"&page&"/"&maxpage&"页 ")
if page>1 then
response.write "
首页 上一页 "
else
response.write "
首页 上一页 "
end if
if page>6 and maxpage>7 then '判断点击页大于6并且记录集页数大于7时
if (page+3)>maxpage then '当点击页加上3(3的来历为6/2)大于记录集是
pagenow=maxpage-6 '首次数字显示页码
else '否则
pagenow=page-3 '点击页减3(3的来历为6/2)为了让点击页码
end if
for b=1 to 7 '每次显示7条记录
response.write("
"&pagenow&" ")
pagenow=pagenow+1
next
else
if maxpage<7 then'当记录集小于7时
for b=1 to maxpage'显示数字分页码
response.write("
"&b&" ")
next
else'当记录集大于7时但当前页小于7时执行
for b=1 to 7
response.write("
"&b&" ")
next
end if
end if
if page
下一页 尾页"
else
response.write "下一页 尾页"
end if
rs.close
set rs=nothing
%>