<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="admin_Checkuser.asp"-->
<HTML><HEAD><title><%=StrVar(1)%>--管理页面</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<!--#include file="inc/admin_main.css"-->
</HEAD>
<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<%
	if  not sysadmin or session("adminlogin")<>"0K" Then
	Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用，请<a href=admin_index.asp target=_top>登陆</a>后进入。"
	Call Error("Information",ErrMsg)
	else
		call main()
		call endconnection()
end if

sub main()

dim rs,sql,boardid
dim boardbbsnum,topicnum,postnum

boardid=clng(request("boardid"))
set rs=server.createobject("adodb.recordset")
sql="select count(postid) from Reply where boardid="&boardid
set rs=conn.execute(sql)

if rs.bof and rs.eof then
postnum=0
else
postnum=rs(0) '统计本版面的回复数

end if

sql="select count(postid) from topic where boardid="&boardid
set rs=conn.execute(sql)

if rs.bof and rs.eof then
 topicnum=0
else
topicnum=rs(0)  '统计本版面的主题数
end if

boardbbsnum=postnum+topicnum '统计本版面帖子数

sql="update bbs set boardbbsnum="&boardbbsnum&",topicnum="&topicnum&",postnum="&postnum&" where boardid="&boardid
conn.execute(sql)

rs.close
set rs=nothing
response.write ("<script language=javascript>alert('更新版面贴子数据成功！！');document.location.href='admin_boardmanange.asp';</script>")

end sub
%>