重新整理幀,檔案名稱fresh.asp

來源:互聯網
上載者:User
重新整理|檔案名稱 重新整理幀:檔案名稱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
if tsecretly<>"" then  '顯示私聊內容
  response.write thidename
  dispstr=""
  dim temps
  tsecretly=split(tsecretly,"<br>")
  for i=0 to ubound(tsecretly)-1
    tmpstr=split(tsecretly(i),",")
    if instr(thidename,",'"&tmpstr(3)&"'")<1 then dispstr=dispstr&","&replace(tsecretly(i),"<br>","")
  next
  chatdata(sendid,3)=""  '清空私聊內容
end if

tuserpoin=chatdata(sendid,2)  '使用者指標
tchatpoin=chatpoin



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.