<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=../inc/Limit_Fun.asp -->
<!-- #include file=inc/Board_fun.asp -->
<%
Const DisplayChildBoardStyle = 1
DEF_PubMessageEnable = 1
DEF_BBS_HomeUrl = "../"
Dim LMT_SimpleHomePage '是否为简约首页
LMT_SimpleHomePage = 0
If Request.QueryString("S") = "1" Then LMT_SimpleHomePage = 1

Function DisplayBoardMastList(MasterList,Num)

	If MasterList = "" Then
		Response.Write "无"
		Exit function
	ElseIf MasterList = "?LeadBBS?" Then
		Response.Write "全体版主"
		Exit function		
	End If
	Dim temp,n,I
	Temp = split(MasterList,",")
	I = Ubound(temp,1)
	For N = 0 to I
		If N >= Num Then
			'Response.Write "..."
			Exit For
		End If
		Response.Write " <a href=" & DEF_BBS_HomeUrl & "user/LookUserInfo.asp?name=" & urlencode(temp(N)) & ">" & htmlencode(temp(n)) & "</a>"
	Next

	If N >= Num and N <= I Then
		Response.Write "<span style=""cursor:hand"" title=""更多版主: " & temp(N)
		N = N + 1
		For N = N to I
			Response.Write " " & temp(N)
		Next
		Response.Write """>...</span>"
	End If

End Function

Function LoginAccuessFul

	GBL_CHK_TempStr = ""
	If GBL_board_ID = 0 Then
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " class=TBBG9 align=center><tr height=20><td>&nbsp;论坛不存在此版面，请重新选择或需要添加新论坛。</td></tr></table>" & VbCrLf
		GBL_SiteBottomString = ""
		Exit Function
	End If
	If GBL_CHK_TempStr<>"" then
		Response.Write GBL_CHK_TempStr
		GBL_SiteBottomString = ""
	Else
		DisplayAnnouncesSplitPages
	End If

End Function

Function GetActiveUserNumber(BoardID)

	If GBL_board_ID < 1 Then
		GetActiveUserNumber = 0
		Exit Function
	End If
	Dim Rs,tmp
	If isArray(Application(DEF_MasterCookies & "BoardInfo" & BoardID)) = True Then
		Rs = Application(DEF_MasterCookies & "BDOL" & BoardID)
		If Rs > 0 and Rs <= cCur(Application(DEF_MasterCookies & "ActiveUsers")) Then 
			GetActiveUserNumber = Rs
			Exit Function
		End If
	End If
	Set Rs = Con.ExeCute("select count(*) from LeadBBS_onlineUser where AtBoardID=" & BoardID)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		tmp = 0
	Else
		tmp = Rs(0)
		If isNull(tmp) Then tmp = 0
		tmp = cCur(tmp)
	End If
	Rs.Close
	Set Rs = Nothing
	GetActiveUserNumber = tmp
	If isArray(Application(DEF_MasterCookies & "BoardInfo" & BoardID)) = True Then
		Application.Lock
		Application(DEF_MasterCookies & "BDOL" & BoardID) = tmp
		Application.UnLock
	End if

End Function

Function DisplayBoard(Blist)

	If Blist & "" = "" Then Exit Function
	Blist = Split(Blist,",")
	If Ubound(Blist,1) < 0 then Exit Function
	Dim Temp,Flag
	Flag = 0

	Dim GetData,BoardNum
	BoardNum = Ubound(Blist,1)

	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 CurrentAssosrt=0,Flag=0,num=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%>";
	var GBL_Board_ID = "<%=GBL_Board_ID%>";
<%
		If LMT_SimpleHomePage = 1 Then
			If GetBinarybit(GBL_TempletFlag,3) = 1 Then
				Server.ExeCute("../inc/Templet/" & GBL_TempletID & "_2.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=../Board/Boards.asp?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=../Board/Board.asp?BoardID=" + BoardID + ">" + BoardName + "</a></td>");
	num+=1;
	if(num>4)num=0;
}<%
			End If
		Else
			If GetBinarybit(GBL_TempletFlag,4) = 1 Then
				Server.ExeCute("../inc/Templet/" & GBL_TempletID & "_3.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)
{
	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><img src=../images/blank.gif width=2 height=3><br><a href=Board.asp?BoardID=" + GBL_Board_ID + "><font color=white class=HeadFont>" + AssortName + "</font></a></td></tr>");
		Flag = 1;
	}
	document.write("<tr bgcolor=#f7f7f7 align=center class=TBBG9><td width=25 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 + "><a href=../Board/Board.asp?BoardID=" + BoardID + "><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=../Board/Board.asp?BoardID=" + BoardID + ">" + BoardName + "</a>");
	document.write("</td><td align=right rowspan=2 valign=top><img src=../images/null.gif width=2 height=2><br><a href=../announce/announce2.asp?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=../Board/EBoard.asp?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=2 width=192><br>版主：");
	DisplayBoardMastList(MasterList,5);
	document.write("</tr></table></td>");
	document.write("<td align=Left width=80 valign=top><img src=../images/null.gif height=2 width=2><br>主题 <b>" + TopicNum + "</b><br><img src=../images/null.gif height=4 width=2><br>新帖 <b><font color=#666699 class=TBtwofont>" + TodayAnnounce + "</font></b><br><img src=../images/null.gif height=4 width=2><br>总量 <b>" + AnnounceNum + "</b></td>");
	document.write("<td align=left width=222 valign=top><img src=../images/null.gif height=2 width=2><br>");
	Temp = 0;
	if(LastTopicName == "" || LastTopicName==null)
	{
		document.write("主题：无");
	}
	else
	{
		if(LastTopicName.length>15)
		{
			LastTopicName = LastTopicName.substring(0,15-1);
			LastTopicName = htmlencode(LastTopicName) + "..."
		}
		else
		{
			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=../announce/announce.asp?BoardID=" + BoardID + "&ID=" + LastAnnounceID + "&Aupflag=1&Anum=1>" + 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 href=\"../User/LookUserInfo.asp?Name=" + 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
		{
			LastWriteTime = "无"
		}
		document.write("<br><img src=../images/null.gif height=4 width=2><br>时间：" + LastWriteTime);
		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 href=\"User/LookUserinfo.asp?name=" + 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 htmlencode(str)
{
	var re = /(<)/gi;
	var rv = str.replace(re,"&lt;");
	var re = /(>)/gi;
	var rv = rv.replace(re,"&gt;");
	var re = /(\")/gi;
	var rv = rv.replace(re,"&quot;");
	return(rv);
}
	<%
End If
		Dim BoardID,ForumPass
		Dim N

		Dim ShowFlag
		ShowFlag = 0
		For N = 0 to BoardNum
			BoardID = Blist(n)
			GetData = Application(DEF_MasterCookies & "BoardInfo" & BoardID)
			If isArray(GetData) = False Then
				ReloadBoardInfo(BoardID)
				GetData = Application(DEF_MasterCookies & "BoardInfo" & BoardID)
			End If
			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
				If GetData(8,0) = 0 Then
					ShowFlag = 1
					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(GetData(20,0),"\","\\"),"""","\""") & """,""" & Replace(Replace(GetData(10,0),"\","\\"),"""","\""") & """," & GetData(9,0) & ",""" & Replace(Replace(GBL_Board_BoardName,"\","\\"),"""","\""") & """," & GetData(31,0) & "," & GetData(32,0) & ",""" & Replace(Replace(GetData(21,0),"\","\\"),"""","\""") & """,""" & GetData(22,0) & """,""" & GetData(23,0) & """,0,""" & GetData(27,0) & """);"
				End If
			Else
				ShowFlag = 1
				Response.Write VbCrLf & "displayboard(" & BoardID & "," & GetData(1,0) & ",""" & Replace(Replace(GetData(0,0),"\","\\"),"""","\""") & """,""" & Replace(Replace(GetData(14,0),"\","\\"),"""","\""") & """);"
			End If
		Next
		If LMT_SimpleHomePage = 1 Then
		%>
		if(num>0){for(n=num;n<5;n++)document.write("<td width=20%>&nbsp;</td>");}
		<%End If%>
</script><%If ShowFlag = 1 Then%>
		</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
		End If
		Response.Write "<img src=../images/null.gif height=2 width=2><br>"
		'Response.Write "fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1)):"&fix(abs(CDBL(Timer)*1000 - DEF_PageExeTime1))
	End If

End Function

Sub Main

	GBL_CHK_PWdFlag = 0
	GBL_CHK_GuestFlag = 0
	initDatabase
	CheckisBoardMaster
	GBL_CHK_TempStr = ""
	BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID,""
	CheckAccessLimit
	Dim ActiveUsers

	If GBL_CHK_TempStr = "" Then
		UpdateOnlineUserAtInfo GBL_board_ID,GBL_Board_BoardName
		If DisplayChildBoardStyle = 0 Then
			Page = Left(Request.QueryString("p"),14)
			If isNumeric(Page) = 0 or inStr(Page,".") > 0 Then Page = 0
			Page = cCur(Page)
			
			JMPage = Left(Request.QueryString("q"),14)
			If isNumeric(JMPage) = 0 or inStr(JMPage,".") > 0 Then JMPage = 0
			JMPage = Fix(cCur(JMPage))
			If JMPage > DEF_MaxJumpPageNum Then JMPage = 0
			
			If Request.QueryString("Upflag")="1" Then
				Page = Page - JMPage
			Else
				Page = Page + JMPage
			End If
	
			If GetBinarybit(GBL_Board_BoardLimit,12) = 1 or (Page < 1) Then
				Response.Write "<img src=../images/null.gif width=2 height=2><br>"
				If GBL_board_ID > 0 Then DisplayBoard(Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(27,0))
			End If
		End If
		If GetBinarybit(GBL_Board_BoardLimit,12) = 1 Then
			If GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
		Else
	%>
	<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=1 cellpadding=0 align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=<%If GBL_TableHeadString = "" Then
		Response.Write "TBone"
	Else
		Response.Write "TBthree"
	End If%>><tr><td>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr bgcolor=<%=DEF_BBS_Color%> class=TBthree><td colspan=2><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=2></td></tr>
	<tr bgcolor=<%=DEF_BBS_Color%> class=TBthree>
		<td height=20><%If GBL_TableHeadString = "" Then%>&nbsp;<%End If%><a href=../Announce/Announce2.asp?BoardID=<%=GBL_board_ID%>><img src=../images/<%=GBL_DefineImage%>newanc.gif border=0 align=absmiddle alt=新帖></a>
			<a href=../Announce/Announce2.asp?BoardID=<%=GBL_board_ID%>&VoteFlag=yes><img src=../images/<%=GBL_DefineImage%>newpoll.gif border=0 align=absmiddle alt=新投票></a>
			<font color=gray class=GrayFont>讨论区</font>
			<%
			If GBL_Board_GoodNum > 0 Then Response.Write " <a href=EBoard.asp?BoardID=" & GBL_board_ID & ">精华区</a>"
			If isArray(Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI")) Then
				Response.Write " <IMG id=followImg1 name=followImg1 style=""CURSOR: hand"" onclick=ShowOnline(follow1,followImg1," & GBL_Board_ID & ","""") src=""../images/" & GBL_DefineImage & "frame/plus.gif"" loaded=no width=10 height=10>"
				Response.Write "<img src=../images/null.gif width=2 height=2><a href=EBoard.asp?BoardID=" & GBL_board_ID & "&E=1>专题区</a>"
			Else
				If Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI") <> "yes" Then ReloadTopicAssort(GBL_Board_ID)
			End If
			If DEF_EnableTreeView = 1 Then Response.Write " <a href=Board2.asp?BoardID=" & GBL_board_ID & ">树型版面</a>"
			If DEF_DisplayOnlineUser = 1 or DEF_DisplayOnlineUser = 3 Then Response.Write " <IMG id=followImg0 name=followImg0 style=""CURSOR: hand"" onclick=ShowOnline(follow0,followImg0," & GBL_Board_ID & ",""../"") src=""../images/" & GBL_DefineImage & "frame/plus.gif"" loaded=no width=10 height=10>"
			Response.Write "<img src=../images/null.gif width=2 height=2>此版<b><a href=../User/UserOnline.asp?AtBoardID=" & GBL_board_ID & ">"
			ActiveUsers=GetActiveUserNumber(GBL_Board_ID)
			Response.Write ActiveUsers%></a></b>人在线
		</td>
		<td align=right>
			&nbsp;版主：<%DisplayBoardMastList GBL_Board_MasterList,5 %>&nbsp;
		</td>
	</tr>
	</table>

	<script language=javascript>
	var EndFlag=0;
	function ShowOnline(obj,obj2,id,ur,nn){
		if (EndFlag==0){alert("网页未下载完成,请稍候...");return;}
		if (obj.style.display!='block')
		{
			obj.style.display="block";
			obj2.src="../images/<%=GBL_DefineImage%>frame/minus.gif";
			if (obj2.loaded=="no")
			{
				if(ur=="../"){document.frames["hiddenframe"].location.replace("../User/ol.asp?id="+id+"&ur="+ur+"&acu=<%=ActiveUsers%>");}
				else{document.frames["hiddenframe"].location.replace("SmallList.ASP?t=1&BoardID=" + id);}
			}
		}
		else
		{
			obj.style.display="none";
			obj2.src="../images/<%=GBL_DefineImage%>frame/plus.gif";
		}
	}
	</SCRIPT>
	</td></tr>
	<%If DEF_DisplayOnlineUser = 2 Then%>
	<TR bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD align=left><table cellspacing=1 cellpadding=6 width=100%><tr><td><%
          DisplayUserOnline GBL_Board_ID,"../"
          Response.Write "</TD></TR></table></TD></TR>"
	End If%>
	<TR id=follow1 name=follow1 style="DISPLAY: none" bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD id=followTd1 name=followTd1><img src=../images/null.gif width=2 height=2><br>&nbsp;读取中...</TD></TR>
	<%
	If DEF_DisplayOnlineUser = 1 or DEF_DisplayOnlineUser = 3 Then%>
	<TR id=follow0 name=follow0 style="DISPLAY: none" bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
          <TD id=followTd0 name=followTd0><img src=../images/null.gif width=2 height=2><br>&nbsp;读取中...</TD></TR>
	<%End If%>
	</table>
	<img src=../images/blank.gif width=2 height=2><br>
			<%LoginAccuessFul
		End If
	Else
		%>
	<br>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td>
			<font color=ff0000 class=RedFont><b><%=GBL_CHK_TempStr%></b></font> [<a href=../User/help/help.asp#lmt>说明</a>]</td>
	</tr>
	</table>
	<%
	End If
	
	Dim Page,JMPage
	If GBL_CHK_TempStr = "" and DisplayChildBoardStyle <> 0 Then
		Page = Left(Request.QueryString("p"),14)
		If isNumeric(Page) = 0 or inStr(Page,".") > 0 Then Page = 0
		Page = cCur(Page)
		
		JMPage = Left(Request.QueryString("q"),14)
		If isNumeric(JMPage) = 0 or inStr(JMPage,".") > 0 Then JMPage = 0
		JMPage = Fix(cCur(JMPage))
		If JMPage > DEF_MaxJumpPageNum Then JMPage = 0
		
		If Request.QueryString("Upflag")="1" Then
			Page = Page - JMPage
		Else
			Page = Page + JMPage
		End If

		If GetBinarybit(GBL_Board_BoardLimit,12) = 1 or (Page < 1) Then
			If GBL_board_ID > 0 Then
				Response.Write "<img src=../images/null.gif width=2 height=2><br>"
				DisplayBoard(Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(27,0))
			End if
		End If
	End If
	closeDataBase
	If GBL_CHK_TempStr <> "" Then
		Response.Write "<hr size=1 align=center width=" & DEF_BBS_ScreenWidth & " class=TBtwofont>"
		If GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
	End If
	SiteBottom%><IFRAME name=hiddenframe width=0 height=0></IFRAME>
	<script language=javascript>
	EndFlag=1;
	</script><%
	If GBL_SiteBottomString <> "" Then Response.Write GBL_SiteBottomString

End Sub

Function DisplayUserOnline(BoardID,url)

	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+="<font color=#8888ff>※</font><a href=<%=Url%>User/LookUserMoreInfo.asp?OlID=" + GetData0 + ">游客</a></td>";
	}
	else
	{
		rguser+=1;
		if (GetData1 == "隐身会员")
		{
			tempstr+="<font color=gray class=GrayFont>※</font><a href=<%=Url%>User/LookUserMoreInfo.asp?OlID=" + GetData0 + ">隐身会员</a></td>";
		}
		else
		{
			if(parseInt(GetData2)&(1<<(10-1))){tempstr+="<font color=Red class=RedFont>●</font>";}
			else
			{
				if(parseInt(GetData2)&(1<<(14-1))){tempstr+="<font color=Green class=GreenFont>●</font>";}
				else
				{
					if(parseInt(GetData2)&(1<<(8-1))){tempstr+="<font color=Blue class=BlueFont>●</font>";}
					else
					{
						if(parseInt(GetData2)&(1<<(2-1))){tempstr+="<font color=Gray class=GrayFont>●</font>";}
						else{tempstr+="<font color=green class=GreenFont>※</font>";}
					}
				}
			}
			tempstr+="<a href='<%=Url%>User/LookUserInfo.asp?name=" + 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
	If BoardID = 0 Then Response.Write "<br><img src=" & url & "images/null.gif height=7 width=2><br>&nbsp;图例： <font color=#8888ff>※</font>游客 &nbsp; <font color=gray class=GrayFont>※</font>隐身会员 &nbsp; <font color=Red class=RedFont>●</font>总版主 &nbsp; <font color=Green class=GreenFont>●</font>区版主 &nbsp; <font color=Blue class=BlueFont>●</font>论坛版主 &nbsp; <font color=Gray class=GrayFont>●</font>认证会员 &nbsp; <font color=green class=GreenFont>※</font> 注册会员"
	Response.Write "</td></tr>"");"
%>
</script>
</table>
<%

End Function

Sub ReloadTopicAssort(BoardID)

	Dim Rs
	Set Rs = Con.ExeCute("select ID,AssortName,0,0,0 from LeadBBS_GoodAssort where BoardID=" & BoardID & " Order by BoardID,OrderID")
	If Not Rs.Eof Then
		Application.Lock
		Application(DEF_MasterCookies & "BoardInfo" & BoardID & "_TI") = Rs.GetRows(-1)
		Application.UnLock
	Else
		Application.Lock
		Set Application(DEF_MasterCookies & "BoardInfo" & BoardID & "_TI") = Nothing
		Application(DEF_MasterCookies & "BoardInfo" & BoardID & "_TI") = "yes"
		Application.UnLock
	End If
	Rs.Close
	Set Rs = Nothing

End Sub

Main
%>