<%
response.Charset="UTF-8"
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%><!--#include file="inc/config.asp"--><!--#include file="inc/conn.asp"--><%
Mess=request("Mess")
Color=request("color")
N=request("N")
H=int(request("H"))
U=int(request("U"))
if N="" or H="" or U="" then
closeconn()
Response.End
end if
if Mess<>"" then
rs.Open "select * from XH_Message",conn,1,3
Application.Lock
rs.addnew
rs("XH_Uid")=H
rs("XH_SendUser")=N
rs("XH_Content")="<font color="&Color&">"&Mess&"</font>"
rs("XH_SendUid")=U
rs.update
rs.close
conn.execute("update XH_Player set XH_NewMsg=XH_NewMsg+1 where ID="&H&"")
Application.Unlock
end if
NewNum=0
rs.open "select top 20 * from XH_Message where (XH_Uid="&U&" and XH_SendUid="&H&") or (XH_Uid="&H&" and XH_SendUid="&U&") order by id desc",conn,1,3
if rs.eof then
Content="<div class='TalkName_Me'>聊天小贴士  ("&now()&")</div><div class='TalkList'>交谈中请勿轻信汇款、中奖消息，勿轻易拨打陌生电话。</div><div class='TalkName'>系统消息  ("&now()&")</div><div class='TalkList'>已成功连接并建立通话。</div>"
else
do while not rs.eof
if rs("XH_NewMsg")=0 and rs("XH_Uid")=U then
NewNum=NewNum+1
rs("XH_NewMsg")=1
conn.execute("update XH_Player set XH_NewMsg=XH_NewMsg-1 where ID="&U&"")
rs.update
end if
if rs("XH_SendUid")=U then
Nhtml="<div class='TalkName_Me'>"
else
Nhtml="<div class='TalkName'>"
end if
Content=Nhtml&rs("XH_SendUser")&"　("&rs("XH_SendTime")&")</div><div class='TalkList'>"&rs("XH_Content")&"</div>"&Content
rs.movenext
loop
end if
rs.close
closeconn()
Response.Write Content
%>
