<%@ CODEPAGE=65001 %> <% Response.Charset="UTF-8"%> <% if request("keywords")<>"" then if checktxt(request("keywords"))<>request("keywords") then response.write "" response.end end if end if %> <%=sitename%>


<% set rs=Server.CreateObject("ADODB.RecordSet") sql="select * from Feedback where online='1' " keywords=request("keywords") if keywords<>"" then sql=sql+ " and Comments like '%"&keywords&"%' " sql=sql + "order by top desc,Postdate desc" rs.open sql,conn,1 if not (rs.eof and rs.bof) then '如果有留言時,就顯示留言。此行的if與倒數第6行的end if相對應 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>
<%if rs("top")<>"1" then response.write "[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&"頁   轉到第 " response.write "
" response.write "
" else response.write "
" if keywords="" then response.write "暫時沒有留言" else response.write "抱歉,沒有找到您要查到的內容

返回上一頁" end if response.write "
" end if %>