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

📄 mes_index.asp

📁 在线考试系统
💻 ASP
字号:
<%@ Language=VBScript %>

<% option explicit %>

<!-- #include file="conn_webqq.asp" -->
<!-- #include file="inc_session.asp" -->

<%
	dim uid
	uid=GetSession()

	if uid="" then
		closeconnq
		Response.Redirect "mes_LOGIN.ASP"
		Response.End
	end if


	'//Delete offline user
	'//check the last deleted time, whether enough 3 minutes
	dim dCheck
	dim dOld

	dOld=DateAdd("n", -3, Now())

	dim Rs
	set Rs=Server.CreateObject ("ADODB.Recordset")

	dim bDelete
	bDelete=0

	Rs.Open "tConfig",connq,3 ,3
	if rs.BOF and rs.EOF then
		dCheck=dOld
	else
		dCheck=CDate(Rs("LastCheckTime"))
	end if

	if dCheck <= dOld then
		Rs("LastCheckTime")=Now()
		Rs.Update
		Rs.Close
		bDelete=1
	else
		Rs.Close
	end if

	'//it's time to delete old online users now
	if bDelete=1 then
		'//delete offline users.
		connq.execute "DELETE * FROM tOnline WHERE (activetime < #" & dOld & "#)"
	end if

	'//Update me
	dim iMesCount
	Rs.Open "SELECT * FROM tOnline WHERE uid='" & uid & "'",connq,1,3

	if rs.BOF and rs.EOF then
		'//relogin
		Rs.Close
		set Rs=nothing
		closeconnq

		Response.Redirect "mes_LOGIN.ASP"
		Response.End
	else
		iMesCount=Rs("messagecount")
		Rs("activetime")=Now()
		Rs.Update
	end if

	Rs.Close
	'-------------------------------------------------------------------

%>


<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>WebQQ</title>
<link rel="stylesheet" type="text/css" href="../main.css">
</head>

<SCRIPT language=JavaScript>

setTimeout("refreshwindow()",60000);

//refresh window
function refreshwindow()
{
window.location = "mes_INDEX.ASP";
}

//set focus window so POPUP me
function popup()
{
	window.focus();
}
</SCRIPT>

<body bgcolor="#D4D0C8">

<table border="0" width="100%" height="330" bgcolor="#687088">
  <tr>
    <td width="100%" height="300" valign="top" bgcolor="#FFFFFF">
      <table border="0" width="100%">
        <tr>
          <td width="18%"><img border="0" src="images/logo_qq.gif"></td>
          <td width="47%"><b><%=uid%></b></td>
          <td width="35%" align="right"><a href="mes_login.asp?relogin=1">重登录</a> <a href="mes_downline.asp"> 退出</a></td>
        </tr>
        <tr>
          <td width="18%" height="1"><img border="0" src="images/dotline.gif"></td>
          <td width="47%" height="1" bgcolor="#FFCC00"><img border="0" src="images/dotline.gif"></td>
          <td width="35%" height="1" bgcolor="#ECE9AC"><img border="0" src="images/dotline.gif"></td>
        </tr>
      </table>


      <!-- display message -->

      <table border="0" width="100%">
        <tr>
          <td width="100%">&nbsp;</td>
        </tr>
        <tr>
          <td width="100%" bgcolor="#9298AB" height="25">

			<%
		dim oldMesCount
		if IsEmpty(Session("MesCount")) then
			oldMesCount=0
		else
			oldMesCount=Clng(Session("MesCount"))
		end if
		
		if iMesCount>0 then
			'have message
			%>
			<img border="0" src="images/message.gif" width="19" height="14">
			<font color="#000000">你有 <%=iMesCount%> 条信息</font>    
			<%
			if iMesCount>oldMesCount then
			%>
			<SCRIPT language=JavaScript>
				setTimeout("popup()",3000);
			</SCRIPT>
			<%
			end if
			Session("MesCount")=iMesCount
		else
			'no message
			%>
			<font color="#EEEEEE">当前没有新信息</font>    
			<%
			Session("MesCount")=0
		end if
		%>
			
          </td>
        </tr>
        <tr>
          <td width="100%" align="right">

<%
	if iMesCount>0 then
	%>
            <table border="0" width="100%">
		<%
		Rs.Open "SELECT * FROM tMessage WHERE receiver='" & uid & "'",connq,1,1

		If not(rs.BOF and rs.EOF) then
			rs.MoveLast
			rs.MoveFirst

			do
			%>
              <tr>
                <td width="10%">
                	<a href="../viewinfo.asp?uid=<%=rs("sender")%>" target="_blank">
                	<% if rs("sendersex")=1 then %>
                	<img border="0" src="images/boy.gif" width="16" height="16">
                	<% else %>
                	<img border="0" src="images/girl.gif" width="16" height="16">
                	<% end if %>
                	</a>
                </td>
                <td width="80%">
                	<a href="mes_view.asp?sender=<%=rs("sender")%>">
                	<%=rs("sender")%>
					</a>
                </td>
                <td width="10%"></td>
              </tr>
	<%
				rs.MoveNext
			loop until(rs.EOF)
		end if
		rs.Close
	%>

            </table>

			<br><a href="mes_view.asp"><img border="0" src="images/to.gif">查看全部</a><br>
	<%
	end if
%>

          </td>
        </tr>
      </table>




      <!-- display online member -->

      <table border="0" width="100%">
        <tr>
          <td width="100%">&nbsp;</td>
        </tr>
        <tr>
          <td width="100%" bgcolor="#9298AB" height="25"><font color="#000000"><img border="0" src="images/users.gif"> 在线会员</font></td>
        </tr>
      </table>

      <table border="0" width="100%">
        <tr>
          <td width="10%"></td>
          <td width="80%"></td>
          <td width="10%"></td>
        </tr>

<%
	rs.Open "SELECT * FROM tOnline",connq,1,1

	if not(rs.BOF and rs.EOF) then
		rs.MoveFirst
		do
	%>

        <tr>
          <td width="10%">
			<a href="../viewinfo.asp?uid=<%=rs("uid")%>" target="_blank">
          	<% if rs("sex")=1 then %>
          		<img border="0" src="images/boy.gif" width="16" height="16">
          	<% else %>
          		<img border="0" src="images/girl.gif" width="16" height="16">
			<% end if %>
			</a>
			</td>
          <td width="80%">
          <a href="mes_write.asp?receiver=<%=rs("uid")%>&reply=0"><%=rs("uid")%></a>
          </td>
          <td width="10%">
          <%
          if uid="admin" then
          	response.write " (" & rs("IP") & ")"
          end if
		  %>
          </td>
        </tr>

	<%
			rs.MoveNext
		loop until(rs.EOF)
	end if

	rs.Close
%>

      </table>

      <p align="right">
		<a href="mes_write.asp"><img border="0" src="images/to.gif">发送信息</a>
      </p>
      </td>
  </tr>
</table>

<input type="hidden" name="time" value="<%=now%>">

</body>

</html>

⌨️ 快捷键说明

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