<!--#include file="bbstop.asp"-->
<%	set rs=server.createobject("adodb.recordset")
	set rs1=server.createobject("adodb.recordset")
%>
<TABLE width=762 bgcolor=#ffffff border=0 align=center class="pian">
<tr><td height=25 bgcolor=#f9f9f9>&nbsp;现在时间是：<%=now%>&nbsp;&nbsp;您当前的位置：<a href=index.asp><font color=#6330ff>会员社区首页</font></a>&nbsp;&gt;&gt;&nbsp;</td></tr>
</tr><tr><td height="1" bgcolor=#ff9900></td></tr>
<TR><TD Align=right height=30>今日贴数:<font color=red><b><%=todays()%></b></font> | 主题总数:<b><%=titlenum()%></b> | 帖子总数:<b><%=gettipnum()%></b> 注册会员<B><%=allusers()%></B> | 欢迎新会员“<a href=dispuser.asp?name=<%=htmlencode(newuser())%>><%=htmlencode(newuser())%></a>”加入&nbsp;&nbsp;&nbsp;&nbsp;<a href=queryresult.asp?type=6&selCompare=2>查看新的贴子</a> | <a href=toplist.asp?orders=2>新进来宾</a> | <a href=toplist.asp?orders=1>发贴排行</a></TD></TR>
</TABLE>

<!-论坛部分->
<TABLE align=center bgcolor=#ffffff cellSpacing=1 cellPadding=4 width="762" border=0 class=pian>
<TR bgcolor=#efefef>
          <TD width="5%">&nbsp;</TD>
          <TD width="37%" bgcolor="#efefef"><B>论坛名称</FONT></B></TD>
          <TD width="4%" align=middle noWrap><B>贴子总数</B></TD>
          <TD width="4%" align=middle noWrap><B>主题总数</B></TD>
          <TD width="22%" align=middle noWrap><B>最新发表</B></TD>
          <TD width="12%" align=middle noWrap><B>版主</B></TD>
</TR>
<%
	sql="select id,class from bbs_class order by id"
	rs.open sql,conn,1,1
	do while not rs.eof
	id=rs("id")
%>
        <TR>
          <TD colSpan=6><B>&gt;&gt;&nbsp;<%=rs("class")%></B>
	</TD></TR>
<%
	if memberclass=user_level7 or memberclass=user_level8 or memberclass=user_level9 then
	sql1="select boardid,boardtype,class,readme,lastbbsnum,lastposttime,lastpostuser,boardmaster,lockboard,lasttopicnum from bbs_board "
	sql1=sql1&" where class="&id&" order by boardid"
	else
	sql1="select boardid,boardtype,class,readme,lastbbsnum,lastposttime,lastpostuser,boardmaster,lockboard,lasttopicnum from bbs_board "
	sql1=sql1&" where class="&id&" and lockboard<>2 order by boardid"
	end if
'	response.write ""&sql1&""&session("userclass")&""
'	response.end
	rs1.open sql1,conn,1,1
	do while not rs1.eof
%>
<TR bgcolor=#f9f9f9>
<TD vAlign=top align=middle><%if rs1("lockboard")=1 then%>
<IMG src="images/offlock.gif" alt="本论坛已锁定">
<%else%><IMG src="images/on.gif">
<%end if%></TD>
<TD vAlign=top><a href="list.asp?boardid=<%=rs1("boardid")%>"><font color=ff3300><b><%=rs1("boardtype")%></a></b></font><br><%=rs1("readme")%>
</TD>
	<TD vAlign=center noWrap align=middle><%=rs1("lastbbsnum")%></TD>
	<TD vAlign=center noWrap align=middle><%=rs1("lasttopicnum")%></TD>
        <TD noWrap>
<IMG border=0 src="images/lastpost.gif">  <%=rs1("lastposttime")%>:<a href=dispuser.asp?name=<%=htmlencode(rs1("lastpostuser"))%>><%=htmlencode(rs1("lastpostuser"))%></a></TD>
          <TD vAlign=center align=middle>
<%
master_1=split(rs1("boardmaster"), "|")
for i = 0 to ubound(master_1)
	master_2=""+master_2+"<a href=dispuser.asp?name="+htmlencode(master_1(i))+">"+htmlencode(master_1(i))+"</a><br>"
next
response.write master_2
master_2=""
%></TD>
</TR>
<%
	rs1.movenext
	loop
	rs1.close

	rs.movenext
	loop
	rs.close

	sql="select boardname,readme,url from bbs_link order by id"
	rs.open sql,conn,1,1
	if not rs.eof and not rs.bof then
%>
        <TR><TD colSpan=6><b>&gt;&gt;&nbsp;友情链接</b></TD></TR>
<%
	do while not rs.eof
%>
          <TR bgColor=#efefef>
          <TD vAlign=top align=middle><IMG src="images/shareforum.gif"> </TD>
          <TD colSpan=7 vAlign=top bgcolor="#efefef">
<a href="<%=rs("url")%>" target=_blank><%=htmlencode(rs("boardname"))%></a><br>
<%=htmlencode(rs("readme"))%>
          </TD>
          </TR>
<%
	rs.movenext
	loop
	end if
	rs.close

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 

function allusers() 
    	tmprs=conn.execute("Select count(id) from [huiyuan]") 
    	allusers=tmprs(0) 
	set tmprs=nothing 
	if isnull(allusers) then allusers=0 
end function 
function newuser()
	set tmprs=server.createobject("adodb.recordset")
    	sql="Select top 1 huiyuan from huiyuan order by id desc"
	tmprs.open sql,conn,1,1
	if tmprs.eof and tmprs.bof then
	newuser="没有会员"
	else
    	newuser=tmprs("huiyuan")
	end if
	set tmprs=nothing
end function 

function gettipnum() 
    	tmprs=conn.execute("Select Count(announceID) from bbs_content") 
    	gettipnum=tmprs(0) 
	set tmprs=nothing 
	if isnull(gettipnum) then gettipnum=0 
end function 

function titlenum() 
    	tmprs=conn.execute("Select Count(announceID) from bbs_content where parentID=0") 
    	titlenum=tmprs(0) 
	set tmprs=nothing 
	if isnull(titlenum) then titlenum=0 
end function 

function todays()
	zkyear=year(date)
	zkmonth=month(date)
	zkday=day(date)	
	tmprs=conn.execute("Select count(announceid) from bbs_content Where year(dateandtime)="&zkyear&" and month(dateandtime)="&zkmonth&" and day(dateandtime)="&zkday&"")
    	todays=tmprs(0)
	set tmprs=nothing
	if isnull(todays) then todays=0
end function

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
%>
<!--论坛在线统计-->
<TR bgColor=#efefef><TD colspan=6><b>&gt;&gt;&nbsp;在线统计</b><%if request("action")<>"online" then%>
  [<a href=index.asp?action=online>显示详细在线列表</a>]
<%else%>
  [<a href=index.asp>关闭详细在线列表</a>]
<%end if%>  现在论坛上共有 <b><%=online()%></b> 位会员与 <b><%=guest()%></b> 位客人</td><tr>
<tr bgColor=#ffffff><td align=center valign=middle><img src=images/xianhua.gif></td><td colspan=5>在线图示：&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>
<%set rs=nothing
set rs1=nothing%>
<!--#include file="bbsend.asp"-->