kickok.asp

来自「聊天室源码呵呵你好用~~~~~~2.0版本」· ASP 代码 · 共 115 行

ASP
115
字号
<%@ LANGUAGE=VBScript%>
<%Server.ScriptTimeout=600
Response.Expires=0
if Session("a_c_user_name")="" then
 Response.write "<b>[操作失败]</b><p>您尚未登录(或已经超时退出),不能进行此操作!"
 Response.end
end if
if Session("a_c_user_level")<6 then
 Response.Write "<b>[操作失败]</b><p>您没有踢人的权限!"
 Response.End
end if
if NOT(Session("a_c_user_name")="聊天室管理员" or Session("a_c_user_outchat")=0) then
 Response.Write "<b>[操作失败]</b><p>你不在聊天室中,不能踢人!"
 Response.End
end if
username=Server.HTMLEncode(Trim(Request.Form("username")))
kickwhy=Server.HTMLEncode(Trim(Request.Form("kickwhy")))
if kickwhy="" then
 Response.write "<b>[操作失败]</b><p>"
 Response.write "  请输入原因,否则不能执行踢人操作! <a href=javascript:history.go(-1)>【返回】</a>"
 Response.end
end if
if len(kickwhy)>100 then clearwhy=left(kickwhy,100)
Dim all_saysdata(400), user_online()
Application.Lock
saysdata=Application("a_c_all_saysdata")
online=Application("a_c_user_online")
inthechat=Application("a_c_user_inthechat")
uoc=1
kickok=0
for i=1 to inthechat*4 step 4
 if online(i)=username then
  n=Year(date())
  y=Month(date())
  r=Day(date())
  s=Hour(time())
  f=Minute(time())
  m=Second(time())
  if len(y)=1 then y="0" & y
  if len(r)=1 then r="0" & r
  if len(s)=1 then s="0" & s
  if len(f)=1 then f="0" & f
  if len(m)=1 then m="0" & m
  sj=s & ":" & f & ":" & m
  sj2= n & "-" & y & "-" & r & " " & sj
  kick= sj2 & " " & Session("a_c_user_name") & "(" & Request.ServerVariables("REMOTE_ADDR") & ") 把 " & online(i) & "(" & online(i+1) & ") 请出聊天室。【原因:" & kickwhy & "】(" & Application("a_c_user_inthechat") & "人)"
  all_saysdata(1)=1
  all_saysdata(2)=0
  all_saysdata(3)=Session("a_c_user_name")
  all_saysdata(4)="大家"
  all_saysdata(5)="660099"
  all_saysdata(6)="660099"
  all_saysdata(7)="对"
  all_saysdata(8)="<font color=000000>【出局】</font><font color=8800FF><font color=FF0000>" & Session("a_c_user_name") & "</font>恭恭敬敬地把<font color=FF0000>" & username & "</font>请出了聊天室……〖原因:" & kickwhy & "〗</font><font class=p9>(" & sj & ")</font>"
  for j=9 to 400
   all_saysdata(j)=saysdata(j-8)
  next
  kickok=1
  Application("a_c_all_saysdata")=all_saysdata
  Application("a_c_user_inthechat")= Application("a_c_user_inthechat")-1
 else
  Redim Preserve user_online(uoc),user_online(uoc+1),user_online(uoc+2),user_online(uoc+3)
  user_online(uoc)=online(i)
  user_online(uoc+1)=online(i+1)
  user_online(uoc+2)=online(i+2)
  user_online(uoc+3)=online(i+3)
  uoc=uoc+4
 end if
next
Application("a_c_user_online")=user_online
Application.UnLock
if kickok=1 then
dim log()
logfile=server.mappath("logdata.asp")
Set fs=CreateObject("Scripting.FileSystemObject")
Set thisfile=fs.OpenTextFile(logfile,1,False)
countlog=0
do while not thisfile.AtEndOfStream
 thisline=thisfile.readline
 Redim preserve log(countlog)
 log(countlog)=thisline
 countlog=countlog + 1
loop
thisfile.Close
Set outfile=fs.CreateTextFile(logfile)
outfile.WriteLine log(0)
outfile.WriteLine kick
if countlog>500 then countlog=500
for k=1 to countlog-1
outfile.WriteLine log(k)
next
outfile.Close
end if%><html>
<head>
<title>踢人</title>
<style type="text/css">
<!--
.p12 {  font-size: 12pt; line-height: 180%}
.p9 {  font-size: 9pt; line-height: 150%}
a:visited {  text-decoration: none}
a:link {  text-decoration: none}
a:hover {  text-decoration: none}
a:active {  text-decoration: none}
-->
</style>
</head>
<body bgcolor="FFFFFF" link="#0000FF" vlink="#0000FF" alink="#0000FF">
<p><b>[踢人操作完成]</b></p>
<p>您刚才的操作已经记入“聊务公开”栏,供聊友监督:</p>
<blockquote> 
<p class="p9"><font color="FF0000"><%=kick%></font></p>
<p><a href=javascript:history.go(-2)>【返回】</a></p>
</blockquote>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?