<% set rs=Server.CreateObject("ADODB.RecordSet") sql="select * from Feedback where online='1' order by top desc,Postdate desc" rs.open sql,conn,1 if rs.eof and rs.bof then response.redirect "book_write.asp" if pages=0 or pages="" then pages=10 '每頁留言條數 rs.pageSize = pages '每頁記錄數 allPages = rs.pageCount '總頁數 page = Request("page") '從瀏覽器取得當前頁 'if是基本的出錯處理 If not isNumeric(page) then page=1 if isEmpty(page) or Cint(page) < 1 then page = 1 elseif Cint(page) >= allPages then page = allPages end if rs.AbsolutePage = page '轉到某頁頭部 Do While Not rs.eof and pages>0 UserName=rs("UserName") '用戶名 pic=rs("pic") '頭像 face=rs("face") '表情 Comments=rs("Comments") '內容 bad1=split(bad,"/") '過濾臟話 for t=0 to ubound(bad1) Comments=replace(Comments,bad1(t),"***") next Replay=rs("Replay") '回復 Usermail=rs("Usermail") '郵件 url=rs("url") '主頁 I=I+1 '序號 temp=RS.RecordCount-(page-1)*rs.pageSize-I+1 %>
.gif border=0>
[NO.<%=temp%>] .gif> 發表于:<%=cstr(rs("Postdate"))%>
<% '是否屏蔽留言內容中的html字符 if html=0 then response.write replace(server.htmlencode(Comments),vbCRLF,"
") else response.write replace(Comments,vbCRLF,"
") end if %>

<%if rs("Replay")<>"" then%>

<%end if%>
<% pages = pages - 1 rs.movenext if rs.eof then exit do loop %>
<% response.write "
       總計留言"&RS.RecordCount&"條 " if page = 1 then response.write "首頁 前頁" else response.write "首頁 前頁" end if if page = allpages then response.write " 下頁 末頁" else response.write " 下頁 末頁" end if response.write " 第"&page&"頁 共"&allpages&"頁 " %>