diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-11-03 21:56:17 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-11-03 21:56:17 +0000 |
commit | 1fcd1afe9dc10da02d129abea2ce1bf030677146 (patch) | |
tree | e107cd3b8786ce9171ab1879a492aa3463360203 /phpBB/admin | |
parent | 68795b03d5f29d0851cac3bd3688f5479ac7c171 (diff) | |
download | forums-1fcd1afe9dc10da02d129abea2ce1bf030677146.tar forums-1fcd1afe9dc10da02d129abea2ce1bf030677146.tar.gz forums-1fcd1afe9dc10da02d129abea2ce1bf030677146.tar.bz2 forums-1fcd1afe9dc10da02d129abea2ce1bf030677146.tar.xz forums-1fcd1afe9dc10da02d129abea2ce1bf030677146.zip |
Hopefully killed bug #472269 dead, a touch of Domestos power
git-svn-id: file:///svn/phpbb/trunk@1271 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/admin')
-rw-r--r-- | phpBB/admin/index.php | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php index 65ea4b65f8..4f89d2ae06 100644 --- a/phpBB/admin/index.php +++ b/phpBB/admin/index.php @@ -195,13 +195,15 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' ) // This code is heavily influenced by a similar routine // in phpMyAdmin 2.2.0 // - if(SQL_LAYER == 'mysql') + if( preg_match("/^mysql/", SQL_LAYER) ) { $sql = "SELECT VERSION() AS mysql_version"; if($result = $db->sql_query($sql)) { - list($version) = $db->sql_fetchrow($result); - if( ereg("^3\.23", $version) ) + $row = $db->sql_fetchrow($result); + echo $version = $row['mysql_version']; + + if( preg_match("/^(3\.23|4\.)/", $version) ) { $sql = "SHOW TABLE STATUS FROM " . $dbname; @@ -214,17 +216,27 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' ) $dbsize = 0; for($i = 0; $i < count($tabledata_ary); $i++) { - if($tabledata_ary[$i]['Type'] != "MRG_MyISAM" && strstr($tabledata_ary[$i]['Name'], $table_prefix) ) + if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" ) { - $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; + if( $table_prefix != "" ) + { + if( strstr($tabledata_ary[$i]['Name'], $table_prefix) ) + { + $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; + } + } + else + { + $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; + } } } - if($dbsize >= 1048576) + if( $dbsize >= 1048576 ) { $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 )); } - else if($dbsize >= 1024) + else if( $dbsize >= 1024 ) { $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 )); } |