<!--#Include FILE="WapConfig/WapHeader.asp"-->
<%
'以下为文件正文。
'以下是数据库的设置信息
Dim GuestID : GuestID=Request.QueryString("GuestID") 
If GuestID<>"" Then Session("GuestID")=GuestID  Else GuestID= Session("GuestID") 
XML.StrSql="Select * from SQ_GuestBook where GuestID=" & GuestID
'显示标题
XML.WriteOut "<h2>" & XML.MdbShow("GuestTitle") & "</h2>"
XML.WriteOut "<ul><li>"
If XML.MdbShow("GuestType")=0 Then XML.WriteOut "游客:" Else XML.WriteOut "用户:" 
ShowContent=XML.MdbShow("GuestName") & " 浏览:" & XML.MdbShow("Hits") & "次 " & "<br/>-----<br/>"
ShowContent=ShowContent & XML.MdbShow("GuestContent") & "[" & XML.MdbShow("GuestDatetime") & "]"
XML.MorePage XML.DelHtml(ShowContent),TextLong,True

'以下为回复言论
XML.RsInfoPlace="none"
XML.StrSql="Select * From SQ_GuestBook where TopicID=" & GuestID & " And TopicID<>GuestID And GuestIsPassed=True ORDER BY OnTop DESC,LastReplyTime DESC,guestid ASC"
XML.MdbDo
If XML.RecordCount>0 Then 
	XML.WriteRow "<b>以下为回复:</b><br/>-----"
	XML.WriteOut XML.MdbMultiList("GuestTitle GuestName GuestContent"," ","标题： 用户： 内容：","<br/> <br/> <br/>")
End If
'更新浏览次数
XML.StrSql="Update SQ_GuestBook set Hits=Hits+1 Where GuestID=" & GuestID
XML.MdbDo
'以下关于上一条、下一条记录
XML.RsInfoPlace="None"
XML.ErrorPagePath=""
XML.FieldId="GuestID"
XML.FieldShow="GuestTitle"
XML.GoFileName="GuestBookShow.asp"
If Session("ListOrder")="" Or Lcase(Session("ListOrder"))="desc" Then
	XML.WriteOut "下："
	XML.StrSql="Select Top 1 * from SQ_GuestBook where GuestID<" & GuestID & " And GuestIsPassed=True And TopicID=GuestID ORDER BY OnTop DESC,LastReplyTime DESC,guestid DESC"
	XML.MdbList : If XML.RecordCount<1 Then XML.WriteRow "无"
	XML.WriteOut "上："
	XML.StrSql="Select Top 1 * from SQ_GuestBook where GuestID>" & GuestID & " And GuestIsPassed=True And TopicID=GuestID ORDER BY OnTop DESC,LastReplyTime DESC,guestid Asc"
	XML.MdbList : If XML.RecordCount<1 Then XML.WriteRow "无"
Else
	XML.WriteOut "下："
	XML.StrSql="Select Top 1 * from SQ_GuestBook where GuestID>" & GuestID & " And GuestIsPassed=True And TopicID=GuestID ORDER BY OnTop DESC,LastReplyTime DESC,guestid Desc"
	XML.MdbList : If XML.RecordCount<1 Then XML.WriteRow "无"
	XML.WriteOut "上："
	XML.StrSql="Select Top 1 * from SQ_GuestBook where GuestID<" & GuestID & " And GuestIsPassed=True And TopicID=GuestID ORDER BY OnTop DESC,LastReplyTime DESC,guestid Asc"
	XML.MdbList : If XML.RecordCount<1 Then XML.WriteRow "无"
End If
XML.WriteOut "</li></ul>"
'以下为返回链接等
XML.WriteOut XML.Div(,,"N")
XML.WriteRow XML.ImgA("","GuestBook.asp?Page=" & Session("MyPage"),"返回上级")
%>
<!--#Include FILE="WapConfig/WapFooter.asp"--> 
