<!-- #include file=inc/BBSsetup.jsp -->
<!-- #include file=inc/User_Setup.jsp -->
<!-- #include file=inc/Board_Popfun.jsp -->
<!--#include file="plug-ins/HomePageStar/HomePageStar.jsp"-->
<%
DEF_PubMessageEnable = 1
GBL_CHK_PWdFlag = 0
Dim LMT_SimpleHomePage '是否为简约首页
LMT_SimpleHomePage = 0
If Request.QueryString("S") = "1" Then LMT_SimpleHomePage = 1

Dim GBL_ID
Dim GBL_REQ_Assort,GBL_TopicNum,GBL_AnnounceNum,GBL_GoodNum,GBL_TodayAnnounce,GBL_StartBoard

Dim GBL_OnlineUserNum,GBL_UserCount,GBL_MaxOnline,GBL_OnlineTime,GBL_MaxolTime,GBL_PageCount,GBL_UploadNum
Dim GBL_MaxAnnounce,GBL_MaxAncTime,GBL_YesterdayAnc

Dim Blist,BoardNum
Blist = Application(DEF_MasterCookies & "BList")

Function CheckAssort

	GBL_REQ_Assort = Left(Request.QueryString("Assort"),14)
	If isNumeric(GBL_REQ_Assort)=0 Then GBL_REQ_Assort=0
	GBL_REQ_Assort = Fix(cCur(GBL_REQ_Assort))

	Dim BoardNum,N,TempArray
	GBL_StartBoard = 0
	If GBL_REQ_Assort > 0 and isArray(Blist) = True Then
		BoardNum = Ubound(Blist,2)
		For N = 0 to BoardNum
			If GBL_REQ_Assort = cCur(Blist(1,n)) Then
				TempArray = Application(DEF_MasterCookies & "BoardInfo" & Blist(0,n))
				If isArray(TempArray) = True Then
					GBL_Board_BoardAssort = cCur(TempArray(1,0))
					GBL_Board_AssortName = TempArray(14,0)
					GBL_StartBoard = N
					Exit For
				Else
					GBL_REQ_Assort = 0
					GBL_Board_BoardAssort = 0
					GBL_Board_AssortName = ""
					Exit For
				End If
			End If
		Next
		If N > BoardNum Then GBL_REQ_Assort = 0
	Else
		GBL_REQ_Assort = 0
		GBL_Board_BoardAssort = 0
		GBL_Board_AssortName = ""
	End If
	If cCur(GBL_ShowBottomSure) = 0 and GBL_REQ_Assort > 0 Then GBL_SiteBottomString = ""

End Function

Function DisplayBoard

	Dim Temp,Flag
	Flag = 0

	Dim GetData
	If isArray(Blist) = True Then
		BoardNum = Ubound(Blist,2)
	Else
		ReloadBoardListData
		Blist = application(DEF_MasterCookies & "BList")
		If isArray(Blist) = True Then
			BoardNum = Ubound(Blist,2)
		Else
			BoardNum = -1
		End if
	End If

'Response.Write "fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1)):"&fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1))
'DEF_PageExeTime1=Timer * 1000
%>	
	<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center>
<tr><td><%=GBL_TableHeadString%></td></tr></table><%If GBL_CHK_User = "" Then%>
<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=1 cellpadding=6 align=center bgcolor=#cccccc class=TBone>
	<form action=<%=DEF_BBS_HomeUrl%>User/login.jsp method="post">
	<tr bgcolor=eeeeee height=25 class=TBBG9>
		<td height=20><table><tr><td>有效期: </td><td><Select name=CkiExp>
                          <option value="-1" selected>不 保 存</option>
                          <option value="1">保存一天</option>
                          <option value="2">保存一月</option>
                          <option value="3">保存一年</option>
			</select>
				</td><td>用户名: </td><td><input name=user type=text maxlength=10 size=12 value="<%
	If GBL_CHK_user = "" or isNull(GBL_CHK_user) Then
		Response.Write htmlencode(Request("user"))
	Else
		Response.Write htmlencode(GBL_CHK_user)
	End If%>" class=fminpt><br>
	<input type=hidden value=<%
	If Request("submitflag") <> "ddddls-+++" Then
		If Request("u") <> "" Then
			Response.Write htmlencode(Request("u"))
		Else
			Dim HomeUrl
			HomeUrl = "http://"&Request.ServerVariables("server_name")
			Dim u
			u = Request.QueryString("u")
			If Left(u,1) <> "/" and Left(u,1) <> "\" and Left(u,Len(HomeUrl)) <> HomeUrl Then u = ""
			If u = "" Then
				u = Lcase(Request.ServerVariables("HTTP_REFERER"))
				If Request.ServerVariables("SERVER_PORT") <> "80" Then HomeUrl = HomeUrl & ":" & Request.ServerVariables("SERVER_PORT")
				If Left(u,Len(HomeUrl)) <> Lcase(HomeUrl) Then u = ""
				If inStr(u,"/user/login.jsp") > 0 Then u = ""
			End If
			Response.Write htmlencode(u)
		End If
	End If%> name=u></td><td>
				密码: </td><td><input name=pass type=password maxlength=10 size=12 value="<%'=htmlencode(GBL_CHK_pass)%>" class=fminpt>
				</td><td>	<input name=submitflag type=hidden value="ddddls-+++"><input type=submit value="登录" class=fmbtn>
				</td><td>&nbsp; [<a href=User/UserGetPass.jsp>忘记密码了</a>]
				 [<a href=User/UserJoin.jsp>新用户注册</a>]
				</td></tr>
	</form></table>
		</td>
	</tr>
</table>
<% else %>
<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><% end if %>
<%
	If BoardNum = -1 Then
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=1 cellpadding=6 align=center bgcolor=" & DEF_BBS_DarkColor & " class=TBone><tr bgcolor=" & DEF_BBS_LightestColor & " class=TBBG9><td colspan=4>找不到任何版面</td></tr></table>"
	Else%>
<script language=javascript>
	var num=0,CurrentAssosrt = 0,Flag=0;
	var GBL_TableBottomString = "<%=Replace(Replace(Replace(GBL_TableBottomString,"\","\\"),"""","\"""),VbCrLf,"\n")%>";
	var GBL_TableHeadString = "<%=Replace(Replace(Replace(GBL_TableHeadString,"\","\\"),"""","\"""),VbCrLf,"\n")%>";
	var DEF_BBS_ScreenWidth = "<%=DEF_BBS_ScreenWidth%>";
	var GBL_DefineImage = "<%=GBL_DefineImage%>";
<%
		If LMT_SimpleHomePage = 1 Then
			If GetBinarybit(GBL_TempletFlag,1) = 1 Then
				Server.ExeCute("inc/Templet/" & GBL_TempletID & "_0.JS")
			Else%>

function displayboard(BoardID,BoardAssort,BoardName,AssortName)
{
	var n;
	if(CurrentAssosrt!=BoardAssort)
	{
		CurrentAssosrt = BoardAssort
		if(Flag == 1)
		{
			if(num>0){for(n=num;n<5;n++)document.write("<td width=20%>&nbsp;</td>");}
			document.write("</table>");
			if(GBL_TableBottomString != "")document.write("<table width=" + DEF_BBS_ScreenWidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + GBL_TableBottomString + "</td></tr></table>");
			document.write("<br>");
		}
		if(GBL_TableHeadString != "")document.write("<table width=" + DEF_BBS_ScreenWidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + GBL_TableHeadString + "</td></tr></table>");
		document.write("<table width=" + DEF_BBS_ScreenWidth + " border=0 cellspacing=1 cellpadding=5 align=center bgcolor=#cccccc class=TBone><tr bgcolor=#666699><td colspan=5 class=TBHead><img src=images/blank.gif width=2 height=3><br><a href=index.jsp?Assort=" + BoardAssort + "><b><font color=white class=HeadFont>" + AssortName + "</font></b></a></td></tr>");
		Flag = 1;
		num=0;
	}
	if((num%5)==0)document.write("<tr bgcolor=#f7f7f7 class=TBBG9>");
	document.write("<td width=20%><a href=b/?" + BoardID + ".html>" + BoardName + "</a></td>");
	num+=1;
	if(num>4)num=0;
}<%			End If
		Else
			If GetBinarybit(GBL_TempletFlag,2) = 1 Then
				Server.ExeCute("inc/Templet/" & GBL_TempletID & "_1.JS")
			Else%>

function displayboard(BoardID,BoardAssort,BoardName,BoardIntro,LastWriter,LastWriteTime,TopicNum,AnnounceNum,ForumPass,LastAnnounceID,LastTopicName,MasterList,BoardLimit,AssortName,TodayAnnounce,GoodNum,BoardImgUrl,BoardImgWidth,BoardImgHeight,onlineUser,LowerBoard,AssortMaster)
{
	var Temp = 0;
	if(CurrentAssosrt!=BoardAssort)
	{
		CurrentAssosrt = BoardAssort
		if(Flag == 1)
		{	document.write("</table>");
			if(GBL_TableBottomString != "")document.write("<table width=" + DEF_BBS_ScreenWidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + GBL_TableBottomString + "</td></tr></table>");
			document.write("<br>");
		}
		if(GBL_TableHeadString != "")document.write("<table width=" + DEF_BBS_ScreenWidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + GBL_TableHeadString + "</td></tr></table>");
		document.write("<table width=" + DEF_BBS_ScreenWidth + " border=0 cellspacing=1 cellpadding=5 align=center bgcolor=#cccccc class=TBone><tr bgcolor=#666699><td colspan=4 class=TBHead>");

		document.write("<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/blank.gif width=2 height=2><br><a href=index.jsp?Assort=" + BoardAssort + "><b><font color=white class=HeadFont>" + AssortName + "</font></b></a></td><td align=right>");

		// 显示区版主
		DisplayAssortMaster(AssortMaster);
		document.write("</td></tr></table></td></tr>");
		Flag = 1;
	}
	document.write("<tr bgcolor=#FFFFFF onMouseOver=this.bgColor='#F8FAFC' onMouseOut=this.bgColor='#FFFFFF'><td width=30 bgcolor=eeeeee class=TBBG1><img src=images/" + GBL_DefineImage + "BoardTopic/");
	if(TodayAnnounce > 0)document.write("_");
	if(ForumPass!="")
	{
		document.write("lock.gif title=保密论坛");
	}
	else
	{
		if(BoardLimit&(1<<(7-1)))
		{
			document.write("lock3.gif title=版主专区");
		}
		else
		{
			if((BoardLimit&(1<<(4-1))) && (BoardLimit&(1<<(3-1))) && (BoardLimit&(1<<(6-1))))
			{
				document.write("readonly.gif title=只读论坛");
			}
			else
			{
				if(BoardLimit&(1<<(2-1)))
				{
					document.write("lock2.gif title=正式会员论坛");
				}
				else
				{
					if(BoardLimit&(1<<(1-1)))
					{
						document.write("lock1.gif title=注册认证论坛");
					}
					else
					{
						if(BoardLimit&(1<<(9-1)))
						{
							document.write("open.gif title=开放论坛");
						}
						else
						{
							document.write("1.gif title=常规论坛");
						}
					}
				}
			}
		}
	}
	document.write(" ></td>");
	document.write("<td align=Left><table width=100% border=0 cellspacing=0 cellpadding=0>");
	if(BoardImgUrl != "" && BoardImgUrl != null)document.write("<tr><td rowspan=4 width=" + BoardImgWidth + " valign=top><img src=images/null.gif width=2 height=3><br><a href=b/?" + BoardID + ".html><img src=\"" + BoardImgUrl + "\" width=" + BoardImgWidth + " height=" + BoardImgHeight + " border=0></a></td><td width=4 rowspan=4><img src=images/null.gif width=2 height=2></td></tr>");
	document.write("<tr height=20><td><a href=b/?" + BoardID + ".html>" + BoardName + "</a>");
	document.write("</td><td align=right rowspan=2 valign=top><img src=images/null.gif width=2 height=2><br><a href=a/announce2.jsp?BoardID=" + BoardID + "><img src=images/" + GBL_DefineImage + "BoardTopic/post.gif height=13 width=12 border=0 title=在此论坛发表新帖子></a><br><img src=images/null.gif width=2 height=5><br><a href=b/EBoard.jsp?BoardID=" + BoardID + "><img src=images/" + GBL_DefineImage + "BoardTopic/elist.gif height=13 width=12 border=0 title=查看精华区内容(共" + GoodNum + "精华帖子)></a></td></tr>");
	document.write("<tr height=15><td>");
	document.write(BoardIntro);
	document.write("</td>");
	document.write("<tr height=15><td colspan=2>");
	document.write("<img src=images/null.gif height=8 width=2><br><div align='right'><img src='images/teambak.gif' width='16' height='16' align='absmiddle'>&nbsp;");
	DisplayBoardMastList(MasterList,5);
	document.write("</tr></table></td>");
	
	document.write("<td align=left width=222 valign=top><img src=images/null.gif height=2 width=2><br>");
	if(LastTopicName == "" || LastTopicName==null)
	{
		document.write("主题：无");
	}
	else
	{
		if(strlength(LastTopicName)>31)LastTopicName = LeftTrue(LastTopicName,31-3) + "..."
		LastTopicName = htmlencode(LastTopicName);
		if(ForumPass != "" || (BoardLimit&(1<<(2-1))) || (BoardLimit&(1<<(7-1))))
		{
			document.write("主题：已设置为隐藏");
			Temp = 1;
		}
		else
		{
			if(parseInt(LastAnnounceID)==0){document.write("主题：" + htmlencode(LastTopicName));}
			else{document.write("主题：<a href=a/?" + BoardID + "-" + LastAnnounceID + ".html>" + htmlencode(LastTopicName) + "</a>");}
		}
	}
	document.write("<br><img src=images/null.gif height=4 width=2><br>");
	if(LastWriter == "")
	{
		document.write("作者：");
		LastWriter="无";
		document.write(LastWriter);
		document.write("<br><img src=images/null.gif height=4 width=2><br>时间：无");
	}
	else
	{
		document.write("回复：");
		if(LastWriter!="游客")
		{
			if(Temp == 1)
			{
				document.write("隐藏");
			}
			else
			{
				document.write("<a target=\"_blank\"  href=\"../Club/club_member.jsp?username=" + htmlencode(LastWriter) + "\">" + htmlencode(LastWriter) + "</a>");
			}
		}
		else
		{
			document.write(htmlencode(LastWriter))
		}
		if(LastWriteTime.length==14)
		{
			LastWriteTime = LastWriteTime.substr(0,4) + "-" + LastWriteTime.substr(4,2) + "-" + LastWriteTime.substr(6,2) + " " + LastWriteTime.substr(8,2) + ":" + LastWriteTime.substr(10,2) + ":" + LastWriteTime.substr(12,2)
		}
else
			{
				document.write(htmlencode(LastWriter) + " ")
			}
			document.write(LastWriteTime);
			document.write("<br><img src=images/null.gif height=4 width=2><br>");
			document.write("新帖：<font color=#ff6600>" + TodayAnnounce + "</font> 主题 " + TopicNum + " 总量 " + AnnounceNum);
			document.write("</td></tr>");
	}
}<%
			End If%>

function DisplayBoardMastList(s,num)
{
	if("?LeadBBS?" == s)
	{
		document.write("全体版主");
	}
	else
	{
		if(s == "" || s == null)document.write("无");
		var ss,n;
		ss = s.split(",");
		for(n=0;n<ss.length;n++)
		{
			if(n>=num)break;
			document.write("<a target=\"_blank\"  href=\"../Club/club_member.jsp?username=" + htmlencode(ss[n]) + "\">" + htmlencode(ss[n]) + "</a> ");
		}
		if(n>=num && n<ss.length)
		{
			document.write("<span style=\"cursor:hand\" title=\"更多版主: " + ss[n]);
			for(n=n+1;n<ss.length;n++){document.write(" " + ss[n]);}
			document.write("\">...</span>");
		}
	}
}

function DisplayAssortMaster(s)
{
   if(s == "" || s == null) return;
   document.write("<font color=#ffffff>区版主：</font>");
   var ss,n;
   ss = s.split(",");
   for(n=0;n<ss.length;n++)
   {
		document.write("<a target=\"_blank\"  href=\"../Club/club_member.jsp?username=" + htmlencode(ss[n]) + "\"><font color=#ffffff>" + htmlencode(ss[n]) + "</font></a>&nbsp;&nbsp;");
   }
}
function htmlencode(str)
{
	var re = /(<)/gi;
	var rv = str.replace(re,"&lt;");
	re = /(>)/gi;
	rv = rv.replace(re,"&gt;");
	re = /(\")/gi;
	rv = rv.replace(re,"&quot;");
	return(rv);
}
function LeftTrue(str,n)
{
	var mx=String.fromCharCode(127);
	if(str.length<=n/2)
	{
		return(str);
	}
	else
	{
		var TStr="";
		var l,t=0;
		var i;
		l=str.length;
		for(i=0;i<l;i++)
		{
			if(str.charAt(i)>mx)
			{
				t=t+2;
			}
			else
			{
				t=t+1;
			}
			if(t>n)break;
			TStr=TStr+str.charAt(i);
		}
		return(TStr);
	}
}

function strlength(str)
{
	var mx=String.fromCharCode(255);
	if(str.length==0)
	{
		return(0);
	}
	else
	{
		var TStr="";
		var l,t,c;
		var i;
		l=str.length;
		t=l;
		for(i=0;i<l;i++)
		{
			if(str.charAt(i)>mx)
			{
				t+=1;
			}
		}
		return(t);
	}
}<%End If
		Dim BoardID,ForumPass
		Dim N
		GBL_TopicNum = 0
		GBL_AnnounceNum = 0
		GBL_GoodNum = 0
		GBL_TodayAnnounce = 0

		For N = GBL_StartBoard to BoardNum
			BoardID = Blist(0,n)
			GetData = Application(DEF_MasterCookies & "BoardInfo" & Blist(0,n))
			If isArray(GetData) = False Then
				ReloadBoardInfo(BoardID)
				GetData = Application(DEF_MasterCookies & "BoardInfo" & Blist(0,n))
			End If
		If GBL_REQ_Assort = 0 or (GBL_REQ_Assort > 0 and GBL_REQ_Assort = cCur(Blist(1,n))) Then
			If LMT_SimpleHomePage = 0 Then
				ForumPass = GetData(7,0)
				If ForumPass <> "" Then ForumPass = "leadbbs"
				GetData(9,0) = cCur(GetData(9,0))
				If GetData(9,0) > 1 Then
					If GetBinarybit(GetData(9,0),7) = 1 or GetBinarybit(GetData(9,0),2) = 1 Then
						GetData(20,0) = "-"
						GetData(3,0) = "-"
					End If
				End If					
				'If isNumeric(Application(DEF_MasterCookies & "BDOL" & BoardID)) = 0 Then
				'	Application.Lock
				'	Application(DEF_MasterCookies & "BDOL" & BoardID) = 0
				'	Application.UnLock
				'End If
				Response.Write VbCrLf & "displayboard(" & BoardID & "," & GetData(1,0) & ",""" & Replace(Replace(GetData(0,0),"\","\\"),"""","\""") & """,""" & Replace(Replace(Replace(GetData(2,0),"\","\\"),"""","\"""),VbCrLf,"\n") & """,""" & Replace(Replace(GetData(3,0),"\","\\"),"""","\""") & """,""" & GetData(4,0) & """," & GetData(29,0) & "," & GetData(30,0) & ",""" & ForumPass & """," & GetData(19,0) & ",""" & Replace(Replace(Replace(GetData(20,0),"\","\\"),"""","\"""),"<","&lt;") & """,""" & Replace(Replace(GetData(10,0),"\","\\"),"""","\""") & """," & GetData(9,0) & ",""" & Replace(Replace(GetData(14,0),"\","\\"),"""","\""") & """," & GetData(31,0) & "," & GetData(32,0) & ",""" & Replace(Replace(GetData(21,0),"\","\\"),"""","\""") & """,""" & GetData(22,0) & """,""" & GetData(23,0) & """,0,""" & GetData(27,0) & """);"
			Else
				Response.Write VbCrLf & "displayboard(" & BoardID & "," & GetData(1,0) & ",""" & Replace(Replace(GetData(0,0),"\","\\"),"""","\""") & """,""" & Replace(Replace(GetData(14,0),"\","\\"),"""","\""") & """);"
			End If

			GBL_TopicNum = GBL_TopicNum + cCur(GetData(29,0))
			GBL_AnnounceNum = GBL_AnnounceNum + cCur(GetData(30,0))
			GBL_GoodNum = GBL_GoodNum + cCur(GetData(32,0))
			GBL_TodayAnnounce = GBL_TodayAnnounce + cCur(GetData(31,0))
		End If
		Next
		If BoardNum > 0 and LMT_SimpleHomePage = 1 Then
		%>
		if(num>0){for(n=num;n<5;n++)document.write("<td width=20%>&nbsp;</td>");}
		<%End If%>
</script>
		</table><%If GBL_TableBottomString <> "" Then
			%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%
		End If
		'Response.Write "fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1)):"&fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1))
	End If
	If GBL_TodayAnnounce > GBL_MaxAnnounce Then
		GBL_MaxAnnounce = GBL_TodayAnnounce
		'Con.ExeCute("Update LeadBBS_SiteInfo Set MaxAnnounce=" & GBL_TodayAnnounce & ",MaxAncTime=" & GetTimeValue(DEF_Now))
		'GBL_DBNum = GBL_DBNum + 1
		UpdateStatisticDataInfo GBL_TodayAnnounce,6,0
		UpdateStatisticDataInfo GetTimeValue(DEF_Now),7,0
	End If
	Response.Write "<br>"
LeadBBSHomePageStar
		Response.Write "<br /><div align='center'><a href='User/help/about.jsp' target=_blank>管理员团队</a> | <a href='User/UserTop.jsp?1' target=_blank>积分排行榜</a> | <a href='User/UserTop.jsp?2' target=_blank>存款排行榜</a> | <a href='User/UserTop.jsp?3' target=_blank>经验排行榜</a> | <a href='User/UserTop.jsp?4' target=_blank>发帖排行榜</a> | <a href='User/UserTop.jsp?6' target=_blank>魅力排行榜</a> | <a href='User/UserTop.jsp?5' target=_blank>新注册会员</a><br><br>"
	If GBL_TableHeadString <> "" Then
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
		Response.Write GBL_TableHeadString
		Response.Write "</td></tr></table>"
	End If
	
	DisplayBoardInfo
	If GBL_TableBottomString <> "" Then
		%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%
	End If
%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr align=center>
		<td>
<!-- #include file=inc/IncHtm/BoardLink.jsp -->
		</td>
	</tr>
	</table>
	<%

End Function

Sub DisplayBoardInfo

	%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr bgcolor=<%=DEF_BBS_LightDarkColor%>><td class=TBHead><img src=images/blank.gif width=2 height=3><br><b><font color=white class=HeadFont>论坛及用户来访信息</font></b></td></tr>
	<tr bgcolor=<%=DEF_BBS_LightestColor%> align=center width=<%=DEF_AllFaceMaxWidth%> class=TBBG9>
		<td>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
		<td align=left valign=top>
				<%DisplayBoardInfo2%>
		<td align=left valign=top><img src=images/null.gif width=2 height=3><br><%
			If DEF_DisplayOnlineUser = 1 Then%><IMG id=followImg0 name=followImg0 style="CURSOR: hand" onclick=ShowOnline(0,"") src="images/<%=GBL_DefineImage%>frame/plus.gif" loaded="no" width=10 height=10><%
			Else
				Response.Write "<font color=gray class=GrayFont>■</font>"
			End If
			Response.write " 在线人数：<b><a href=User/UserOnline.jsp>" & GBL_OnlineUserNum & "</a></b> "
			Response.Write "<a href=User/UserFriend.jsp?need=23>查看在线好友</a>"
			Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 注册用户：" & GBL_UserCount & " 人<br>"
			Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 上传附件：" & GBL_UploadNum & " 个<br>"
	                Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 页浏览量：" & GBL_PageCount+application(DEF_MasterCookies & "SitePageCount") & " 次<br>"
				
                        %><%DisplayUserNewest%>
		</td>
		</tr>
		</table>
		</td>
	</tr>
	<%If DEF_DisplayOnlineUser = 1 Then%>
	<TR id=follow0 name=follow0 style="DISPLAY: none" bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD id=followTd0 name=followTd0 align=left>
	<script language=javascript>
	var EndFlag=0;
	function ShowOnline(id,ur){
		if (EndFlag==0){alert("网页未下载完成,请稍候...");return;}
		if (follow0.style.display!='block'){
			follow0.style.display="block";
			document.followImg0.src="images/<%=GBL_DefineImage%>frame/minus.gif";
			if (document.followImg0.loaded=="no"){document.frames["hiddenframe"].location.replace("User/ol.jsp?id="+id+"&ur="+ur);}
			}else{
			follow0.style.display="none";
			document.followImg0.src="images/<%=GBL_DefineImage%>frame/plus.gif";
			}
		}
	</SCRIPT>
            <DIV onclick=ShowOnline(0,"")>
            <TABLE cellPadding=0 width="100%">
              <TBODY>
              <TR>
                <TD width="100%">读取中...</TD></TR></TBODY></TABLE></DIV></TD></TR>
	<%
		End If
	If DEF_DisplayOnlineUser = 2 or DEF_DisplayOnlineUser = 3 Then%>
	<TR bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD align=left colspan=2><%DisplayUserOnline 0,""%></TD></TR>
	<%
		End If%>
	</table><%

End Sub

Sub DisplayBoardInfo2

	Dim Temp%>
	<table border=0 cellspacing=0 cellpadding=0>
	<tr>
		<td>
	<%
	Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 总发帖量：" & GBL_AnnounceNum & " 帖<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 今日帖子：<font color=Red class=RedFont>" & GBL_TodayAnnounce & "</font> 帖<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 昨日帖子：" & GBL_YesterdayAnc & " 帖<br>"
	If BoardNum<0 Then BoardNum=0
	'Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 可见版面：" & BoardNum+1 & " 个<br>"
	Response.Write "</td><td>"
	'Response.Write "<img src=images/null.gif width=2 height=2><br> &nbsp; &nbsp; <img src=images/red_g.gif> 总 在 线："
	'If isNumeric(application(DEF_MasterCookies & "SiteOlTime")) = False Then
	'	Application.Lock
	'	application(DEF_MasterCookies & "SiteOlTime") = 0
	'	Application.UnLock
	'End If
	'GBL_OnlineTime = GBL_OnlineTime + application(DEF_MasterCookies & "SiteOlTime")
	'Response.Write Fix((GBL_OnlineTime)/(24*60*60)) & " 天<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 主题帖子：" & GBL_TopicNum & " 帖<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 回复帖子：" & (GBL_AnnounceNum-GBL_TopicNum) & " 帖<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 精华帖子：" & GBL_GoodNum & " 帖<br>"
	Response.Write "</td></tr><tr><td colspan=2 align=left>"
	Response.Write "<img src=images/null.gif width=2 height=2><br> <img src=images/red_g.gif> 最高在线数 " & GBL_MaxOnline & " 人 发生于 " & RestoreTime(GBL_MaxolTime) & "<br>"
	Response.Write "<img src=images/null.gif width=2 height=2><br> <img src=images/red_g.gif> 最高日发帖 " & GBL_MaxAnnounce & " 帖 发生于 " & RestoreTime(GBL_MaxAncTime)
	
	Response.Write "</td></tr></table>"

End Sub

Sub Main

	OpenDatabase
	CheckUserOnline
	If GBL_CheckPassDoneFlag <> 1 Then CheckPass
	GetActiveUserNumber
	GBL_CHK_TempStr = ""
	
	CheckAssort
	BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID,""

UpdateOnlineUserAtInfo 0,"论坛首页"%>

<%If GBL_CHK_User = "" Then DisplayTopInfo

	DisplayBoard
	closeDataBase
	SiteBottom
	If DEF_DisplayOnlineUser = 1 Then%><%End If
	

End Sub

Dim Officer,ApplyTime,AnnounceNum
Function DisplayUserNewest
     Dim Rs,SQL
     SQL = "select TOP 1 ID,UserName from LeadBBS_User Order by ID DESC"
     Set Rs = Con.ExeCute(SQL)
     If Not rs.Eof Then      
     %>
     <script language=javascript>
     function s(d0,d1)
     {
           if(d0=="")return;
           document.write("<img src=images/null.gif width=2 height=2><br><img src=images/red_g.gif> 新进来宾：<a target=_blank href=../Club/club_member.jsp?username=" + d1 + "><font color=red>" + d1 + "</font></a>");
           }
     </script>
<script language=javascript>
<%      
           Response.Write "" & VbCrLf & "s("""
           Response.Write Rs.GetString(,,""",""",""");" & VbCrLf & "s(""","")
           Rs.Close
           Set Rs = Nothing
           Response.Write ""","""","""","""");"
%></script>      
<%
     Else
           Rs.Close
           Set Rs = Nothing
           Response.Write "找不到用户." & VbCrLf
     End If

End Function
Function DisplayTopInfo
End Function
Function ReplaceNotNull(str,str1,str2)

     If isNull(str) Then str = ""
     If str<>"" Then
           ReplaceNotNull = Replace(str,str1,str2)
     Else
           ReplaceNotNull=str
     End If

end function
%>
	

<%	
Function GetActiveUserNumber

	If isNumeric(application(DEF_MasterCookies & "ActiveUsers")) = False Then
		Application.Lock
		application(DEF_MasterCookies & "ActiveUsers") = 0
		Application.UnLock
	End If
	GBL_OnlineUserNum = cCur(application(DEF_MasterCookies & "ActiveUsers"))
	Dim TmpData
	If isArray(application(DEF_MasterCookies & "StatisticData")) = False Then ReloadStatisticData
	TmpData = Application(DEF_MasterCookies & "StatisticData")
	GBL_OnlineTime = cCur(TmpData(0,0))
	GBL_UserCount = cCur(TmpData(1,0))
	GBL_MaxOnline = cCur(TmpData(2,0))
	GBL_MaxolTime = cCur(TmpData(3,0))
	GBL_PageCount = cCur(TmpData(4,0))
	GBL_UploadNum = cCur(TmpData(5,0))
	GBL_MaxAnnounce = cCur(TmpData(6,0))
	GBL_MaxAncTime = cCur(TmpData(7,0))
	GBL_YesterdayAnc = cCur(TmpData(8,0))
	If GBL_OnlineUserNum > GBL_MaxOnline Then
		Con.ExeCute("Update LeadBBS_SiteInfo Set MaxOnline=" & GBL_OnlineUserNum & ",MaxolTime=" & GetTimeValue(DEF_Now))
		UpdateStatisticDataInfo GBL_OnlineUserNum,2,0
		UpdateStatisticDataInfo GetTimeValue(DEF_Now),3,0
	End If

End Function

Function DisplayUserOnline(BoardID,url)

	Dim Time1
	Time1 = Timer
	Const LMT_Max_OnlineUserList = 2000
	Dim ActiveUsers
	ActiveUsers = 0
	If BoardID > 0 and isArray(Application(DEF_MasterCookies & "BoardInfo" & BoardID)) = True Then ActiveUsers = cCur(Application(DEF_MasterCookies & "BDOL" & BoardID))

	%>
<table width=100%>
<script language=javascript>
var n=1;
var rguser=0;

function s(GetData0,GetData1,GetData2)
{
	var tempstr = ""
	if(GetData0 == "")return;
	if(n==1)tempstr+="<tr>";
	tempstr+="<td>&nbsp;";
	if(GetData1 == null || trim(GetData1) == "")
	{
		tempstr+="<img src='images/online/m1.gif' width='12'>&nbsp;<a href=<%=Url%>User/LookUserMoreInfo.jsp?OlID=" + GetData0 + ">游客</a></td>";
	}
	else
	{
		rguser+=1;
		if (GetData1 == "隐身会员")
		{
			tempstr+="<img src='images/online/m1.gif' width='12'>&nbsp;<a href=<%=Url%>User/LookUserMoreInfo.jsp?OlID=" + GetData0 + ">隐身会员</a></td>";
		}
		else
		{
			if(parseInt(GetData2)&(1<<(10-1))){tempstr+="<img src='images/online/m3.gif' width='12'>&nbsp;";}
			else
			{
				if(parseInt(GetData2)&(1<<(14-1))){tempstr+="<img src='images/online/m9.gif' width='12'>&nbsp;";}
				else
				{
					if(parseInt(GetData2)&(1<<(8-1))){tempstr+="<img src='images/online/m4.gif' width='12'>&nbsp;";}
					else
					{
						if(parseInt(GetData2)&(1<<(2-1))){tempstr+="<img src='images/online/m5.gif' width='12'>&nbsp;";}
						else{tempstr+="<img src='images/online/m6.gif' width='12'>&nbsp;";}
					}
				}
			}
			tempstr+="<a  target=_blank  href='<%=Url%>../Club/club_member.jsp?username=" + GetData1 + "'>" + GetData1 + "</a></td>";
		}
	}
	n+=1;
	if(n>7)
	{
		tempstr+="</tr>";
		n=1;
	}
	document.write(tempstr);
}
function trim(str)
{
	var re = /( )/gi;
	var rv = str.replace(re,"");
	return(rv);
}
<%
	Dim Temp
	Temp = 0
	If ActiveUsers < Num + 1 Then ActiveUsers = Num + 1

	Dim Rs,SQL
	If BoardID = 0 Then
		SQL = "select TOP " & LMT_Max_OnlineUserList & " ID,UserName,HiddenFlag from LeadBBS_onlineUser order by id"
	Else
		SQL = "select TOP " & LMT_Max_OnlineUserList & " ID,UserName,HiddenFlag from LeadBBS_onlineUser where AtBoardID=" & boardID &" and UserID>0"
	End If

	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	Dim Num
	Dim GetData
	If Not rs.Eof Then
		Response.Write "s("""
		Response.Write Rs.GetString(,,""",""",""");" & VbCrLf & "s(""","")
		'Response.Write Rs.GetString(,,""",",");" & VbCrLf & "s(""","")
		Response.Write ""","""",0);"
	Else
		Num = -1
	End If
	Rs.close
	Set Rs = Nothing

	If ActiveUsers < Num Then ActiveUsers = Num
	Temp = Num
	If isNumeric(application(DEF_MasterCookies & "ActiveUsers")) = 0 Then
		Application.Lock
		application(DEF_MasterCookies & "ActiveUsers") = 0
		Application.UnLock
	End If
	If application(DEF_MasterCookies & "ActiveUsers") < Temp Then
		Application.Lock
		application(DEF_MasterCookies & "ActiveUsers") = Temp
		Application.UnLock
	End If
	Response.Write "var online=" & cCur(application(DEF_MasterCookies & "ActiveUsers")) & ";" & VbCrLf & "if(online<rguser)online=rguser;" & VbCrLf
	Response.Write "document.write(""<tr><td colspan=7><img src=" & url & "images/null.gif width=2 height=4><br>&nbsp;目前论坛总共有 "" + online + "" 人在线。"
	If BoardID > 0 Then
		Response.Write "此版面共 " & ActiveUsers & " 人在线，"
		Response.Write "其中注册会员 "" + rguser + "" 人，游客 "" + (" & ActiveUsers & "-rguser) + "" 人 "
	Else
		Response.Write "其中注册会员 "" + rguser + "" 人，游客 "" + (online-rguser) + "" 人 "
	End If
	Response.Write "在线人员显示消耗时间" & fix(abs(CDBL(Timer)*1000 - Time1*1000)) & "毫秒"
	If BoardID = 0 Then Response.Write "<br><img src=" & url & "images/null.gif height=7 width=2><br>&nbsp;图例：<img src='images/online/m3.gif' width='12'>&nbsp;总版主　<img src='images/online/m9.gif' width='12'>&nbsp;区版主　<img src='images/online/m4.gif' width='12'>&nbsp;版主　<img src='images/online/m8.gif' width='16'>&nbsp;巡警　<img src='images/online/m5.gif' width='12'>&nbsp;认证会员　<img src='images/online/m6.gif' width='12'>&nbsp;注册会员　<img src='images/online/m1.gif' width='12'>&nbsp;游客或隐身会员"
	Response.Write "</td></tr>"");"
%>
</script>
</table>
<%

End Function

Main%>

