<!--#include file="conn.asp"-->
<!--#include file=const.asp -->
<!--#include file="ubb.asp"-->
<!--#include file="userInfo.inc"-->
<!--#include file="chkPage.inc"-->
<%
dim xxid, exec, rs,  title, isPrivate, isLock
dim page,recordcount,pagecount
dim maxid, minid
xxid=replace(trim(request("id")),"'","")
if xxid="" or not isnumeric(xxid) then
	session("error")="非法访问！"
	connclose()
	response.redirect "error.asp"
end if

set rs=server.createobject("adodb.recordset")

'留言本方式查看
rcperpage=rcperpage1

exec="select * from ly where id="&xxid
rs.open exec,conn,1,1
isPrivate=rs("isPrivate")
isLock=rs("isLock")
recordcount=rs("hf")

'悄悄话的显示限制
if isPrivate then
	if (not theUser.reged) or (not theUser.master and theUser.name<>rs("name") ) then
		session("error")="您无权查看此留言！"
		rsclose()
		connclose()
		response.redirect "error.asp"
	end if
end if

exec="update ly set yd=yd+1 where id="&xxid
conn.execute(exec)

title=rs("title")

page=encodestr(Request.querystring("page"))

pageCount=getPageCount(pageCount,recordcount,rcPerPage)

page=getPage(page,pageCount)
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META name="Author" content="木鸟">
<title><%=sitetitle%></title>
<link rel="stylesheet" href="style/<%=skin%>.css" type="text/css">
<meta name="keywords" content="E4无忧,asp">
<script>var subN=0 ; function submitOnce(){if(subN==0){subN=1;return true;}else{return false} }</script>
</head>

<body onkeydown="if(event.keyCode==13 && event.ctrlKey) if(submitOnce())document.form1.submit()">
<!--#include file="head.asp"-->
<form name="admin" method="post" action="admin_post_do.asp" style="margin:0px">


<%
'显示跟帖
if page=1 then
%>
<br>
<table style="table-layout:fixed" border="0" width="520" cellspacing="0" cellpadding="3" align="center" class="table004">
 <tr class=table003> 
 <td>
	 <table width=100% cellspacing=0 cellpadding=2 border=0 style="table-layout:fixed;word-break:break-all">
	 <tr>
	  <td width="25"> 
		<%
		if isLock then
			response.write "<img border=0 src=images/islock.gif alt=锁定>"
		elseif rs("jh")=1 then
			response.write "<img border=0 src=images/jh.gif alt=精华>"
		else
			response.write "<img src=images/nofollow.gif align=absmiddle >"
		end if
		%>
	  </td>
	  <td width="*" class="jnfont5">
	  	<img align=absmiddle border="0" src="images/<%=rs("pic")%>">
	  	<%
	  	response.write funKillword(rs("title"))
	  	if not showFace then
	  		userNameNoFace rs("name"),rs("bl"),isMaster(rs("name"))
	  	end if
	  	%>
	  </td>
	  <td width="200" align=right> 
		<img align=absmiddle src=images/reply.gif><a href="#re">回复</a> 
		<%
		userEmail(rs("email"))
		userIcq(rs("icq"))
		userMsn(rs("msn"))
		userQQ(rs("qq"))
		userUrl(rs("url"))
		%>&nbsp;
	</td></tr>
	</table>
  </td>
 </tr>
 <tr align="center"> 
  <td class="table001"> 
	   <table border="0" width="100%" cellspacing="0" cellpadding="2" style="table-layout:fixed;word-break:break-all">
		<tr valign=top> 
		<%
		if showFace then
			userNameFace rs("name"),rs("face"),rs("male"),rs("bl"),isMaster(rs("name"))
		end if
		%>
		<td width="*" class="jnfont3" style="letter-spacing:1px; line-height:140%">
		<%=ubbcode(rs("nei"))%>
		 </td>
		</tr>
	</table>
		
	<table width=100% >
		<tr> 
		 <td width="45%" class="jnfont6"><img src="images/back.gif" width="17" height="17" align="absmiddle"> 
		  <a href="index.asp">返回列表</a></td>
		 <td width="37%" align="right" class="jnfont6">[ 发表时间：<%=rs("t")%> ]
		 </td>
		 <td width="18%" align="right"> 
		<% if theUser.reged then %>
		<a href="edit.asp?id=<%=rs("id")%>"><img src="images/edit.gif" width="13" height="15" border="0" alt="编辑"></a>
		<% else %>
		<img src="images/edit-gray.gif" width="13" height="15" border="0" alt="编辑">
		<% end if
		if theUser.master then %>
		<a href="admin_post.asp?id=<%=rs("id")%>"><img border="0" src="images/gl.gif" width="16" height="16" alt="管理"></a>
			<% userIp rs("ip"),rs("comefrom") %>
		<% else %>
		<img border="0" src="images/gl-gray.gif" width="16" height="16" alt="管理">
		<img src=images/ip.gif align=absmiddle alt="ＩＰ:☆保密☆&#13;&#10;来源:☆保密☆">
		<% end if %>
		<a href="#"><img src="images/gotop.gif" width="15" height="15" border="0" alt="返上"></a> 
		 </td>
		</tr>
	   </table>
  </td>
 </tr>
</table>

<%
end if
rs.close

'显示跟帖
exec="select id from ly where rt="& xxid &" order by id"
rs.open exec,conn,1,1
if rs.eof then
	rs.close
	exec="select * from ly where id=0"
elseif page=1 then 
	rs.move rcPerpage-1
	if rs.eof then rs.moveprevious
	maxid=rs(0)
	rs.close
	exec="select * from ly where rt="& xxid &" and id<="& maxid &" order by id"
else
	rs.pagesize=rcPerpage
	rs.absolutepage=page
	minid=rs(0)
	rs.move rcPerpage-1
	if rs.eof then rs.moveprevious
	maxid=rs(0)
	rs.close
	exec="select * from ly where rt="& xxid &" and id<="& maxid &" and id>="& minid &" order by id"
end if
%>

<!--#include file="list6.asp"-->

<%
response.write pagelist()

if theUser.master then %>
<table width=650 align=center border=0 cellpadding=2 cellspacing=0><tr align=right><td>
	<a href=### onclick=checkAll()>全选</a> <a href=### onclick=checkNone() >全不选</a> <a href=### onclick=checkRev() >反选</a>
	<select name=act class=input2><option value=del>删除</option><option value=best>精华</option> <input type=submit value="确定" class=input2>&nbsp;
</td></tr></table>
<% end if %>
</form>

<% '回复，只有版主能回复或都可以回复
if theUser.master or (not masterRe and not IsLock) then %>
<br>

<table border="0" width="520" cellspacing="0" cellpadding="3"  align="center" class="table004">
 <tr> 
  <td class="table003" align="center"> ：：： 您 可 以 在 此 直 接 回 复 当 前 主 题 ：：： </td>
 </tr>
</table>
   
<a name="re"></a>
<table border="0" width="520" cellspacing="0" cellpadding="2" align="center" class="table004">
 <form method="POST" action="rpost_do.asp" name="form1" onsubmit="return submitOnce()">
  <tr> 
   <td width="19%" align="center" class="table001">发 言 标 题：</td>
   <td width="81%" class="table001"> 
	<input type="text" name="title" size="40" value="Re:<%=title%>" class="input1" maxlength=40>
	<font color="#FF0000">*</font>（标题限制 <b>40</b> 个字符以内）</td>
  </tr>
  
<% if not theUser.reged then %>
	<tr> 
	<td width="19%" align="center" class="table001">发&nbsp; 表&nbsp; 人：</td>
	<td width="81%" class="table001"> 
	<input type="text" name="name" size="20" class="input1" maxlength=20 value="<%=theUser.name%>" >
	<font color="#FF0000">*</font>（名字限制 <b>10</b> 个字符以内）</td>
	</tr>
	<tr> 
	<td width="19%" align="center" class="table001">
	<% if mustReg then
		response.write "密　　　码："
	else
		response.write " 密 码(可选)："
	end if %>
	</td>
	<td width="81%" class="table001"> 
	<input type="password" name="pass" size="15" class="input1" maxlength=10 value="" >
	   <% if mustReg then
	   	response.write "<font color=#FF0000>*</font>（第一次留言自动注册）"
	   else
	   	response.write "（填写密码成为保留用户，名字将被保护）"
	   end if %>
	</td>
	</tr>
	 <tr class="table001"> 
	  <td width="19%" align="center">性　　　别：</td>
	  <td width="81%">
	   <input type="radio" name="male" value="1" checked>男
	   <input type="radio" name="male" value="0" >女
	 （已注册用户不用填）
	  </td>
	 </tr>
	 <tr class="table001"> 
	  <td width="19%" align="center">头　　　像：</td>
	  <td width="81%">
	   <input type="hidden" name="face" value="face/m01.gif">
	   <a href=### onclick=window.open("face.asp","face","width=400,height=400,resizable=1,scrollbars=1") title=点击选择头像>
	   <img src="face/m01.gif" border=0 id="faceImg"></a>
	    （已注册用户不用选）
	  </td>
	 </tr>
	<tr> 
	<td width="19%" align="center" class="table001">电 子 邮 件：</td>
	<td width="81%" class="table001"> 
	<input type="text" name="email" size="20" class="input1" value="" maxlength=30 >
	</td>
	</tr>
	<tr class="table001"> 
	<td width="19%" align="center">　　Q Q　　：</td>
	<td width="81%"> 
	<input type="text" name="qq" size="10" class="input1" maxlength=10 value="">
	ICQ <input type="text" name="icq" size="10" class="input1" maxlength=10 value="">
	MSN <input type="text" name="msn" size="10" class="input1" maxlength=100 value="">
	</td>
	</tr>
	<tr> 
	<td width="19%" align="center" class="table001">主 页 地 址：</td>
	<td width="81%" class="table001"> 
	<input type="text" name="url" size="30" value="http://" class="input1" maxlength=50>
	</td>
	</tr>
<% end if %>
  <tr> 
   <td width="19%" align="center" class="table001">选 择 表 情：</td>
   <td width="81%" class="table001"> 
	<table border="0" width="85%" cellspacing="1" cellpadding="0">
	 <tr> 
	  <td align="center"> 
	   <input type="radio" value="p1.gif" name="pic" checked>
	  </td>
	  <td><img border="0" src="images/p1.gif"></td>
	  <td align="center"> 
	   <input type="radio" value="p2.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p2.gif"></td>
	  <td align="center"> 
	   <input type="radio" value="p3.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p3.gif"></td>
	  <td align="center"> 
	   <input type="radio" value="p4.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p4.gif"></td>
	  <td> 
	   <input type="radio" value="p5.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p5.gif"></td>
	  <td> 
	   <input type="radio" value="p6.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p6.gif"></td>
	  <td> 
	   <input type="radio" value="p7.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p7.gif"></td>
	  <td> 
	   <input type="radio" value="p8.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p8.gif"></td>
	  <td> 
	   <input type="radio" value="p9.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p9.gif" width="15" height="15"></td>
	 </tr>
	 <tr> 
	  <td align="center"> 
	   <input type="radio" value="p10.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p10.gif" width="15" height="22"></td>
	  <td align="center"> 
	   <input type="radio" value="p11.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p11.gif" width="15" height="15"></td>
	  <td align="center"> 
	   <input type="radio" value="p12.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p12.gif" width="15" height="15"></td>
	  <td align="center"> 
	   <input type="radio" value="p13.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p13.gif" width="15" height="15"></td>
	  <td> 
	   <input type="radio" value="p14.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p14.gif" width="15" height="15"></td>
	  <td> 
	   <input type="radio" value="p15.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p15.gif" width="15" height="15"></td>
	  <td> 
	   <input type="radio" value="p16.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p16.gif" width="15" height="15"></td>
	  <td> 
	   <input type="radio" value="p17.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p17.gif" width="15" height="15"></td>
	  <td> 
	   <input type="radio" value="p18.gif" name="pic">
	  </td>
	  <td><img border="0" src="images/p18.gif" width="15" height="15"></td>
	 </tr>
	</table>
   </td>
  </tr>
	 <tr class="table001"> 
	  <td width="19%" align="center"> 
	Ubb标签：
	  </td>
	  <td width="81%" valign="top"> 
<script src=code.js></script>
<div id="ubbDiv"></div>
<IFRAME NAME="ubbFrame" width=0 height=0 marginwidth=0 marginheight=0 frameborder=0 scrolling=no SRC="ubb.htm" ></IFRAME>
	  </td>
	 </tr>
<% if imgUbb then %>
	<tr class="table001"> 
	  <td width="19%" align="center"> 
	Q 帖图：
	  </td>
	  <td width="81%" valign="top"> 
<a href=### onclick=window.open("Qpic.asp?num=20&path=qpic/1","q","width=400,height=400,resizable=1")>Q帖图一</a>
　<a href=### onclick=window.open("Qpic.asp?num=30&path=qpic/2","q","width=400,height=400,resizable=1")>Q帖图二</a>
　<a href=### onclick=window.open("Qpic.asp?num=19&path=qpic/3","q","width=400,height=400,resizable=1")>Q帖图三</a>
	  </td>
	 </tr>
<% end if %>	 
  <tr> 
   <td width="19%" align="center" class="table001"> 
	<p style="line-height: 140%">留<br>
	 言<br>
	 内<br>
	 容 
   </td>
   <td width="81%" valign="top" class="table001"> 
	<textarea rows="6" name="nei" cols="70" class="input1" value="" ></textarea>
   </td>
  </tr>
  <tr> 
   <td colspan="2" class="table001" align=center> 
	&nbsp; &nbsp; &nbsp; &nbsp; 
	<input type="hidden" name="rtid" value="<%=xxid%>">
	<input type="hidden" name="isprivate" value="<%if isPrivate then response.write "1" %>">
	 <input type="submit" value="提交" name="B1" class="input1" >
	 &nbsp; &nbsp; 
	 <input type="reset" value="清除" name="B2" class="input1" >
	 (Ctrl+Enter提交)
   </td>
  </tr>
 </form>
</table>

<% end if 


function pageList()
	dim p
	if page<1 then
		page=1
	end if
	if pagecount<1 then
		pagecount=1
	end if

	pageList=pageList & "<table border=0 width=650 cellspacing=0 cellpadding=3 align=center><tr>"
	pageList=pageList & "<td width=200 style='letter-spacing: 1'>共有回复 <font color=#FF0000>"& RecordCount &"</font> 个，共 <font color=#FF0000>"& pageCount &"</font> 页 </td>"
	pageList=pageList & "<td width=100 style='letter-spacing: 1' align=center>"
	if page=1 then
		pageList=pageList & " <img border=0 src=images/pt.gif alt=留言首页 align=absmiddle>"
	else
		pageList=pageList & " <a href=?id="& xxid &"><img border=0 src=images/pt.gif alt=留言首页 align=absmiddle></a>"
	end if
	
	if page=1 then
		pageList=pageList & " <img border=0 src=images/pb.gif alt=前一页 align=absmiddle>"
	else
		pageList=pageList & " <a href=?id="& xxid &"&page="& (page-1) &"><img border=0 src=images/pb.gif alt=前一页 align=absmiddle></a>"
	end if
	
	if pagecount-page=0 then
		pageList=pageList & " <img border=0 src=images/pn.gif alt=下一页 align=absmiddle>"
	else
		pageList=pageList & " <a href=?id="& xxid &"&page="& (page+1) &"><img border=0 src=images/pn.gif alt=下一页 align=absmiddle></a>"
	end if
	
	pageList=pageList & "</td><td width=350 style='letter-spacing: 1'>"

	p=int(page/pageLinkNum)
	if page mod pageLinkNum>0 then
		p=p+1
	end if
	p=(p-1)*pageLinkNum+1

	i=p+(pageLinkNum-1)
	if i> pagecount then
		i=pagecount
	end if

	if p>pageLinkNum then
		pageList=pageList & "<a href='?id="& xxid &"&page="&p-1&"'>[<<]</a>"
	end if

	do while p<=i
		if p=page then
			pageList=pageList & "["&p&"]"
		else
			pageList=pageList & "<a href='?id="& xxid &"&page="&p&"'>["&p&"]</a>"
		end if
		p=p+1
	loop

	p=p-1
	if p< pagecount then
		pageList=pageList & "<a href='?id="& xxid &"&page="&(p+1)&"'>[>>]</a>"
	end if

	pageList=pageList & "</td></tr></table>"
end function
%>

<!--#include file="foot.asp"-->

</body>

</html>
