<!--#include file="Connections.asp" -->
<%
Response.Expires=0
id=Request("id")
If id="" or id<0 Then id=0
set guestbook = Server.CreateObject("ADODB.Recordset")
guestbook.ActiveConnection = datalink
guestbook.Source = "SELECT * FROM message Where Id="&id
guestbook.CursorType = 1
guestbook.CursorLocation = 2
guestbook.LockType = 3
guestbook.Open()
Function rp(s)
	s=replace(s,"&","＆")
	rp=s
End Function
If Not Guestbook.Eof Then
Response.Write("&message_id="&guestbook("id"))
Response.Write("&content=")
message="<b>留言人：</b>"&guestbook("name")
message=message&"　<b>来　自：</b>"&guestbook("from")
message=message&"<br><b>QQ：</b>"&guestbook("qq")

If guestbook("email")<>"未知" Then
	message=message&"　<b>Email：</b><a href='mailto:"&guestbook("email")&"'>"&guestbook("email")&"</a>"
Else
	message=message&"　<b>Email：</b>"&guestbook("email")
End If	
If guestbook("homepage")<>"未知" Then
	message=message&"　<b>Homepage：</b><a href='"&guestbook("homepage")&"' target='_blank'>"&guestbook("homepage")&"</a>"
Else
	message=message&"　<b>Homepage</b>："&guestbook("homepage")
End If

message=message&"<br><b>时　间：</b>"&guestbook("sdate")&"　"&guestbook("stime")

message=message&"<br><b>标　题：</b>"&guestbook("title")
message=message&"<br><b>内　容：</b><br>"&guestbook("content")
message=message&"<br>-----------------------------------------------------------------------------------"

set revert = Server.CreateObject("ADODB.Recordset")
revert.ActiveConnection = datalink
revert.Source = "SELECT * FROM revert Where message_id='"&Cstr(id)&"'"
revert.Open()

While Not revert.Eof

	js=js+1
	message=message&"<br><b>回复人"&js&"：</b>"&revert("name")
	message=message&"　<b>来　自：</b>"&revert("from")
	message=message&"<br><b>QQ：</b>"&revert("qq")

	If revert("email")<>"未知" Then
		message=message&"　<b>Email：</b><a href='mailto:"&revert("email")&"'>"&revert("email")&"</a>"
	Else
		message=message&"　<b>Email：</b>"&revert("email")
	End If	
	If revert("homepage")<>"未知" Then
		message=message&"　<b>Homepage</b>：<a href='"&revert("homepage")&"' target='_blank'>"&revert("homepage")&"</a>"
	Else
		message=message&"　<b>Homepage</b>："&revert("homepage")
	End If	
	message=message&"<br><b>时　间：</b>"&revert("revertdate")&"　"&revert("reverttime")

	message=message&"<br><b>标　题：</b>"&revert("title")
	message=message&"<br><b>内　容：</b>"&revert("content")

If Session("action_pwd")<>"" Then message=message&"<br><br><a href='del_revert.asp?id="&revert("id")&"'target='footer'>删除该回复</a>"

	message=message&"<br>-----------------------------------------------------------------------------------"
	revert.MoveNext()


Wend
Response.Write(message)
End If
guestbook("js")=guestbook("js")+1
guestbook.Update
guestbook.Close()
revert.Close()
%>