⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbsautosearch.asp

📁 来自中国老乡录的一套交友系统
💻 ASP
字号:
<%@ Language=VBScript %>
<!-- #include virtual = "/general/Gen.inc" -->

<% Response.Buffer = True %>

<%Set Conn=Server.CreateObject("ADODB.Connection")
Set Rs=Server.CreateObject("ADODB.Recordset")
Conn.ConnectionTimeout=20
Conn.Open "laoxiang","lx","mailyard"


%>
<%
'*****************************]
user=split(application("OnlineUser"),",") '获得在线用户列表
application(Session("User_ID")&"_Time")=now()

'for i=0 to ubound(user) '获得非空的在线用户列表
 ' if  minute(now)-minute(cdate(application(user(i))))>=5 or ( minute(now)- minute(cdate(application(user(i))))<0 and (minute(now)+60-minute(cdate(application(user(i)))))>=5) then
     
  ''    Application.Lock 
     ' Response.Write application("OnlineUser")&"<br>"
    ''if  i=0 then
   ' Response.Write user(i)&"<br>"
      ' application("OnlineUser")=replace(application("OnlineUser"),user(i),"")
       ' Response.Write application("OnlineUser")&"<br>"

    'else
        'Response.Write user(i)
'
 '      User_ID=","&User_ID
  '    application("OnlineUser")=replace(application("OnlineUser"),user(i),"")
   '           Response.Write application("OnlineUser")&"<br>"

    'end if
    'Application.UnLock 
  'end if
 ' next
  
  for i=0 to ubound(user) '获得非空的在线用户列表
  if  minute(now)-minute(cdate(application(user(i)&"_Time")))>=1 or ( minute(now)- minute(cdate(application(user(i)&"_Time")))<0 and (minute(now)+60-minute(cdate(application(user(i)&"_Time"))))>=1) then
      Application.Lock 
    if  i=0 then
	  'User_ID=User_ID
       application("OnlineUser")=replace(application("OnlineUser"),user(i),"")
       
       User_zx="否"
       cw_ID=user(i)
       SQLQuery="Update Customer Set User_xz_Time="
SQLQuery=SQLQuery&SqlStr(CStr(Now))&","

SQLQuery=SQLQuery&"User_zx="&SqlStr(User_zx)
SQLQuery=SQLQuery&" Where User_ID="&SqlStr(cw_ID)
'Response.Write SQLQuery
conn.Execute SQLQuery
    else
       'User_ID=","&User_ID
      application("OnlineUser")=replace(application("OnlineUser"),user(i),"")
            User_zx="否"
       cw_ID=user(i)
       SQLQuery="Update Customer Set User_xz_Time="
SQLQuery=SQLQuery&SqlStr(CStr(Now))&","

SQLQuery=SQLQuery&"User_zx="&SqlStr(User_zx)
SQLQuery=SQLQuery&" Where User_ID="&SqlStr(cw_ID)
'Response.Write SQLQuery
conn.Execute SQLQuery
    end if
    
    Application.UnLock 
  end if
next
  
  
  
 user=split(application("OnlineUser"),",") '获得在线用户列表
' Response.Write application("OnlineUser")&"<br>"
for i=0 to ubound(user) '获得非空的在线用户列表
 if user(i)<>"" then
nowcount=nowcount+1 '统计在线人数
   if trim(temp)="" then
       temp=user(i)
   else
       temp=temp+","+user(i)
   end if
 end if
next
if trim(temp)<>"" then
  Application.Lock 
  application("OnlineUser")=temp '重新整理在线用户列表
  Application.UnLock 
end if
%>
<%
dim quit
'**************************
'开始分析处理“传呼信息队列”中的信息,并分割出来是自己的信息
if trim(application("Message"))<>"" then
   msg=split(application("Message"),"&")  '分割得到传呼信息区,并保存到数组
   for i=0 to ubound(msg)
     if instr(1,trim(msg(i)),trim(session("user_id")))>=1 then
       mymsg=split(msg(i),"$")  '分割得到每个传呼信息区的详细信息
       if trim(mymsg(0))=trim(session("user_id")) then  '这条传呼信息是发给我的!
          msgok=1'有人呼叫我的表记置为1
          from=trim(mymsg(2))  '获得传呼的详细内容
          content=trim(mymsg(1))
          sendto=trim(mymsg(0))
       end if
     end if
   next
end if
'****************************
quit=0
if (trim(session("User_ID"))="" or instr(1,application("OnlineUser"),session("User_ID"))<1) and trim(session("User_ID"))<>"guest" then
      quit=2
else
     if trim(application("OnlineUser"))="" then
         counts=0
     else  
        counts=ubound(split(application("OnlineUser"),","))+1
     end if  
end if
%>
<HTML>
<HEAD>
<meta HTTP-EQUIV="refresh" CONTENT="20;URL=bbsAutoSearch.asp" >
<script language=javascript>
function window_onload()
{
//**************
//在这里就调用了“显示传呼信息”的页面进行信息的显示
<%if msgok=1 then%>
   mail="     网 络 传 呼 机\n\n"+"<%=from%>"+"对您说:\n\n"+"<%=content%>";
sendinfo=window.open("bbssendinfo.asp?userid=<%=Session("User_ID")%>","SendInfo","toolbar=no,width=360,height=200,top=0,left=0");
<% end if%>
//**************
//如果当前用户超时,就踢出系统
<%if quit=1 then%>
  alert("由於超时或者操作非法而退出系统,请您重新登录!");
  document.kickout.target="_top";
  document.kickout.submit();
<%end if%>
}
</script>
</HEAD>
<BODY style="BACKGROUND-color:#ccccff" onload="javascript:window_onload()">
<%
if quit=1 then%>
<center>
  超时或者操作非法!
</center>
<%else%>
 <%if session("User_ID")<>"guest" then%>
  <center>
   目前在线用户:<font color=red><b><%=counts%></b></font>人
  </center>
 <%else%>
  <center>
   注册用户才可发表文章.
  </center>
 <%end if%>
<%end if%>
<form name=kickout method=post action="main.asp"></form>
</BODY>
</HTML>

⌨️ 快捷键说明

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