<!-- #include file="header.asp" -->
<table width="800" height="429" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="429"  background="image/top_r14_c1.jpg" colspan="2" valign="top"><!-- #include file="Untitled-1.asp" --></td>
    <td width="686" valign="top"><table width="603"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td width="603"><!-- #include file="include/ubbcode.asp" -->
            <!-- #include file="include/function.asp" -->
            <div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
            <script language='JavaScript'> initToolTips(); </script>
            <script language='JavaScript' src="include/common.js"></script>
            <%
	on error resume next
	Dim CurPage,blogPerPage, Log_Num, url_add, pagecount, iadminlogin, rss, sql, seakey, seatarget
	If CheckStr(Request.QueryString("Page")) <> Empty Then
		Curpage=CheckStr(Request.QueryString("Page"))
		If Curpage=False OR Curpage<0 Then Curpage=1
	Else
		Curpage=1
	End If

	if CheckStr(Request("sea_key")) <> Empty then
		seakey = CheckStr(Request("sea_key"))
		seatarget = CheckStr(Request("sea_target"))
		 if seatarget = "sea_name" then
			strconn = "select ebook.* from ebook where fname like '%" & seakey & "%' and fshow=true order by id desc"
		elseif seatarget = "sea_content" then
			strconn = "select ebook.* from ebook where fcontent like '%" & seakey & "%' and fshow=true order by id desc"
		end if
		
	else
		strconn = "select ebook.* from ebook order by id desc"
	end if
	
	set rs = server.createobject("adodb.recordset")
	rs.open strconn, conn, 1, 1
	if session("admin") = "1" then
		iadminlogin = "<a href='admin.asp?type=config'>系统管理</a>　<a href='msg.asp?action=2'>退出</a>"
	else
		iadminlogin = "<a href='login.asp'>管理登录</a>"
	end if	

	rs.PageSize=ipagesize
	rs.AbsolutePage=CurPage
	Log_Num=rs.RecordCount
	url_add = "?"
	response.write ("<table width='637' height='18' border='0' align='center' cellpadding='0' cellspacing='0' class='bodybg'><tr><td><table align='center' width='92%' cellpadding='0' cellspacing='0'><tr><td>留言数: " & rs.recordcount & "</td><td align='right'><a href='write.asp'>签写留言</a>　<a href='search.asp'>搜索留言</a>　" & iadminlogin & "</td></tr></table>")
	
	Multipages = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='font-size: 9px;font-family: Tahoma;'>" & MultiPage(Log_Num,ipagesize,CurPage,Url_Add) & "</span>&nbsp;&nbsp;"
	Response.Write(Multipages)
	Response.Write("</td></tr></table>")
	
%></td>
      </tr>
    </table>
      <table width="637" height="25" border="0" align="center" cellpadding="0" cellspacing="0" class="bodybg">
      <tr>
        <td width="637"><table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td  valign="top"><%

	if rs.eof or rs.bof then
			response.write ("<br><table width='637' align='center' cellpadding='0' cellspacing='0'><tr class='itr'><td width='17' class='titleleft'></td><td align='center' valign='middle'><span class='namecolor'>没有留言</span></td><td width='17' class='titleright'></td></tr></table>")
	end if
	Do while not rs.EOF and PageCount<ipagesize
			dim ihomeurl
			if rs("fhomeurl") = "http://" then
				ihomeurl = "<a href='#' onMouseOver=""toolTip('该网友没有主页', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()""><span class='friend-info'>HOME</span></a>　"
			else
				ihomeurl = "<a href='" & rs("fhomeurl") & "' target='_blank' onMouseOver=""toolTip('" & rs("fhomeurl") & "', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()""><span class='friend-info'>HOME</span></a>　"
			end if			
				response.write ("<br><table width='98%' align='center' class='ititle' cellpadding='0' cellspacing='0'><tr class='itr'><td width='17' class='titleleft'></td><td valign='middle' class='namecolor'>" & rs("fname") &"</td><td align='right' valign='middle'><span style='color: #ffffff;font-size: 7pt;'>" & rs("ftime") & "</span></td><td width='17' class='titleright'></td></tr></table><table width='96%' align='center' class='itable' cellpadding='0' cellspacing='0'><tr><td width='75' valign='top'><img src='" & rs("fface") & "' width='75' height='75'></td><td align='left' colspan='2' valign='top'>")
				if rs("fshow") = false then
					if session("admin") <> "1" then
						response.write ("本留言为悄悄话，只有管理员可见！")
					else
						response.write (ubbcode(rs("fcontent")))
					end if
				else
					response.write (ubbcode(rs("fcontent")))
				end if
				response.write ("</td></tr><tr><td colspan='3' style='padding-bottom: 6px;'><table width='98%' class='replytable'  align='center' cellpadding='0' cellspacing='0'>")
					sql = "select * from reply where frepid=" & rs("id") & " order by id desc"				
					set rss = server.createobject("adodb.recordset")
					rss.open sql, conn, 1, 1
								if not rss.eof or rss.bof then								
									do while not rss.eof
										response.write ("<tr><td><span style='color:#660000;'>回复:</span></td><td align='right'>")
											if session("admin") = "1" then
												response.write ("<a href='del.asp?delrep=" & rss("frepid") & "&repid=" & rss("id") & "'  onclick=""return confirm('确定要删除吗?');""  onMouseOver=""toolTip('删除本回复', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()""><span class='adminedit'>DEL</span></a>")
											else
												response.write ("")
											end if
										response.write ("&nbsp;&nbsp;<span class='time'>" & rss("ftime") & "</span></td></tr><tr bgcolor='#F4F2EC'><td colspan='2'>" & ubbcode(rss("freply")) & "</td></tr>")
										rss.movenext
									loop
								else									
									response.write ("<tr><td></td></tr>")
								end if
					rss.close
					set rss = nothing
				response.write ("</table></td></tr><tr><td colspan='2'>&nbsp;")
				if session("admin") = "" then
					response.write ("")
				else 
					response.write ("<a href='del.asp?id=" & rs("id") & "' onclick=""return confirm('确定要删除吗?');""  onMouseOver=""toolTip('删除本留言', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()""><span class='adminedit'>删除</span></a>　<a href='reply.asp?id=" & rs("id") & "' onMouseOver=""toolTip('回复本留言', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()""><span class='adminedit'>回复</span></a>")
				end if
				response.write ("</td><td align='right'><a href='http://friend.qq.com/cgi-bin/friend/user_show_info?ln=" & rs("fqq") & "' onMouseOver=""toolTip('查看" & rs("fqq") & "的资料', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()"" target='_blank'><span class='friend-info'>QQ</span></a>　" & ihomeurl & "<a href='mailto:" & rs("fmail") & "' onMouseOver=""toolTip('" & rs("fmail") & "', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()""><span class='friend-info'>MAIL</span></a>　<span class='friend-info' style='cursor:hand;' onMouseOver=""toolTip('" & rs("fip") & "', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()"">IP</span>&nbsp;&nbsp;<span class='friend-info' style='cursor:hand;' onMouseOver=""toolTip('" & rs("ffrom") & "', '#ffffff', '#AEA387')"" onMouseOut=""toolTip()"">FROM</span></td></tr></table>")		
			rs.movenext
			PageCount=PageCount+1
	loop
	Response.Write("</td></tr></table><br>" & MultiPages)
%>
              </tr>
        </table></td>
      </tr>
    </table>
    <%
		
		rs.close
		set rs = nothing
		conn.close
		set conn = nothing
%></td>
  </tr>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="50"><!-- #include file="footer.asp" --></td>
  </tr>
</table>
