<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!-- #include file="inc/char.asp" -->
<!-- #include file="inc/char_board.asp" -->
<!--#include file="inc/bbs_list.asp"-->
<!--#include file="inc/theme.asp"-->
<%
	Rem ----------------------
	Rem ------主程序开始------
	Rem ----------------------
	Dim currentPage
	Dim tl
	Dim Guests
	Dim limitime
	Dim Fast_action
	Dim totalrec
	Fast_action=false

	if boardmaster or master then
		guestlist=""
		Fast_action=true
	else
		guestlist=" lockboard=0 and "
		Fast_action=false
	end if
	if founderr then
		call nav()
		call headline(1)
		call error()
	else
    	call chkInput()
		if founderr then
			call nav()
			call headline(1)
			call error()
		else
			if cint(boardskin)=6 then
				if membername="" then
				response.write "<script>location.href='login.asp'</script>"
				response.end
				end if
			elseif cint(boardskin)=5 then
				if membername="" then
					founderr=true
					Errmsg=Errmsg+"<br>"+"<li>本论坛为秘密论坛，请<a href=login.asp>登陆</a>并确认您的用户名已经得到管理员的认证后进入。"
				'else
					'if chkboardlogin(boardid,membername)=false then
					'founderr=true
					'Errmsg=Errmsg+"<br>"+"<li>本论坛为认证论坛，请确认您的用户名已经得到管理员的认证后进入。"
					'end if
				end if

			elseif cint(boardskin)=7 then
				if membername="" then
					founderr=true
					Errmsg=Errmsg+"<br>"+"<li>本论坛为秘密论坛，请<a href=login.asp>登陆</a>并确认您的用户名已经得到管理员的认证后进入。"
				'else
					'if chkboardlogin(boardid,membername)=false then
					'founderr=true
					'Errmsg=Errmsg+"<br>"+"<li>本论坛为认证论坛，请确认您的用户名已经得到管理员的认证后进入。"
					'end if
				end if
			end if
			if founderr then
				call nav()
				call headline(1)
				call error()
			else
				call nav()
				call headline(1)
				call boardtop(boardid)
                call listPages3()
				call AnnounceList1()	
				    call listPages4()				
				call boardlist()
				if founderr=true then call error()
			end if
		end if
	end if
	call endline()
	REM 显示版面信息---Headinfo
	sub boardtop(boardid)
	response.write "<style>TABLE {BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px; }TD {BORDER-RIGHT: 0px; BORDER-TOP: 0px; color: "&TableContentColor&"; }</style>"

	dim onlinenum,guestnum,hiddennum
	onlinenum=online(boardid)
	guestnum=guest(boardid)
    hiddennum=hidden(boardid)
	response.write "<script language=javascript src=inc/list.js></script><TABLE cellSpacing=0 cellPadding=0 width="&TableWidth&" border=0 align=center>"&_
				"<TBODY><tr>"&_
				"<td align=center width=34 valign=middle id='elFader' style='position:relative; left: 20px;visibility:hidden; height:16'> <img src="&picurl&P_call&" border=0 alt=本分论坛的公告！不可不看！！ width=20 height=17 >"&_ 
				"</td><td valign=middle align=left>"

	sql="select top 3 title,addtime from bbsnews where boardid="&boardid&"  order by id desc"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,1
	if rs.bof and rs.eof then
	titlelist="""<IMG align=absMiddle src="&Picurl&P_call&">没有公告"","""""
	else
	do while not rs.eof
	dim titlelist
	titlelist=titlelist&"""<a href=announcements.asp?boardid="&boardid&" target=_blank><IMG align=absMiddle border=0 src="&Picurl&P_call&">"&rs(0)&"</a>  ("&rs(1)&")"","""","
	
	rs.movenext
		loop
		titlelist=titlelist&"""<IMG align=absMiddle src="&Picurl&P_call&">欢迎访问"&stats&"  ("&now()&")"","""""
		end if
	rs.close
	set rs=nothing

%>

	 <SCRIPT LANGUAGE='JavaScript' SRC='inc/fader.js' TYPE='text/javascript'></script>
		 <SCRIPT LANGUAGE='JavaScript' TYPE='text/jscript'>
prefix="";
arNews = [<%=titlelist%>]
</SCRIPT>
	  <%
	response.write "</td><td align=right valign=middle><p>"&_
				"<form action=list.asp method=get>"&_
				"<input type=hidden name=boardid value="& boardid &">"&_
				"<select name=selTimeLimit onchange='javascript:submit()'>"&_
				"<option value=all>查看所有的主题"&_
				"<option value=1>查看一天内的主题"&_
				"<option value=2>查看两天内的主题"&_
				"<option value=7>查看一星期内的主题"&_
				"<option value=15>查看半个月内的主题"&_
				"<option value=30>查看一个月内的主题"&_
				"<option value=60>查看两个月内的主题"&_
				"<option value=180>查看半年内的主题"&_
				"</select>"&_
				"</form></p></td></tr></TBODY></TABLE>"


response.write "<table cellpadding=0 cellspacing=0 border=0 width="&TableWidth&" align=center valign=middle><tr>"&_
			"<td align=center width=2> </td>"&_
			"<td align=left> <a href='announce.asp?boardid="& boardid &"'>"&_
			"<img src="&picurl&P_post&" border=0 alt='发新帖'></a>"&_
			"&nbsp;&nbsp;<a href='vote.asp?boardid="&boardid&"'>"&_
			"<img src="&picurl&P_vote&" border=0 alt='发起新投票'></a>"&_
			"&nbsp;&nbsp;<a href='SmallPaper.asp?boardid="&boardid&"'>"&_
			"<img src="&picurl&P_paper&" border=0 alt='发布小字报'></a></td>"&_
			"<td align=right><img src="&picurl&"team2.gif align=absmiddle>  "& master_2 &"</td></tr></table>"

	response.write "<table cellpadding=0 cellspacing=0 width="&TableWidth&" height=24  align=center><!-- MSTableType=""nolayout"" --><tr><td height=24 width=53 style=""border-bottom:1px solid #C6D2E3; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; "">"
	response.write "<a href=AllPaper.asp?boardid="&boardid&" title=点击查看本论坛所有小字报><b>广播：</b></a> "
	response.write "</td><td height=24 width=555 style=""border-bottom:1px solid #C6D2E3; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; "">"
	response.write "<marquee scrolldelay=150 scrollamount=4 onmouseout=""if (document.all!=null){this.start()}"" onmouseover=""if (document.all!=null){this.stop()}""><img src=pic/che.gif> "
	set rs=conn.execute("SELECT TOP 5 s_id,s_username,s_title FROM SmallPaper where datediff('d',s_addtime,Now())<=1 and s_boardid="&boardid&" ORDER BY s_addtime desc")
	do while not rs.eof
	response.write " <font color="&online_mc&">"&htmlencode(rs(1))&"</font>说：<a href=javascript:openScript('viewpaper.asp?id="&rs(0)&"&boardid="&boardid&"',500,400)>"&htmlencode(rs(2))&"</a>"
	rs.movenext
	loop
	rs.close
	set rs=nothing
	response.write "</td><td height=24 width=157 style=""border-bottom:1px solid #C6D2E3; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; "">"
	response.write "<p align=right><a href='elist.asp?boardid="& boardid &"' title=查看本版精华><font color="&AlertFontColor&"><B>精华</B></font></a> | <a href=online.asp?boardid="&boardid&" title=查看本版在线详细情况>在线</a>"
	if boardmaster or master then response.write "<a href='admin_boardaset.asp?boardid="& boardid &"'>管理</a> | "
	response.write "</td></tr></table>"
	end sub

	sub boardlist()

response.write "<script language=""JavaScript"" type=""text/JavaScript"">function mmLoadMenus() {if (window.mm_menu_1) return; window.mm_menu_1 = new Menu(""root"",90,18,"",12,""#000000"",""#000000"",""#FFFF00"",""#FFCC00"",""left"",""middle"",3,0,800,-5,85,true,true,true,0,false,true);"
		

	dim rs1,sql1
	sql="select id,class from class order by id"
	set rs=server.createobject("adodb.recordset")
	set rs1=server.createobject("adodb.recordset")
	rs.open sql,conn,1,1
	if not(rs.eof and rs.bof) then
	do while not rs.eof
	response.write "mm_menu_1.addMenuItem(""╋ "& rs(1) &""");"

		sql1="select boardid,boardtype from board where "&guestlist&" class="& rs(0)&" order by boardid"
		set rs1=server.createobject("adodb.recordset")
		rs1.open sql1,conn,1,1
		if rs1.eof and rs1.bof then
			rs1.close : set rs1=nothing
		else
			do while not rs1.eof
				response.write "mm_menu_1.addMenuItem(""├" & rs1(1) & """,""window.open('list.asp?boardid="&rs1(0)&"', '_self');"");"
			rs1.movenext
			loop
			rs1.close
			set rs1=nothing
		end if

	rs.movenext
	loop
	rs.close
	set rs=nothing
	end if

	response.write "  mm_menu_1.hideOnMouseOut=true;"
	
	response.write "  mm_menu_1.bgColor='#555555';"
	
	response.write "  mm_menu_1.menuBorder=1;"
	
	response.write "  mm_menu_1.menuLiteBgColor='#FFFFFF';"
	
	response.write "  mm_menu_1.menuBorderBgColor='#CCCCCC';"
	
	response.write "&_</script>"

	response.write "<p>　</p><table cellpadding=0 cellspacing=0 width="&TableWidth&" height=59 align=center><!-- MSTableType=nolayout --><tr><td height=25 width=110 bgcolor=#EEF7FD style=""border-left: 1px solid #C4D8ED; border-right: 1px solid #C4D8ED; border-top: 1px solid #C4D8ED; border-bottom-width: 1px""><p align=center><b>论坛图例说明</b></td><td height=25 width=795 style=""border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px solid #C4D8ED"">　</td></tr><tr><td height=36 width=905 colspan=2 style=""border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px solid #C4D8ED""><p align=center>"&_

				"<img src="&picurl&P_opentopic&"> 开放的主题"&_
				"&nbsp;&nbsp; &nbsp;<img src="&picurl&P_hottopic&"> 回复超过10贴"&_
				"&nbsp;&nbsp; &nbsp;<img src="&picurl&P_closetopic&"> 锁定的主题"&_
				"&nbsp;&nbsp; &nbsp;<img src="&picurl&P_istop&"> 固定顶端的主题 "&_
				"&nbsp;&nbsp; &nbsp;<img src="&picurl&P_Tisbest&"> 精华帖子 "&_
				" &nbsp;&nbsp; &nbsp;<img src="&picurl&P_isvote&"> 投票帖子 "
response.write "</td></tr></table>"
	end sub
    
	sub chkInput
      BoardID = Request("BoardID")
        currentPage=request("page")
  if BoardID="" or not isInteger(BoardID) or BoardID="0"then
   BoardID=0
   founderr=true
   Errmsg=Errmsg+"<li>您试图从外部访问一个不存在的版面，请浏览其他版面。"
  		else
			BoardID=clng(BoardID)
			if err then
				BoardID=1
				err.clear
			end if
		end if
		if currentpage="" or not isInteger(currentpage) then
			currentpage=1
		else
			currentpage=clng(currentpage)
			if err then
				currentpage=1
				err.clear
			end if
		end if
		if request("selTimeLimit")="all" then
			tl=""
		elseif request("selTimeLimit")="" then
			tl=""
		else
			limitime=request("selTimeLimit")
			tl=" and dateandtime>=#"&cstr(cdate(now()-limitime))&"# "
		end if
	end sub

if instr(scriptname,"index.asp")>0 or instr(scriptname,"list.asp")>0 then
if index_moveFlag=1 then
call admove()
end if
if index_fixupFlag=1 then
call fixup()
end if
end if
%>
<!--#include file="online_l.asp"-->
<!--#include file="inc/ad_fixup.asp"-->
<!--#include file="footer.asp"-->
<iframe width=0 height=0 src="" id="hiddenframe"></iframe>
