<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="bbstop.asp"-->
<script language="javascript">
     function viewPage2(ipage){
        document.frmList2.Page.value=ipage
        document.frmList2.submit()        
     }
     function viewPage1(ipage){
        document.frmList2.Page.value=ipage
        document.frmList2.submit()
     }
function loadThreadFollow(t_id,a_id,b_id){
	var targetImg =eval("followImg" + t_id);
	var targetDiv =eval("follow" + t_id);
	if (targetImg.src.indexOf("nofollow")!=-1){return false;}
	if ("object"==typeof(targetImg)){
		if (targetDiv.style.display!='block'){
			targetDiv.style.display="block";
			targetImg.src="images/minus.gif";
			if (targetImg.loaded=="no"){
				document.frames["hiddenframe"].location.replace("loadtree1.asp?boardid="+b_id+"&rootid="+t_id+"&id=" + a_id);
			}
		}else{
			targetDiv.style.display="none";
			targetImg.src="images/plus.gif";
		}
	}
}
function resumeTree(rootid){
	loadThreadFollow(rootid);
}
</script>
<!--#include file="bbsinc/boardskin.asp"-->
<%   	dim sql,rs
	dim Ers,Esql
   	dim boardtype
   	dim master_1,master_2
   	dim username,cname
    	dim foundErr 
    	dim ErrMsg
    	dim bBoardEmpty
	dim boardid
	dim timeLimited,limitime,tl
	dim totalrec
	dim n,i,RowCount
	dim p
	dim currentpage
    	dim announceIDRange1
    	dim announceIDRange2
	dim skin
	dim tableback
	dim tabletitle
	dim tablebody
	dim atablebody
	dim tablefont
	dim tablecontent
	dim alertfont
	dim Forumlogo
	dim guestlist
    	foundErr = false
    	ErrMsg = ""
    	selStr = "()"
	if memberclass = user_level7 or memberclass = user_level8 or memberclass = user_level9 then
		guestlist=""
	else
		guestlist=" lockboard<>2 and "
	end if
 Rem ------获取参数(get or post的)------
 Rem ------包括版面的ID和页次------
	set rs=server.createobject("adodb.recordset")
	set iprs=server.createobject("adodb.recordset")
    	Call getInput()
    	call chkInput()
	'显示版头
	call boardinfo()
    	if foundErr then
		call error()
	else
		call AnnounceList1()
		call listPages3()
		call boardlist()
		if founderr=true then call error()
	if err.number<>0 then err.clear
	end if
REM 显示版面信息---Headinfo
	sub boardinfo()
  	sql="select boardtype,lockboard,boardmaster,boardskin,Tableback,Tabletitle,Tablebody,aTablebody,TableFont,TableContent,AlertFont,strAllowForumCode,strAllowHTML,strIMGInPosts,strIcons,strflash,Forumlogo from bbs_board where "&guestlist&" boardID="&cstr(boardid)
'	response.write sql
'	response.end
 	rs.open sql,conn,1,1
 	if not(rs.bof and rs.eof) then
    		boardtype=rs("boardtype")
		lockboard=rs("lockboard")
		Tableback=trim(rs("Tableback"))
		Tabletitle=trim(rs("Tabletitle"))
		Tablebody=trim(rs("Tablebody"))
		aTablebody=trim(rs("aTablebody"))
		TableFont=trim(rs("TableFont"))
		TableContent=trim(rs("TableContent"))
		AlertFont=trim(rs("AlertFont"))
		Forumlogo=rs("Forumlogo")
		if trim(rs("boardmaster"))<>"" then
			master_1=split(rs("boardmaster"), "|")
			for i = 0 to ubound(master_1)
			master_2=""+master_2+"<a href='dispuser.asp?name="+htmlencode(master_1(i))+"' target=_blank>"+htmlencode(master_1(i))+"</a>&nbsp;"
			next
		else
		response.write "无版主"
		end if
	else
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>您选择的版面不存在或者您没有权限察看该版面。"
		exit sub
	end if
	rs.close
%>
<table bgcolor=#f9f9f9 cellpadding=0 cellspacing=0 border=0 width="762" align=center class=pian>
<tr><td height=25 bgcolor=#f9f9f9 colspan=2>&nbsp;现在时间是：<%=now%>&nbsp;&nbsp;您当前的位置：<a href=index.asp><font color=#6330ff>会员社区首页</font></a>&nbsp;&gt;&gt;&nbsp;<a href="list.asp?boardid=<%=boardid%>"><font color=#6330ff><%=boardtype%></font></a></td></tr>
</tr><tr><td height="1" bgcolor=#efefef colspan=2></td></tr>
<tr><form action="list.asp" method="get"><td align=center colspan=2><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>&nbsp;&nbsp;</td></form>
</tr>
<tr><td align=left valign=middle>&nbsp;&nbsp;<a href="announce.asp?boardid=<%=boardid%>"><img src="images/post.gif" border="0" alt="发表一个新主题"></a></td>
<td align=right><a href="list.asp?boardID=<%=boardid%>&amp;page=1"><img src="images/refresh_1.gif" border=0 alt="刷新本论坛"></a><%if memberclass=user_level8 or memberclass=user_level9 then%>
&nbsp;&nbsp;<b><a href=admin_news.asp?boardid=<%=boardid%>>发布公告</a></b>
<%end if%>
&nbsp;&nbsp;<b><a href="elist.asp?boardid=<%=boardid%>">论坛精华</a>&nbsp;&nbsp;论坛版主</b>：<%=master_2%></td></tr>
</table>
<%end sub
sub boardlist()
%>
<TABLE cellSpacing=1 cellPadding=4 bgColor=#ffffff width="762" border=0 align=center class=pian>
<TR><TD align=left><b>&gt;&gt;&nbsp;在线统计</b><%if request("action")<>"online" then%>
  [<a href=list.asp?boardid=<%=boardid%>&action=online>显示详细在线列表</a>]
<%else%>
  [<a href=list.asp?boardid=<%=boardid%>>关闭详细在线列表</a>]
<%end if%>  现在论坛上共有 <b><%=online()%></b> 位会员与 <b><%=guest()%></b> 位客人</td><tr>
<tr><td valign=middle><img src=images/xianhua.gif>在线图示：&nbsp;<img src=images/ao.gif> 大佬 <img src=images/ao1.gif> 斑猪 <img src=images/messages1.gif> 会员 <img src=images/messages2.gif> 客人<%if request("action")<>"online" then
else
call onlineuser()
end if%></TD></TR>
</TABLE>
<table border="0" bgcolor=#ffffff cellpadding="0" cellspacing="3" width="762" align="center" class=pian>
<form action=list.asp method=get>
  <tr>
    <td valign="middle" nowrap align=center height=30>
<select name='boardid' onchange='javascript:submit()'>
<option value="">跳转论坛
<%
	dim rs1,sql1
	set rs1=server.createobject("adodb.recordset")
	sql="select * from bbs_class order by id"
	rs.open sql,conn,1,1
	do while not rs.eof
	id=rs("id")
%>
<option value="1">>>&nbsp;<%=rs("class")%> <<
<%
   		sql1="select boardid,boardtype from bbs_board where "&guestlist&" class="&id&" order by boardid"
   		rs1.open sql1,conn,1,1
		if rs1.eof and rs1.bof then
%>
<option value="">没有论坛
<%else%>
<%do while not rs1.eof%>
<option value="<%=rs1("boardid")%>"><%=rs1("boardtype")%>
<%
		rs1.movenext
		loop
		end if
		rs1.close

	rs.movenext
	loop
	rs.close
	set rs1=nothing
%>
</select></td></tr>
</form>
</table>
<%end sub

sub onlineuser()
	response.write "<hr color=#ff8000 noshade size=1>"
	guests="客人"
	set iprs=server.createobject("adodb.recordset")
	sql="select username,startime,lastimebk,stats,userclass,browser from bbs_online where username<>'"&guests&"'"
	rs.open sql,conn,1,1
	do while not rs.eof

	if rs("userclass")=user_level9 then
	response.write "<img src=images/ao.gif alt=特殊人物>&nbsp;"
	response.write "<a href=dispuser.asp?name="&htmlencode(rs("username"))&">"
	response.write "<ACRONYM TITLE=""目前位置："&rs("stats")&"&#13;&#10;来访时间："&rs("startime")&"&#13;&#10;活动时间："&rs("lastimebk")
	response.write """>"
	response.write htmlencode(rs("username"))
	response.write "</ACRONYM></a>&nbsp;"

	elseif rs("userclass")=user_level8 or rs("userclass")=user_level7 then
	response.write "<img src=images/ao1.gif alt="&user_level7&">&nbsp;"
	response.write "<a href=dispuser.asp?name="&htmlencode(rs("username"))&">"
	response.write "<ACRONYM TITLE=""目前位置："&rs("stats")&"&#13;&#10;来访时间："&rs("startime")&"&#13;&#10;活动时间："&rs("lastimebk")
	response.write """>"
	response.write htmlencode(rs("username"))
	response.write "</ACRONYM></a>&nbsp;"

	else
	response.write "<img src=images/messages1.gif>&nbsp;"
	response.write "<a href=dispuser.asp?name="&htmlencode(rs("username"))&">"
	response.write "<ACRONYM TITLE=""目前位置："&rs("stats")&"&#13;&#10;来访时间："&rs("startime")&"&#13;&#10;活动时间："&rs("lastimebk")
	response.write """>"
	response.write htmlencode(rs("username"))
	response.write "</ACRONYM></a>&nbsp;"
	end if

        rs.movenext
        loop
	rs.close

	if guestuser=1 then
	sql="select username,startime,lastimebk,stats,userclass,browser from bbs_online where username='"&guests&"'"
	rs.open sql,conn,1,1
	do while not rs.eof
	response.write "<img src=images/messages2.gif>&nbsp;"
	response.write "<ACRONYM TITLE=""目前位置："&rs("stats")&"&#13;&#10;来访时间："&rs("startime")&"&#13;&#10;活动时间："&rs("lastimebk")
	response.write """>"
	response.write rs("username")
	response.write "</ACRONYM>&nbsp;"
	rs.movenext
	loop
	rs.close
	end if
end sub

function online()
	guests="客人"
    	tmprs=conn.execute("Select count(id) from bbs_online where username<>'"&guests&"'") 
    	online=tmprs(0) 
	set tmprs=nothing 
	if isnull(online) then online=0
end function 

function guest()
	guests="客人"
    	tmprs=conn.execute("Select count(id) from bbs_online where username='"&guests&"'") 
    	guest=tmprs(0) 
	set tmprs=nothing 
	if isnull(guest) then guest=0
end function 

Sub getInput()
        	'On Error Resume Next
        	Rem ------获取版面ID------
        	BoardID = Request("BoardID")
        	Rem ------获取页次------
        	currentPage=request("page")
    	End Sub
    
    	sub chkInput
		'on error resume next
		if BoardID="" then
			BoardID=1
		elseif not isInteger(BoardID) then
			BoardID=1
		else
			BoardID=clng(BoardID)
			if err then
				BoardID=1
				err.clear
			end if
		end if
		if currentpage="" then
			currentpage=1
		elseif 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
	set rs=nothing
%>
<TABLE border=0 cellPadding=4 cellSpacing=1 width="762" bgcolor=#ffffff align=center class=pian>
<TR><TD align="center"><img src=images/folder.gif>&nbsp;&nbsp;开放的主题&nbsp;&nbsp;&nbsp;&nbsp;
<img src=images/hotfolder.gif>&nbsp;&nbsp;回复超过10贴&nbsp;&nbsp;&nbsp;&nbsp;
<img src=images/lockfolder.gif>&nbsp;&nbsp;锁定的主题&nbsp;&nbsp;&nbsp;&nbsp;
<img src=images/istop.gif>&nbsp;&nbsp;固顶的主题&nbsp;&nbsp;&nbsp;&nbsp;
<img src=images/ztop.gif>&nbsp;&nbsp;总固顶的主题
<%if memberclass=user_level9 or memberclass=user_level8 then%>&nbsp;&nbsp;&nbsp;&nbsp;
<a href=admin_alldel.asp?boardid=<%=boardid%>>批量删除</a>
<%end if%>
</td></tr>
</TBODY></TABLE>
<!--#include file="bbsend.asp"-->