. * * $Id$ * */ /** * based upon semmelstatz * Copyright (c) 2005-2009 Andreas 'Redunzl' Mueller (redunzl@gmx.de) * * @license http://www.gnu.org/licenses/gpl-2.0.html * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License (version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ if(current_user_can('manage_statz')) { global $wpdb; $pre = $wpdb->prefix; $lenpre = strlen($pre); $tablesstatus = $wpdb->get_results("SHOW TABLE STATUS"); print "
"; print "
"; print "

"; print "

SemmelstatzR > ".semr_i18n("Database")."

"; print "
".semr_i18n("Database")."
"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; $row_usage = 0; $data_usage = 0; $index_usage = 0; $total_usage = 0; $overhead_usage = 0; foreach($tablesstatus as $key=>$tablestatus) { if(substr($tablestatus->Name,0,$lenpre) != $pre) continue; print ""; print ""; print ""; print ""; print ""; print ""; print ""; if($tablestatus->Data_free > 0) { print ""; } else { print ""; } $row_usage += $tablestatus->Rows; $data_usage += $tablestatus->Data_length; $index_usage += $tablestatus->Index_length; $total_usage += $tablestatus->Data_length + $tablestatus->Index_length; $overhead_usage += $tablestatus->Data_free; echo ''; } print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "
".semr_i18n("No.")."".semr_i18n("Tables")."".semr_i18n("Records")."".semr_i18n("Data")."".semr_i18n("Index")."".semr_i18n("Data")." & ".semr_i18n("Index")."".semr_i18n("Overhang")."".($key+1)."".$tablestatus->Name."".number_format($tablestatus->Rows,0,',','.')."".number_format($tablestatus->Data_length/1024,0,',','.')." kb".number_format($tablestatus->Index_length/1024,0,',','.')." kb".number_format(($tablestatus->Data_length + $tablestatus->Index_length)/1024,0,',','.')." kb"; print " ".number_format($tablestatus->Data_free/1024,2,',','.')." kb"; print "--
".semr_i18n("Total")." ".number_format($row_usage,0,',','.')."".number_format($data_usage/1024,0,',','.')." kb".number_format($index_usage/1024,0,',','.')." kb".number_format($total_usage/1024,0,',','.')." kb".number_format($overhead_usage/1024,2,',','.')." kb

"; printf(semr_i18n("Only the WORDPRESS tables belonging to the blog %s will be shown."), get_option('blogname')); print "

"; print "
"; sem_showCopyright(); print "
"; } else { echo '

No permission to access this area

'; } ?>