<%
If ChannelID<>0 Then
sSql="Select * From OtherChannel Where ClassID="&ChannelID
oRs.Open sSql,oConn,1,1
If Not oRs.Eof Then
zParentPath=oRs("ParentPath")
ParentID=ors("ParentID")
zClassName=oRs("ClassName")
zclassid=ors("ClassID")
End If
oRs.Close
If ParentID<>0 Then
sSql="Select ClassID,ClassName,ParentPath From OtherChannel Where ClassID="&ParentID
oRs.Open sSql,oConn,1,1
zClassName=oRs("ClassName")
zclassid=ors("ClassID")
oRs.Close
End If
End If
%>
<%
dim MaxPerPage
dim sql
dim rs
dim totalPut '總記錄
dim CurrentPage '當前頁次
dim TotalPages '總頁數
dim i
dim id
MaxPerPage=W_BookRecoNum
%>
<%
set rs=server.createobject("adodb.recordset")
If BookExamine=False Then
sql="select * from book where reply<>'' or ip='"&rip&"' order by id desc"
Else
sql="select * from book where reply<>'' or ip='"&rip&"' order by id desc"
End If
rs.open sql,oConn,1,1
%>
<%
if rs.eof and rs.bof then
%>
<%
else
%>
<%
if not rs.eof then
rs.MoveFirst '注意放到前面來,否則到任何頁總是在第一個記錄上
end if
rs.pagesize=MaxPerPage '設置每頁最多顯示多少條記錄
If trim(Request("Page"))<>"" then '如果請求的頁次不為空
If IsNumeric(trim(Request("Page"))) = False Then
GoError "分頁參數錯誤,請不要試圖破壞此系統。"
End If
CurrentPage= CLng(request("Page")) 'clng是轉換成長整型數據類型,并賦值到當前頁次上
If CurrentPage> rs.PageCount then '如果當前頁次大于總頁數,則將最大頁次賦值到當前頁次上
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1 '一切條件不成立,將當前頁設為第一頁
End If
totalPut=rs.recordcount '將總記錄賦值于TOTALPUT
if CurrentPage<>1 then '如果當前頁數不等于第一頁
if (currentPage-1)*MaxPerPage
<%
id=(totalPut-MaxPerPage*(currentPage-1))+1
i=0
Do While Not rs.EOF and i
第<%=id%>位 |
|
: <%=rs("time")%> |
來自:<%=rs("where")%> |
IP:<%=rs("ip")%> |
|
|
" width="32" height="32"> |
<%=rs("name")%> |
|
" width="20" height="20"> |
<%if rs("show")=2 then
response.write"此留言內容為悄悄話,只有管理員才可查看!"
%> <%else%> <%=rs("title")%> |
<%
Dim bookcontent
bookcontent=replace(rs("content"),"請您文明用語","請您文明用語")
Response.Write bookcontent
%>
<%end if%> |
<%
if rs("reply")<>"" then%>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
站長回復:<%=htmlencode(rs("reply"))%> |
<%end if%> |
<% i=i+1
rs.movenext
loop
%>
當前第 <%=currentpage%>頁 總共 <%=n%>頁 共 <%=rs.recordcount%>個留言
<%k=currentPage
if k<>1 then
response.write "[ "+"首頁] "
response.write "[ "+"上一頁] "
else
Response.Write "[首頁] [上一頁]"
end if
if k<>n then
response.write "[ "+"下一頁] "
response.write "[ "+"尾頁] "
else
Response.Write "[下一頁] [尾頁]"
end if
%>
<%
End If
%>
|
<%
rs.close
%>