<!-- #include file="Inc/Inc.asp" -->
<!-- #include file="Inc/Function.asp" -->
<%'============================================================
'==
call ling()
call head()
dim id,pass,p
id=request.QueryString("id")
if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
  end if
pass=request("pass1")
p=cint(request.QueryString("p"))
if p="" or p<1 then p=1
Call saycardd("阅读留言")
'-------A登录信息
if myid=0 then
Response.write "欢迎您:<a href='login.asp?saytk="&saytk&"'>登陆/注册</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?sid="&sid&"&amp;saytk="&saytk&"'>您有"&newguest&"条新消息</a><br/>"& chr(13)
end if
end if
'---------------------------
dim rs,rspr,rsn
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [gbook] where [ID]=" & ID,conn,1,1

set rsn=Server.CreateObject("ADODB.Recordset")
rsn.open"select * from [gbook] where [ID]<"& ID &" order by [ID] desc",conn,1,1
set rspr=Server.CreateObject("ADODB.Recordset")
rspr.open"select * from [gbook] where [ID]>"& ID &" order by [ID] asc",conn,1,1

if rs.EOF then
response.write("无此留言！<br/>")
else
if rs("uid")=0 then
response.write"作者："&ubb(rs("name"))&"<br/>"    
else
response.write"作者：<a href=""bbs/uinfo.asp?id="&rs("uid")&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"&ubb(rs("name"))&"</a><br/>"
end if
  
response.write(UBB2(rs("text")) & "<br/>")

response.write("时间：" & fordate(rs("YD_time")) & "<br/>")
if rs("retext")<>"" then


response.write"回复："&UBB(rs("retext"))&"<br/>"

response.write"时间："&rs("retime")&"<br/>"
end if
if rsn.recordcount>0 then response.write("<a href='guestview.asp?id=" & rsn("ID") & "&amp;p=" & p & "&amp;sid="&sid&"&amp;saytk="&saytk&"'>下条</a>&nbsp;")
if rspr.recordcount>0 then response.write("<a href='guestview.asp?id=" & rspr("ID") & "&amp;p=" & p & "&amp;sid="&sid&"&amp;saytk="&saytk&"'>上条</a>&nbsp;")
if rsn.recordcount>0 or rspr.recordcount>0 then response.write("<br/>")
rsn.close
set rsn=nothing
response.write"----------<br/>"
rspr.close
set rspr=nothing
end if
conn.close
set conn=nothing
response.write"<a href=""guestbook.asp?p="&p&"&amp;sid="&sid&"&amp;saytk="&saytk&""">返回上级</a><br/>"
response.write"<a href=""index.asp?sid="&sid&"&amp;saytk="&saytk&""">返回首页</a><br/>"
call head3()
%>