%Response.Buffer=true
response.expires=0
application.lock
myname=Session("myname")
myid=Session("myid")
ISexit=false
call get_guests
if myname="" or myid="" then
ISexit=true
elseif myname<>guests(myid,0) or Session("mytemp")<>guests(myid,1) then
ISexit=true
end if
if ISexit then
response.write ""
response.end
end if
room_id=guests(myid,5)
if guests(myid,7)=1 then
guests(myid,7)=0
call put_guests
response.write ""
else
if request("sayid")<>"" then
sayid=request("sayid")
else
sayid=guests(myid,10)
end if
call get_says
new_say="''"
getcall=false
for i=current to 0 step -1
if (says(i,0)-sayid)<=0 then exit for
if (says(i,4)=room_id or says(i,4)<-1) and ((not says(i,3)) or says(i,1)=myname or says(i,2)=myname) and instr(guests(myid,12)," "&says(i,1)&" ")=0 then new_say=says(i,0)&","&says(i,5)&new_say
if says(i,4)=-1 and says(i,2)=myname then getcall=true
next
for i=MaxTalk to current+1 step -1
if (says(i,0)-sayid)<=0 then exit for
if (says(i,4)=room_id or says(i,4)<-1) and ((not says(i,3)) or says(i,1)=myname or says(i,2)=myname ) and instr(guests(myid,12)," "&says(i,1)&" ")=0 then new_say=says(i,0)&","&says(i,5)&new_say
if says(i,4)=-1 and says(i,2)=myname then getcall=true
next
response.write ""
guests(myid,6)=now()
guests(myid,10)=says(current,0)
call put_guests
end if
application.unlock%>