aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-02-12 03:06:17 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-02-12 03:06:17 +0000
commit1ce5626c67f28523e1ed45939e33d79553160ad7 (patch)
treedf32d862a43ae68cd46f24dfa559aa14cc7ccc59
parente81ed1cc0add78dc3d96cca0a92205d6c226679b (diff)
downloadforums-1ce5626c67f28523e1ed45939e33d79553160ad7.tar
forums-1ce5626c67f28523e1ed45939e33d79553160ad7.tar.gz
forums-1ce5626c67f28523e1ed45939e33d79553160ad7.tar.bz2
forums-1ce5626c67f28523e1ed45939e33d79553160ad7.tar.xz
forums-1ce5626c67f28523e1ed45939e33d79553160ad7.zip
Added MSSQL DB size as provided by Josh ... feedback/updates welcome :)
git-svn-id: file:///svn/phpbb/trunk@2099 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/admin/index.php49
1 files changed, 34 insertions, 15 deletions
diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php
index e2538f2fc1..f02802db1e 100644
--- a/phpBB/admin/index.php
+++ b/phpBB/admin/index.php
@@ -49,7 +49,7 @@ function inarray($needle, $haystack)
//
// Generate relevant output
//
-if( $HTTP_GET_VARS['pane'] == 'left' )
+if( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
{
$dir = @opendir(".");
@@ -116,7 +116,7 @@ if( $HTTP_GET_VARS['pane'] == 'left' )
include('page_footer_admin.'.$phpEx);
}
-elseif( $HTTP_GET_VARS['pane'] == 'right' )
+elseif( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
{
include('page_header_admin.'.$phpEx);
@@ -257,19 +257,6 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' )
}
}
}
-
- if( $dbsize >= 1048576 )
- {
- $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 ));
- }
- else if( $dbsize >= 1024 )
- {
- $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 ));
- }
- else
- {
- $dbsize = sprintf("%.2f Bytes", $dbsize);
- }
} // Else we couldn't get the table status.
}
else
@@ -282,11 +269,43 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' )
$dbsize = $lang['Not_available'];
}
}
+ else if( preg_match("/^mssql/", SQL_LAYER) )
+ {
+ $sql = "SELECT ( SELECT SUM(reserved)
+ FROM sysindexes where indid in(0,1,255))
+ * low AS dbsize
+ FROM master.dbo.spt_values
+ WHERE number = 1 AND type = 'E'";
+ if( $result = $db->sql_query($sql) )
+ {
+ $dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['Not_available'];
+ }
+ else
+ {
+ $dbsize = $lang['Not_available'];
+ }
+ }
else
{
$dbsize = $lang['Not_available'];
}
+ if ( is_integer($dbsize) )
+ {
+ if( $dbsize >= 1048576 )
+ {
+ $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 ));
+ }
+ else if( $dbsize >= 1024 )
+ {
+ $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 ));
+ }
+ else
+ {
+ $dbsize = sprintf("%.2f Bytes", $dbsize);
+ }
+ }
+
$template->assign_vars(array(
"NUMBER_OF_POSTS" => $total_posts,
"NUMBER_OF_TOPICS" => $total_topics,