<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock

set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))

set cschat=nothing
application.unlock
if  my_level-application( ConstStr & "_superlevel")<>0 then response.end


says=application( ConstStr & "_says")
current=application( ConstStr & "_current")

selwho=request("selwho")

if IsNumeric(request("n")) then
  n=cint(request("n"))
else
  n=50
end if

new_say="''"
for i=current to 0 step -1
  if n<=0 then exit for
  if (says(i,1)=selwho or says(i,2)=selwho) and says(i,3)=1 and says(i,4)>0 then
    new_say="-1,"&says(i,5)&new_say
    n=n-1
  end if
next
for i=UBound(says) to current+1 step -1
  if n<=0 then exit for
  if (says(i,1)=selwho or says(i,2)=selwho) and says(i,3)=1 and says(i,4)>0 then
    new_say="-1,"&says(i,5)&new_say
    n=n-1
  end if
next

response.write "<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'><META content='text/html;charset=gb2312' http-equiv=content-type>"
if new_say<>"''" then
 response.write "<script>parent.addsay("&new_say&");</script>"
else
 response.write "<script>alert('没有找到关于此人的私聊发言！');</script>"
end if

application.unlock%>