<!--#include file="inc/htmlencode.asp" -->
<%
Sub online()
if datediff("s",session("reonline"),now())<=30 then
exit sub
else
session("reonline")=now()
end if

	Dim oRs,loc,ondegree
	if membername="" then
	set oRs=conn.execute("select * from online where ip='"&Request.ServerVariables("Remote_Addr")&"' and userid='客人'")
	if oRs.eof and oRs.bof Then
	sql="insert into online(userid,ip,location) values "&_
				"('客人','"&Request.ServerVariables("Remote_Addr")&"','校友录首页')"
			conn.execute(sql)
	end if
	set oRs=nothing
	end if
	if membername<>"" Then
	
	Conn.Execute("delete from online where ip='"&Request.ServerVariables("Remote_Addr")&"' and userid='客人'")
	
		Set oRs = Server.CreateObject("ADODB.Recordset")
		sql="Select userid from online where userid='"&membername&"'"
		oRs.open sql,conn,1,1
		if oRs.eof and oRs.bof Then
''''''''''''''''
	if SysAdmin then 
	ondegree=9
	else
	sql = "select count(id),max(degree) from joinclass where userid='"&membername&"'"
	Set Rs=conn.execute(sql)
	if rs.bof or rs.eof then
	ondegree=0
	elseif rs(0)<=0 then
	ondegree=0
	else
	ondegree=rs(1)
	end if
	Set Rs=nothing
	end if
'''''''''''''''''''''
	sql="insert into online (userid,ip,location,degree) values "&_
				"('"&membername&"','"&Request.ServerVariables("Remote_Addr")&"','校友录首页',"&ondegree&")"
	conn.execute(sql)
			
		Else
			if ClassName<>"" Then
				loc="『 <a href=Class_index.asp?ClassID="&ClsID&" target=_blank>"&htmlencode(ClassName)&"</a> 』 "&Locat
			Else
				loc=Locat
			End if
			sql="update online Set activetime=getdate(),location='"&loc&"',act='"&Act&"' where userid='"&membername&"'"
			conn.execute(sql)
		End if
		oRs.close
		Set oRs=Nothing
	End if

	Conn.Execute("delete from online where DATEDIFF(s, activetime, getdate())>1200")

End Sub
Sub pagehead()
	Dim title
	Call online()
	if Act<>"" Then title=Act Else title=Locat
	response.write "<html><head>"&_
	"<title>"&StrVar(1)&"--"&title&"</title>"&_
	"<META http-equiv=""Content-Type"" content=""text/html;charset=gb2312"">"&_
	"<meta name=keywords content=""湛江,中学,校友录,通讯,广东,风铃,风铃校友录,同学,校友,学校,交流,音乐,游戏,电影,论坛,MP3"">"&_
	"<link href=""Class_Main.css"" rel=""stylesheet"" type=""text/css"">"%>
	<script language=JavaScript src="inc/jsfun.asp"></script>
	</head><!--<noscript><iframe src=*.asp></iframe></noscript>-->
<body alink=#333333 vlink=#333333 link=#333333 topmargin=0 leftmargin=0>
<%
End Sub

Sub top(navlayer,headshow)
	if headshow<>0 Then Call pagehead()
	Response.Write"<table width=770 align=center border=0 bgcolor="&BodyColor&" cellspacing=0 cellpadding=0>"&_
	"<tr>"&_
		"<td align=center>"&_
		"<table align=center width=750 cellspacing=0 cellpadding=0><tr><td>"&_
		"<!-- content start -->"
%>
<TABLE width=770 height=125 border=0 align=center cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
      <TD width="776" height="224" background="images/main/top_01.jpg"><table width="100%" height="224" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="180"><OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 
      codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 
      height=180 width=500>
                          <PARAM NAME="movie" VALUE="images/main/top.swf"><PARAM NAME="quality" VALUE="high"><PARAM NAME="wmode" VALUE="transparent">
                                      <embed src="images/main/top.swf" 
      quality=high 
      pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" 
      type="application/x-shockwave-flash" width="500" height="180">        
      </embed></OBJECT></td>
                    </tr>
                    <tr>
                      <td vAlign=bottom align=right> 
                               
                              <TABLE cellSpacing=0 cellPadding=0 width=600 border=0>
                    <TBODY>
                    <TR align=middle>
                      <TD align=right width=0>
                        <TABLE class=tf cellSpacing=0 cellPadding=0 width=600
                        align=right border=0>
                          <TBODY>
                          <TR align=right height=20>
                            <TD width="10%"><A href="main.asp"><font color="#FF0000">返回首页</font></A></TD>
							<TD width="10%"><A href="Class_SharePhoto.asp"><font color="#FF0000">公共相册</font></A></TD>
							<TD width="10%"><A href="Diary_index.asp"><font color="#FF0000">心情日记</font></A></TD>
							<TD width="10%"><A href="play.asp"><font color="#FF0000">风铃赌场</font></A></TD>
							<TD width="10%"><A href="star.asp"><font color="#FF0000">缘分星座</font></A></TD> 
							<TD width="10%"><A href="n_url.asp"><font color="#FF0000">快乐网签</font></A></TD>          
							<TD width="10%"><A href="Class_onlineuser.asp"><font color="#FF0000">在线用户</font></A></TD>          
							<TD width="10%"><A href="bbs_index.asp"><font color="#FF0000">风铃论坛</font></A></TD>
							<TD width="10%"><A href="Class_Schoollist.asp"><FONT color=red>学校列表</FONT></A></TD>
                            </TR>
                                    </TBODY></TABLE></TD>
                      <TD width=5></TD></TR></TBODY></TABLE></td>
                    </tr>
                  </table> </TD>
    </TR></TBODY></TABLE>
<%
Call navbar(navlayer)
response.flush
End Sub

Sub NavBar(layer)

	Dim BarStr,title

	if act<>"" Then title=act Else title=locat
	Response.Write "<TABLE height=27 cellSpacing=0 cellPadding=0 width=""100%"" border=0 align=center background=""images/navbg.gif"""
	if layer=0 then response.write " style=""FILTER:DropShadow(Color=#ffffff, OffX=1, OffY=1, Positive=1)"""
	response.write "><TR><td>"

	BarStr="<A href=main.asp><IMG width=14 SRC=images/home1.gif hspace=3 border=0>"&StrVar(1)&"</A> >> "
	
	Select Case layer
	Case 0 
		if membername="" then 
			response.write "&nbsp;欢迎您来<font color=red>"&StrVar(1)&"</font>做客!</td>"
			response.write"<td align=right><a href=Class_Register.asp><img src=images/logoff.gif hspace=2 border=0 align=absmiddle>还没有注册?</a>&nbsp;<a href=Class_Help.asp><img src=images/help1.gif hspace=2 border=0>查看系统帮助</a>"
		else
			response.write "&nbsp;<font face=Verdana>欢迎您:<a href=Class_Userinfo.asp?Action=showdetail&Name="&membername&" title=查看我的个人资料 target=_blank><font color=red>"&membername&"</font></a></font></td>"&_
			"<td align=right><a href=Class_Login.asp?Action=logout><img src=images/logoff.gif hspace=2 border=0 align=absmiddle>退出系统</a>"&_
			"&nbsp;<a href=Class_Help.asp><img src=images/help1.gif hspace=2 border=0 align=absmiddle>帮助中心</a>"&_
			"&nbsp;<a href=Class_Modify.asp><img src=images/mydoc.gif hspace=2 border=0 align=absmiddle>修改资料</a>"
		end if
	Case 1
		Response.Write BarStr&title
	Case 2
	
		if locat="风铃论坛" Then
			Response.Write BarStr&"『 <A href=bbs_index.asp>风铃论坛</a> 』 >> "&act
		Elseif locat="学校论坛" then
			Response.Write BarStr&" <A href=Class_index.asp?ClassID="&ClsID&">"&htmlencode(ClassName)&"</a> "&_
				">> <A href=Class_bbs_index.asp?ClassID="&ClsID&">"&locat&"</a> >> "&title
		else
		Response.Write BarStr&" <A href=Class_index.asp?ClassID="&ClsID&">"&htmlencode(ClassName)&"</a> "&_
				">> "&title
		End if
	Case 3
		if locat="学校管理" Then 
			Response.Write BarStr&" <A href=Class_index.asp?ClassID="&ClsID&">"&htmlencode(ClassName)&"</a> "&_
				">> <A href=Class_Admin_index.asp?ClassID="&ClsID&"&Action=Main>学校管理</a> >> "&act
		ElseIf locat="学校相册" Then 
			Response.Write BarStr&" <A href=Class_index.asp?ClassID="&ClsID&">"&htmlencode(ClassName)&"</a> "&_
				">> <A href=Class_Album.asp?ClassID="&ClsID&">学校相册</a> >> "&act
		End if
		Case 4
		dim rsbb,sqlbb,boardid,boardname,TopicID
	   if request("boardid")="" and request("TopicID")="" then
	    response.write "<script language=javascript>alert('请确认您是从有效路径进入本站！');history.go(-1);</script>"
	    response.end
	   elseif request("boardid")<>"" and request("TopicID")="" then
	     sqlbb="select boardid,boardname from bbs where boardid="&request("boardid") 
	   elseif request("boardid")="" and request("TopicID")<>"" then
	     
	    TopicID=clng(request("TopicID"))
	    sqlbb="select B.boardid,B.boardname from [bbs] B inner join [Topic] BB on B.boardid=BB.boardid where BB.TopicID="&TopicID
       elseif request("boardid")<>"" and request("TopicID")<>"" then
        sqlbb="select boardid,boardname from bbs where boardid="&request("boardid")
	   end if
	   set rsbb=server.createobject("adodb.recordset")
        rsbb.open sqlbb,conn,1,1
		if rsbb.bof and rsbb.eof Then
		response.write "<script language=javascript>alert('指定的面版不存在！');history.go(-1);</script>"
	    response.end
		else
	   boardname=rsbb(1)
	   boardid=rsbb(0)
			response.write "<td><table width=""100%"" cellspacing=0 cellpadding=0><tr><TD align=left><A href=main.asp><IMG width=14 SRC=images/home1.gif hspace=3 border=0>"&StrVar(1)&"</A> >>『 <A href=Bbs_index.asp>论坛首页</a> 』>>『 <A href=Bbs_ForumDisplay.asp?boardid="&boardid&">"&boardname&_
			"</a> 』>> "&act&"</td>"
			response.write "</td></tr></table>"
			set rsbb=nothing
			end if

	End Select
	if layer<>0 then response.write "</td><td align=right>"

	if membername<>"" then response.write "&nbsp;"&chkNewMsg
	Response.Write "&nbsp;</td></tr></table>"

End Sub

function chkNewMsg()
	dim MsgSql,MsgRs

	chkNewMsg="<IMG SRC=images/inbox.gif WIDTH=17 BORDER=0 align=absmiddle hspace=2>"&_
		"<a href=Class_UserSms.asp?action=inbox>我的短信"
	MsgSql="select count(*) from message where incept='"&membername&"' and issend=1 and delR=0 and flag=0"
	set MsgRs=conn.execute(MsgSql)
	if MsgRs(0)<>0 then
		chkNewMsg=chkNewMsg&"(<font color=brown><b>"&MsgRs(0)&"</b></font>)</a>"
	if inStr(lcase(Request.ServerVariables("URL")),"Class_UserSms.asp")=0 then
			Response.Write "<bgsound src=""sound/newmsg.wav"" border=0>"
	end if
	else
		chkNewMsg=chkNewMsg&"(0)</a>"
	end if
	set MsgRs=nothing

end function



Sub success(byval suctitle,byval sucmsg)

	Response.Write "<br><br>"&_
		"<table cellpadding=5 cellspacing=1 border=0 align=center width=""100%""  Class=TableBorder>"&_
			"<tr align=center><th>成功："&suctitle&"</th></tr>"&_
			"<tr><td Class=LightTableBody height=80>&nbsp;&nbsp;"&sucmsg&"</td></tr>"&_
		"</table><BR>"


End Sub


Sub Redirect(timeout,url,title,msg)

	Response.Write "<meta http-equiv=refresh content="&timeout&";URL="&url&">"&_
		"<br><br><table cellpadding=5 cellspacing=1 border=0 align=center width=""100%"" Class=TableBorder>"&_
		"<tr><th>状态："&title&"</th></tr>"&_
		"<tr><td Class=LightTableBody>"&msg&"</td></tr></table><BR>"

End Sub
%>
<%
sub chkmsg()
dim MsgSqll,MsgRss
dim MsgSqll2,MsgRss2
if membername="" then exit sub
MsgSqll="select count(*) from message where incept='"&membername&"' and issend=1 and delR=0 and flag=0"
set MsgRss=conn.execute(MsgSqll)
if MsgRss(0)=0 then exit sub

MsgSqll2="select top 1 id,sender from message where incept='"&membername&"' and issend=1 and delR=0 and flag=0"
	set MsgRss2=conn.execute(MsgSqll2)
	%>
<script language="JavaScript" src="images/main/Main.js"></script>
<script language="JavaScript">window.onload = getMsg;
window.onresize = resizeDiv;window.onerror = function(){}</script>
<div id=eMeng 
style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; VISIBILITY: hidden; BORDER

-LEFT: #a6b4cf 1px solid; WIDTH: 180px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: 116px; 

BACKGROUND-COLOR: #c9d3f3"> 
        <table style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" cellspacing=0 cellpadding=0 width="100%" 

bgcolor=#cfdef4 border=0>
          <tbody>
            <tr> 
              <td style="FONT-SIZE: 12px; BACKGROUND-IMAGE: url(images/msgboximages/msgTopBg.gif); COLOR: #0f2c8c" 

valign=center width=30 height=24></td>
              <td style="FONT-WEIGHT: normal; FONT-SIZE: 9pt; BACKGROUND-IMAGE: url(images/msgboximages/msgTopBg.gif); 

COLOR: #1f336b; PADDING-TOP: 4px" valign=center width="100%"> 
                短消息提示：</td>
              <td style="BACKGROUND-IMAGE: url(images/msgboximages/msgTopBg.gif); PADDING-TOP: 2px" valign=center 

align=right width=19><img title=关闭 style="CURSOR: hand" onClick=closeDiv() hspace=3 src="images/msgboximages/msgClose.jpg"></td>
            </tr>
            <tr> 
              <td style="PADDING-RIGHT: 1px; BACKGROUND-IMAGE: url(images/msgboximages/msgBottomBg.jpg); PADDING-BOTTOM: 

1px" colspan=3 height=90> 
                <div 
				style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; 

PADDING-LEFT: 13px; FONT-SIZE: 9pt; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; 

PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">您有<a href="javascript:openScript('Class_USMS.asp?action=read&id=<%=MsgRss2(0)%>&sender=<%=MsgRss2(1)%>',500,300)"><font color=#FF0000><%=MsgRss(0)%></font></a>封新短消息 
                  <br>
                  <br>
                  <div align=center style="word-break:break-all"><a href="javascript:openScript

('Class_USMS.asp?action=read&id=<%=MsgRss2(0)%>&sender=<%=MsgRss2(1)%>',500,300)"><font color=#FF0000>查看<%=MsgRss2(1)%>给您的短信 
                    </font></a></div>
                </div></td>
            </tr>
          </tbody>
        </table>
      </div>
<%set MsgRss2=nothing
set MsgRss=nothing
end sub%>
<%
Sub footer()
call chkmsg()
	Response.Write "<br><br><br><br><TABLE cellSpacing=0 cellPadding=0 width=""770"" border=0 align=center>"&_
	"<tr><td><br></td></tr>"&_
	"<tr valign=center><td width =""100%"" align=center><font face=Verdana>"&_
	"<a href=http://www.717cn.com/ title=""管理员QQ:"&StrVar(9)&""">风铃校友录V1.5 Http://www.717cn.Com</a>"&_
"<br>版权所有&copy; 2004-2010 <a href=http://www.717cn.com/ target=_blank title=风铃工作室>风铃工作室</a></font>"
    response.write "<br>页面执行时间："&int((timer-start)*1000)&"毫秒"
	if membername<>"" then 
   if sysadmin then 
   Response.Write " <a href=admin/admin_index.asp target=_blank>『 管理登陆 』</a>"
 end if
   end if
	Response.Write "</td></tr></table>"
	%>
<TABLE cellSpacing=0 cellPadding=0 width=770 align=center border=0>
  <TBODY>
    <TR> 
      <TD> <div align="center"> <a href=http://www.717cn.com/ target=_blank title=风铃工作室> 
          <SCRIPT>var message="本校友录是由[风铃工作室]制作维护！" 
var n=0; 
if (document.all){ 
document.write('<font size="12px" color="red">') 
for (m=0;m<message.length;m++) 
document.write('<span id="neonlight" style="font-size:12px">'+message.charAt(m)+'</span>') 
document.write('</font>') 
var tempref=document.all.neonlight 
} 
else 
document.write(message) 
function neon(){ 
if (n==0){ 
for (m=0;m<message.length;m++) 
tempref[m].style.color="#000000" 
} 
tempref[n].style.color="RED" 
if (n<tempref.length-1) 
n++ 
else{ 
n=0 
clearInterval(flashing) 
setTimeout("beginneon()",1000) 
return 
} 
} 
function beginneon(){ 
if (document.all) 
flashing=setInterval("neon()",50) 
} 
beginneon() 
</SCRIPT>
          </a></div></TD>
    </TR>
    <TR> 
      <TD width="776" height="116" background="images/main/foot.gif"><object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 
      codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 
      height=116 width=500>
          <param name="movie" value="images/main/top.swf">
          <param name="quality" value="high">
          <param name="wmode" value="transparent">
          <embed src="images/main/top.swf" 
      quality=high 
      pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" 
      type="application/x-shockwave-flash" width="500" height="116"> </embed></object></TD>
    </TR>
  </TBODY>
</TABLE>
	
<%Response.Write "</td></tr></table>"&_
	"</td>"&_
	"</tr></table>"&_
"</body></html>"
Call endconnection()

End Sub
%>
