<!--#include file="inc.asp"-->
<!--#include file="ydzq.asp"-->
<%call head()

dim ids
ids=request("ids")
if ids="" or isnumeric(ids)=False then
call Error("<card title=""出错""><p>ID无效！")
end if
dim username
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "SELECT name from Users where ID = " & IDs,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("<card title=""出错""><p>没有这个会员！")
end if
username=rs("name")
rs.close
set rs=nothing

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from myhait where jid="&ids&" and bid="&myid,conn,1,1
if not rs.eof then
  Call Error("<card title=""出错""><p>对方已把你加为黑名单！")
  end if
rs.close
set rs=nothing
Call saycarda("给"&username&"写留言")

dim content,act
content = request("content")
act = request("act")
if act<>"" then
num=request("num")
if num="" or num="0" then num=10
if content="" then
  conn.close
  set conn=nothing
  response.write "留言内容不能为空！"
  Response.Write "<br/><anchor><prev/>返回</anchor>"
  Response.Write "</p></card></wml>"
  Response.End
end if
if len(content)>200 then
  response.write "留言内容最多200字！"
  conn.close
  set conn=nothing
  Response.Write "<br/><anchor><prev/>返回</anchor>"
  Response.Write "</p></card></wml>"
  response.end
end if

  set rs=server.CreateObject("ADODB.RecordSet")
  rs.open "select * from usbook",conn,1,2
  rs.addnew
  rs("fid")=myid
  rs("usid")=ids
  rs("fname")=myni
  rs("content")=content
  rs("num")=num
  rs("ftime")=now()
  rs.update
  rs.close
  set rs=nothing

%>
留言成功！
<%else
dim faceid
faceid=request("faceid")
if saytk=>2 then
	Response.write "<form name=""form"" method=""post"" action=""myreadadd.asp?act=ok&amp;IDs="&IDs&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"
end If
if faceid<>"" Then

%>
留言内容: <br/><input emptyok="true" name="content" value="(img)face2/<%=faceid%>.gif(/img)"/><br/>
<%else%>
留言内容: <br/><input emptyok="true" name="content" value=""/><br/>
  <%end if%>
<%if abs(ids)=myid then%>
  是否置顶:
  <select name="num" value="0">
  <option title="非置顶" value="0">非置顶</option>
  <option title="置顶" value="1">置顶</option>
  </select><br/>
  <%end If
  if saytk=>2 then
%>
<input type="submit" name="Submit" value="确定留言"></form><%
else%>
<anchor>确定留言<go href="myreadadd.asp?act=ok&amp;ids=<%=ids%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>" method="post" accept-charset="utf-8">
<postfield name="content" value="$(content<%=tt%>)"/>

<br/>

<%if abs(ids)=myid then%>
<postfield name="num" value="$(num)"/>
<%end if%>
</go></anchor>
<%End if%>
<a href="myreadface.asp?ids=<%=ids%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>">选择表情</a>
<%end if%>
<br/><a href="myread.asp?ids=<%=ids%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>">[返回上级]</a>
<%Call headsay()%>