<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Upload_Setup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->
<!-- #include file=../inc/bbsmanage_Fun.asp -->
<%
DEF_BBS_HomeUrl = "../../"
Dim GBL_ID
initDatabase
GBL_CHK_TempStr = ""
GBL_ID = GBL_UserID

SiteHead(DEF_SiteNameString & " - 管理员")
UserTopicTopInfo
DisplayUserNavigate("社区空间占用情况")
If GBL_CHK_Flag=1 Then
	LoginAccuessFul
Else%>
	<table width=96%>
	<tr>
	<td>
	<%
	If Request("submitflag")="" Then
		Response.Write "<br><b>请先登录</b>"
	Else
		Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
	End If
	DisplayLoginForm
	Response.Write "</p>"%>
	</td>
	</tr>
	</table>
<%End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function LoginAccuessFul%>

<table width="97%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td>
	<%If CheckSupervisorUserName = 1 Then%>
              <%DisplaySystemInfo%>
              <br><br>
	<%Else%>
	       <p><br>
              已经成功登录！<br></p>
              <br><br>
              
	<%End If%>
	<br><br>
            </td>
        </tr>
      </table>

<%End Function

Function DisplaySystemInfo

	Dim BBS_Space,Upload_Space,Database_Space,FS

	On Error Resume Next
	Dim FSFlag
	FSFlag = 1
	If DEF_FSOString <> "" Then
		Set fs = CreateObject(DEF_FSOString)
		If err <> 0 Then
			Err.Clear
			FSFlag = 0
		End If
		Set Fs = Nothing
	End If
	If DEF_FSOString <> "" and FSFlag = 1 Then
		dim f,fso
		Set fso = CreateObject(DEF_FSOString) 
	'	Set f = fso.GetFolder(Server.Mappath(DEF_BBS_HomeUrl)) 
	'	BBS_Space = f.Size
	'	Set f = Nothing
	'	Set f = fso.GetFolder(Server.Mappath(Replace(Replace(DEF_BBS_HomeUrl & DEF_BBS_UploadPhotoUrl,"/","\"),"\\","\"))) 
	'	Upload_Space = f.Size
	'	Set f = Nothing
		If DEF_UsedDataBase = 1 Then
			Set f = fso.GetFile(Server.Mappath(Replace(Replace(DEF_BBS_HomeUrl & DEF_AccessDatabase,"/","\"),"\\","\")))
			Database_Space = f.Size
			Set f = Nothing
		End If
		Set fso = Nothing
	Else
		Response.Write "<br><br><font color=Red class=RedFont>社区关闭FSO功能，查看占用空间失败．</font><br>" & VbCrLf
		BBS_Space = 0
		Upload_Space = 0
		Database_Space = 0
		Exit Function
	End If

	Response.Write "<br><br>"
	'Response.Write "社区目录总占用空间：<font color=red class=RedFont>" & PrintSpaceValue(BBS_Space) & "</font> [" & BBS_Space & " Bytes]<br>"
	'Response.Write "上传文件总占用空间：<font color=red class=RedFont>" & PrintSpaceValue(Upload_Space) & "</font> [" & Upload_Space & " Bytes]<br>"
	Response.Write "社区数据库文件大小：<font color=red class=RedFont>" & PrintSpaceValue(Database_Space) & "</font> [" & Database_Space & " Bytes]<br>"

End Function

Function PrintSpaceValue(vv)

	Dim v
	v = vv
	If v > 1024*1024 Then
		v = v/1024/1024
		If inStr(v,".") Then
			v = Left(v,inStr(v,".")+2)
		End If
		v = v & " M"
	Else
		v = Fix(v/1024) & " K"
	End If
	PrintSpaceValue = v

End Function
%>