日期:2013-05-19  浏览次数:20778 次

刷新帧:文件名fresh.asp

<%
Option Explicit
dim msg,tmsg,ws,action,user,whoto,tcolor,kicklist,chatpoin,chatcomm,chatdata,sendid,i,reciid
dim tsecretly,thidename,dispstr,tchatpoin,tuserpoin,tchatcomm,j

dim sendname,address1,reciname
user=request("user")
whoto=request.form("whoto")
tmsg=request.form("SAYS")
tmsg=replace(tmsg,"\","\\")
tmsg=replace(tmsg,",","\,")
tmsg=replace(tmsg,"<","<")    '屏蔽所有的Html标记
tmsg=replace(tmsg,"<img","<img")   '放开<img标记
tmsg=replace(tmsg,"<b","<b")   '放开<b标记
if request.form("ws")="on" then
  ws=true
else
  ws=false
end if

kicklist=application("kicklist")
'是否被踢用户
if instr(kicklist,"'#"&user&"'")>0 then
  response.write "<script>parent.top.location='kickout.htm';</script>"
  response.end
end if
if instr(kicklist,"'"&Request.ServerVariables("remote_addr")&"'")>0 then
  response.write "<script>parent.top.location='kickout.htm';</script>"
end if
chatpoin=application("chatpoin")  '聊天室指针
chatcomm=application("chatcomm")  '聊天室内容
chatdata=application("chatdata") '聊天室用户数据
sendid=-1
reciid=-1
for i=0 to 50
  if chatdata(i,0)=user and chatdata(i,1)=Request.ServerVariables("remote_addr") then sendid=i '注意,在些检查IP地址,预防被穿墙
  if chatdata(i,0)=whoto then reciid=i
next
if sendid=-1 then
  response.write "用户没有进入聊天室"
  response.end
end if
chatdata(sendid,4)=(chatdata(sendid,4) mod 104) '置标志,预防被自动踢出聊天室
msg=right(time,8)&","&user&","&request.form("action")&","&whoto&","&request.form("color")
if ws then
msg=msg&",1"
else
msg=msg&",0"
end if
msg="'"&msg&","&tmsg
if reciid=-1 and whoto<>"所有人" then ws=true:reciid=sendid:msg=msg&"<font color=red>("&whoto&"不在此聊天室)</font>"
msg=msg&"'<br>"
if tmsg<>"" then
  if ws then '耳语
  if whoto<>"所有人" then chatdata(sendid,3)=chatdata(sendid,3)&msg
  if reciid<>-1 and sendid<>reciid then  chatdata(reciid,3)=chatdata(reciid,3)&msg
   application.lock
     application("chatdata")=chatdata
   application.unlock
  end if
  if not ws or ws and whoto="所有人" then  '属于全部人的数据
    if chatpoin=49 then
       chatpoin=0  '数组回头,循环调用
       call checkname
    else
       chatpoin=chatpoin+1
    end if
    chatcomm(chatpoin)=msg   '将内容写进application内
    application.lock
      application("chatcomm")=chatcomm  
      application("chatpoin")=chatpoin
    application.unlock
  end if
end if

%><meta http-equiv="refresh" content="3; URL=refresh.asp?user=<% =user %>"><%
tsecretly=chatdata(sendid,3)  '取私聊内容
thidename=chatdata(sendid,5)  '取隐藏名单
dim tmpstr<