fetchq('SELECT * FROM misc'); $tstats = $sql->query('SHOW TABLE STATUS'); while ($t = $sql->fetch($tstats)) $tbl[$t['Name']]=$t; /* $sch_info = ""; $schemes = $sql->query(' SELECT COUNT(u.id) as schemecount, u.scheme, schemes.name FROM users AS u LEFT JOIN schemes ON (u.scheme = schemes.id) WHERE (schemes.ord >= 0) GROUP BY u.scheme ORDER BY schemecount DESC '); while ($row = $sql->fetch($schemes)) { $sch_info .= "$tccell1>$row[name]$tccell1>$row[schemecount]"; } */ print " $header
$tblstart $tccellh>Interesting statistics $tccell1l> Posts in last 24 hours $tblend
$tblstart $tccellh width='200'>Records$tccellh>  $tccell1s>Most posts within 24 hours: $tccell2ls>$misc[maxpostsday], on ".date($dateformat,$misc['maxpostsdaydate'])." $tccell1s>Most posts within 1 hour: $tccell2ls>$misc[maxpostshour], on ".date($dateformat,$misc['maxpostshourdate'])." $tccell1s>Most users online: $tccell2ls>$misc[maxusers], on ".date($dateformat,$misc['maxusersdate'])."$misc[maxuserstext] $tblend
". /* // This is kind of in Edit Profile already. "$tblstart$tccellh colspan='2'>Scheme Usage Breakdown $tccellh>Scheme Name$tccellh>Users $sch_info $tblend
". */ "$tblstart $tccellh>Table name $tccellh>Rows $tccellh>Avg. data/row $tccellh>Data size $tccellh>Index size $tccellh>Overhead $tccellh>Total size" .tblinfo('posts_text') .tblinfo('posts') .tblinfo('pmsgs_text') .tblinfo('pmsgs') .tblinfo('postlayouts') .tblinfo('threads') .tblinfo('users') .tblinfo('forumread') .tblinfo('threadsread') .tblinfo('postradar') .tblinfo('ipbans') .tblinfo('defines') .tblinfo('dailystats') .tblinfo('rendertimes') ."$tblend "; print $footer; printtimedif($startingtime); function sp($sz) { // $b="$sz B"; // if($sz>1023) $b=sprintf('%01.2f',$sz/1024).' kB'; // if($sz>10239) $b=sprintf('%01.1f',$sz/1024).' kB'; // if($sz>102399) $b=sprintf('%01.0f',$sz/1024).' kB'; // if($sz>1048575) $b=sprintf('%01.2f',$sz/1048576).' MB'; // if($sz>10485759) $b=sprintf('%01.1f',$sz/1048576).' MB'; // if($sz>104857599) $b=sprintf('%01.0f',$sz/1048576).' MB'; $b=number_format($sz,0,'.',','); return $b; } function tblinfo($n) { global $tbl,$tccell2,$tccell2l; $t=$tbl[$n]; return " $tccell2>$t[Name] $tccell2l>".sp($t['Rows']) ." $tccell2l>".sp($t['Avg_row_length'])." $tccell2l>".sp($t['Data_length'])." $tccell2l>".sp($t['Index_length'])." $tccell2l>".sp($t['Data_free'])." $tccell2l>".sp($t['Data_length']+$t['Index_length']).""; }