<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
if request("keywords")<>"" then
if checktxt(request("keywords"))<>request("keywords") then
	response.write "<script language='javascript'>"
	response.write "alert('您输入的搜索关键中含有非法字符，请检查后重新输入！');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
end if
end if
%>
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%
set rs2=Server.CreateObject("ADODB.RecordSet")
sql2="select * from book_setup"
rs2.open sql2,conn,1
p=rs2("pages")
h=rs2("huifutishi")
c=rs2("huifucolor")
	rs2.close
	
	set rs2=nothing
	
%>

<HTML><HEAD><TITLE>留言本-<%=title%></TITLE>
<META content=<%=des%> name=description>
<META content=<%=key%> name=keywords>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="images/style.css" type=text/css rel=stylesheet>

<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<style type="text/css">
<!--
.h10 {LINE-HEIGHT: 10px
}
-->
</style>
</HEAD>
<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<!--#include file="head.asp"-->
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="230" valign="top"><!--#include file="left.asp"--></td>
    <td valign="top"><TABLE id=table14 height=8 cellSpacing=0 cellPadding=0 width=100 
        border=0>
      <TBODY>
        <TR>
          <TD></TD>
        </TR>
      </TBODY>
    </TABLE>
      <TABLE id=__01 cellSpacing=0 cellPadding=0 width=99% align=center 
            border=0>
      <TBODY>
        <TR>
          <TD><IMG id=in_01 height=7 alt="" 
                  src="images/in_01.jpg" width=7></TD>
          <TD background=images/in_02.jpg><IMG id=in_02 height=7 
                  alt="" src="images/in_02.jpg" width=185></TD>
          <TD><IMG id=in_03 height=7 alt="" 
                  src="images/in_03.jpg" width=8></TD>
        </TR>
        <TR>
          <TD background=images/in_04.jpg><IMG id=in_04 
                  height=40 alt="" src="images/in_04.jpg" width=7></TD>
          <TD><table width="571" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td valign="top"><table width="95%" height="252" border="0" align="center" cellpadding="00" cellspacing="0" bordercolor="#CCCCCC">
                      <tr>
                        <td width="517" height="230" valign="top"><div align="center">
                            <table width="100%" border=0 cellspacing=0 cellpadding=0 align=center class="grayline">
                              <tr>
                                <td align=center height=50><a href=wgb.asp><img src=images/wgb.jpg width="120" height="30" border=0 title="我要写留言"></a>&nbsp;&nbsp;&nbsp;&nbsp; <img src=images/gb.jpg width="120" height="30" border=0 title="留言本首页"> </td>
                              </tr>
                              <tr>
                                <td class="coolscrollbar"><%
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=4		'每页留言条数
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
	%>
                                    <table width="95%" border="1" align="center" cellPadding="3" cellSpacing="0"  borderColorLight=#311600 borderColorDark=#e7e5e2 style="word-break:break-all">
                                      <tr>
                                        <td vAlign="top" width="25%" rowSpan="2" align=center><table border=0 width=95%>
                                            <tr>
                                              <td align=center><img src=images/face/pic<%=pic%>.gif border=0></td>
                                            </tr>
                                            <tr>
                                              <td>姓名：<%=UserName%><br>
                                                来自：<%=left(rs("ip"),(len(rs("ip"))-2))+"**"%><br>
                                                邮件：<a href=mailto:<%=Usermail%>><img src=gbook/images/mail.gif border=0 alt="<%=Usermail%>"></a><br>
                                                主页：<a href="<%=URL%>" target='_blank'><img src=gbook/images/home.gif border=0 alt="<%=URL%>"></a></td>
                                            </tr>
                                        </table></td>
                                        <td width="75%" height="20"><%if rs("top")<>"1" then response.write "[NO."&temp&"]"%>
                                            <img border=0 src=images/face/face<%=face%>.gif> 发表于：<%=cstr(rs("Postdate"))%></td>
                                      </tr>
                                      <tr>
                                        <td width='75%' height=120 vAlign="top"><%
	'是否屏蔽留言内容中的html字符
	if html=0 then
	response.write replace(server.htmlencode(Comments),vbCRLF,"<BR>")
	else
	response.write replace(Comments,vbCRLF,"<BR>")
	end if
	%>
                                            <br>
                                            <br>
                                            <%if rs("Replay")<>"" then%>
                                            <table borderColorDark=#e7e5e2  borderColorLight=#311600 cellSpacing="1" cellPadding="0" width="90%" align="center" border="1">
                                              <tr>
                                                <td vAlign="top"><font color="<%=c%>"><%=h%><br>
                                                      <%=Replay%></font> </td>
                                              </tr>
                                            </table>
                                          <br>
                                            <%end if%>
                                        </td>
                                      </tr>
                                    </table>
                                  <table cellSpacing="0" cellPadding="0" width="95%" align="center" border="0">
                                      <TR>
                                        <TD height=8></TD>
                                      </TR>
                                    </TABLE>
                                  <%
pages = pages - 1
rs.movenext
if rs.eof then exit do
loop

response.write "<table border=0 align=center><tr><td><form action='gb.asp' method='post'>总计留言"&RS.RecordCount&"条 "
if page = 1 then
response.write "首页 前页"
else
response.write "<a href=gb.asp?page=1>首页</a> <a href=gb.asp?keywords="&keywords&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write " 下页 末页"
else
response.write " <a href=gb.asp?keywords="&keywords&"&page="&page+1&">下页</a> <a href=gb.asp?keywords="&keywords&"&page="&allpages&">末页</a>"
end if
response.write " 第"&page&"页 共"&allpages&"页 &nbsp; 转到第 "
response.write "<select name='page'>"
for i=1 to allpages
response.write "<option value="&i&">"&i&"</option>"
next
response.write "</select> 页 <input type=submit name=go value='Go'><input type=hidden name=keywords value='"&keywords&"'></form></td><td align=right>"
response.write "</td></tr></table>"


else
response.write "<table cellSpacing=0 cellPadding=0 align=center bgColor=#FFFFFF border=0><TR><TD height=120 align=center>"
if keywords="" then response.write "暂时没有留言" else response.write "抱歉，没有找到您要查到的内容<br><br><a href='javascript:history.go(-1)'>返回上一页</a>" end if
response.write "</TD></TR></TABLE>"
end if
%>
                                </td>
                              </tr>
                            </table>
                        </div></td>
                      </tr>
                      <tr>
                        <td height="22" valign="top">&nbsp;</td>
                      </tr>
                  </table></td>
                </tr>
              </table></td>
            </tr>
          </table></TD>
          <TD background=images/in_06.jpg><IMG id=in_06 
                  height=40 alt="" src="images/in_06.jpg" width=8></TD>
        </TR>
        <TR>
          <TD><IMG id=in_07 height=7 alt="" 
                  src="images/in_07.jpg" width=7></TD>
          <TD background=images/in_08.jpg><IMG id=in_08 height=7 
                  alt="" src="images/in_08.jpg" width=185></TD>
          <TD><IMG id=in_09 height=7 alt="" 
                  src="images/in_09.jpg" width=8></TD>
        </TR>
      </TBODY>
    </TABLE>
      <TABLE id=table14 height=7 cellSpacing=0 cellPadding=0 width=100 
        border=0>
        <TBODY>
          <TR>
            <TD></TD>
          </TR>
        </TBODY>
      </TABLE></td>
    <td width="200" valign="top"><!--#include file="right2.asp"--></td>
  </tr>
</table>
<!--#include file="foot.asp"-->
</BODY></HTML>
 
