<!-- #include file="Inc/Inc.asp" -->
<!-- #include file="Inc/Function.asp" -->
<%call head()
Call saycardd("查看评论")


'-------A登录信息
if myid=0 then
Response.write "欢迎您:<a href='login.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"'>登陆/注册</a><br/>----------<br/>"& chr(13)
else

'检查有几条新留言
dim newguest
newguest = 0
IF myid > 0 THEN
  newguest = ForNewGuest(myid)
END IF
if newguest > 0 then
Response.write "<a href='bbs/msgview.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"&amp;sid="&sid&"'>您有"&newguest&"条新消息</a><br/>"& chr(13)
end if
end if
'---------------------------
dim ids,id,p
ids=trim(request.QueryString("class"))
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
  end if
id=trim(request.QueryString("id"))
if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
  end if
p=trim(request.QueryString("p"))
if p="" or IsNumeric(p)=False then p=1
if saytk=>2 then
Response.write "<form name=""form"" method=""post"" action=""listbbs.asp?id="&id&"&amp;class="&ids&"&amp;p="&p&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"
end if%>
<input type="text" name="pl" title="输入内容" value="" maxlength="50"/><br/>
<%if saytk=>2 then
response.write "<input type=""submit"" name=""Submit"" value=""发表评论""></form><br/>"
else
%>
<anchor title="确定">发表评论
<go method="post" href="listbbs.asp?id=<%=id%>&amp;class=<%=ids%>&amp;p=<%=p%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>">
<postfield name="pl" value="$(pl)"/>
</go></anchor><br/><%End if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from pl where smsid="&id&" order by id desc",conn,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=5					
	Dim Count,page,pagecount,gopage			
	gopage="pilist.asp?id="&id&"&amp;p="&p&"&amp;sid="&sid&"&amp;"
	Count=conn.execute("Select count(ID) from [pl] where smsid="&id&"")(0)	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
	rs.move(pagesize*(page-1))					
	For i=1 To PageSize						
	If rs.eof Then Exit For	
response.write "["&i+(page-1)*PageSize&"楼]."
if rs("uid")=0 then
response.write""&ubb(rs("ip"))&"说:<br/>"    
else
response.write"<a href=""bbs/uinfo.asp?id="&rs("uid")&"&amp;sid="&sid&""">"&ubb(rs("ip"))&"</a>说:<br/>"
end if
response.write rs("pl")&"("&fordate(rs("pltime"))&")<br/>"
rs.moveNext							
Next
if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">[GO]</a><br/>"
Else
response.write"暂时没有评论！<br/> "
end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>
<a href='article.asp?id=<%=id%>&amp;class=<%=ids%>&amp;p=<%=p%>&amp;sid=<%=sid%>'>返回上级</a><br/>
<a href='index.asp?sid=<%=sid%>'>返回首页</a>
<br/>


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

<%
call headsay()
%>