<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%
call head()
call Fortxtmsg
Call saycardb("聊天记录")
dim fid
fid=request("fid")
if fid="" or Isnumeric(fid)=False then
if saytk>1 then
  Call Error("ID无效！")
else
  Call Error("ID无效！")
  end if
end if

if saytk=>2 then
Response.write "<form name=""form"" method=""post"" action=""msgaddsave.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&""">"
end if
response.write "<select title='表情' name='face' value='0'>"&chr(13)
response.write "<option title='表情' value='0'>表情</option>"&chr(13)
response.write "<option title='微笑' value='1'>微笑</option>"&chr(13)
response.write "<option title='哭泣' value='2'>哭泣</option>"&chr(13)
response.write "<option title='调皮' value='3'>调皮</option>"&chr(13)
response.write "<option title='脸红' value='4'>脸红</option>"&chr(13)
response.write "<option title='害羞' value='5'>害羞</option>"&chr(13)
response.write "<option title='生气' value='6'>生气</option>"&chr(13)
response.write "<option title='偷笑' value='7'>偷笑</option>"&chr(13)
response.write "<option title='流汗' value='8'>流汗</option>"&chr(13)
response.write "<option title='我倒' value='9'>我倒</option>"&chr(13)
response.write "<option title='得意' value='10'>得意</option>"&chr(13)
response.write "<option title='眦牙' value='11'>眦牙</option>"&chr(13)
response.write "<option title='疑问' value='12'>疑问</option>"&chr(13)
response.write "<option title='睡觉' value='13'>睡觉</option>"&chr(13)
response.write "<option title='好色' value='14'>好色</option>"&chr(13)
response.write "<option title='口水' value='15'>口水</option>"&chr(13)
response.write "<option title='敲头' value='16'>敲头</option>"&chr(13)
response.write "<option title='可爱' value='17'>可爱</option>"&chr(13)
response.write "<option title='猪头' value='18'>猪头</option>"&chr(13)
response.write "<option title='YEAH' value='19'>YEAH</option>"&chr(13)
response.write "<option title='玫瑰' value='20'>玫瑰</option>"&chr(13)
response.write "</select>"&chr(13)
response.write "<input name=""txt"" emptyok=""true"" maxlength=""500"" value=""""/><br/>"
if saytk=>2 then
response.write "<input type=""hidden"" name=""lid"" value="""&fid&"""/>"
%>

<input type="submit" name="Submit" value="快速回复"></form><br/><%

else
Response.write "<anchor>快速回复"
Response.write "<go href='msgaddsave.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"' method='post' accept-charset='utf-8'>"
response.write "<postfield name=""txt"" value=""$(txt)""/>"
response.write "<postfield name=""lid"" value="""&fid&"""/>"
response.write "<postfield name=""face"" value=""$(face)""/>"
response.write "</go></anchor><br/>"
end if
dim username,rs1
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select id,fnr,fid,sid,tou,ftm from guest Where fid="&Fid&" and sid="&myid&" Or fid="&myid&" and sid="&Fid&" order by ftm desc",conn,1,1    
If Not rs.eof Then
	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage			
	gopage="msglist.asp?sid="&sid&"&amp;fid="&fid&"&amp;saytk="&saytk&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
	For i=1 To PageSize     						
	If rs.eof Then Exit For	
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select id,name from users where id="&rs("fid"),conn,1,1
username=rs1("name")
rs1.close
set rs1=nothing
Response.write ""&i+(page-1)*PageSize&"."
Response.write ""&ubb(username)&"["&ubb(rs("ftm"))&"]<br/>"
if rs("tou")<>0 then
response.write "<img src='face/"&ubb(rs("tou"))&".gif' alt=''/>"
end if
Response.write ""&ubb(rs("fnr"))&"<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&"页"
if saytk=1 then
response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a><br/>"
end if
Else
Response.write "没有记录！<br/>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.write "<a href=""mymsg.asp?sid="&sid&"&amp;saytk="&saytk&""">我的信箱</a>"%>
<!--#include file="fanhui.asp"-->
<%call head1()%>