📄 accountdetails.php
字号:
<?php//$lang checkeddefined('WikyBlog') or die("Not an entry point...");if( !isOwner(true,false) ) return false; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Detailed Info//function detailedInfo(){ global $page,$dbInfo,$pageOwner,$dbObject,$lang; ob_start(); //// Start $page->displayTitle = $lang['account_details']; $username = wbDB::escape(wbStrtolower($pageOwner['username'])); $field = $lang['account'].': '.$pageOwner['username']; $field = $lang['account_details']; $dbObject->links[$field] = '/Special/'.$pageOwner['username'].'/AccountDetails'; $dbObject->links['?'] = 'Account_Details'; //// Users Table Query echo '<table cellspacing="3" cellpadding="3" border="0">'; echo '<tr><td>'.$lang['username'].': </td><td>'.$pageOwner['username'].'</td></tr>'; echo '<tr><td>'.$lang['email'].': </td><td>'; if( isset($pageOwner['email']) ){ echo $pageOwner['email']; } echo '</td></tr>'; echo '</table>'; //// Table Sizes $i=0; foreach($dbInfo as $key => $space){ if( !isset($space['dbTable']) ){ continue; } if( ($key == 'help') && ($pageOwner['username'] != $GLOBALS['wbAdminUser'])){ continue; } // need $space['dbTable'] so that we can get the right sizes from $pageOwner['fileUsage'] // $queryA[$i] = '('; $queryA[$i] .= ' SELECT 1 as type, "'.$space['dbTable'].'" as name, "'.$lang[$space['class']].'" as showName, count(*) as count, '; $queryA[$i] .= ' 0 as sum '; $queryA[$i] .= ' FROM '.$space['dbTable']; $queryA[$i] .= ' WHERE owner = "'.$username.'"'; $queryA[$i] .= ')'; $i++; } $query = implode(' UNION ',$queryA); $result = wbDB::runQuery($query); //echo '<br/> <h2 class="heading">File Usage</h2>'; echo '<table border="0" class="tableRows" width="100%">'; echo '<tr><th>'.$lang['entries'].'</th><th>'.$lang['files'].'</th><th>'.$lang['size'].'</th><th>'.$lang['average'].'</th></tr>'; $totals['count'] = 0; $totals['size'] = 0; $classes[] = 'class="tableRowEven" '; $classes[] = 'class="tableRowOdd" '; $i = 0; while($row = mysql_fetch_assoc($result) ){ $odd = $classes[($i%2)]; $i++; echo '<tr '.$odd.'>'; echo '<td>'.$row['showName'].'</td>'; echo '<td>'.$row['count'].'</td>'; $totals['count'] += $row['count']; if( isset($pageOwner['fileUsage'][$row['name']]) && (int)$row['type'] === 1 ){ $val = $pageOwner['fileUsage'][$row['name']]; }else{ $val = $row['sum']; } if( is_numeric($val) && $val > 0 ){ echo '<td>'.number_format($val/1000,2).' '.$lang['kb'].'</td>'; }else{ echo '<td> - </td>'; } if( is_numeric($val) && $row['count'] > 0 ){ $totals['size'] += $val; //echo '<td>'.number_format(($val/$row['count'])/1000,2).' KB</td>'; echo '<td>'.number_format(($val/$row['count'])).' '.$lang['bytes'].'</td>'; }else{ echo '<td> - </td>'; } echo '</tr>'; } $odd = $classes[($i%2)]; $i++; echo '<tr ><th>'.$lang['other'].'</th><th>'.$lang['files'].'</th><th>'.$lang['size'].'</th><th>'.$lang['average'].'</th></tr>'; echo '<tr '.$classes[1].'><td>'.$lang['uploaded_files'].'</td>'; $val = 0; if( isset($pageOwner['files']) ){ $val += count($pageOwner['files']); } if( isset($pageOwner['imgs']) ){ $val += count($pageOwner['imgs']); } echo '<td>'.$val.'</td>'; if( $val != 0 ){ echo '<td>'.number_format($pageOwner['disk_usage']/1000,2).' '.$lang['kb'].'</td>'; //echo '<td>'.number_format(($pageOwner['disk_usage']/$val)/1000,2).' KB</td>'; echo '<td>'.number_format($pageOwner['disk_usage']/$val).' '.$lang['bytes'].'</td>'; $totals['count'] += $val; $totals['size'] += $pageOwner['disk_usage']; }else{ echo '<td> - </td><td> - </td>'; } echo '</tr>'; echo '<tr ><th><b>'.$lang['total'].'</th><th>'.$lang['files'].' </th><th>'.$lang['size'].'</th><th>'.$lang['average'].'</th></tr>'; $odd = $classes[($i%2)]; if( $totals['count'] != 0){ echo '<tr '.$classes[1].'><td>'.$lang['all'].' </td><td>'.$totals['count'].'</td>'; echo '<td>'.number_format($totals['size']/1000,2).' '.$lang['kb'].'</td>'; //echo '<td>'.number_format(($totals['size']/$totals['count'])/1000,2).' KB</td>'; echo '<td>'.number_format($totals['size']/$totals['count']).' '.$lang['bytes'].'</td>'; echo '</tr>'; }else{ echo '<tr '.$classes[1].'><td>'.$lang['all'].'</td><td> 0 </td><td> - </td><td> - </td></tr>'; } echo '</table>'; //// Output $page->contentA[$field] = wb::get_clean(); // had another idea for doing this... // get the total size of the pagehistory table, then divide by the number of rows being used by a certain user // it would just be an estimite but the history sizes are the most important // -> would have to do two queries for each table // - SHOW TABLE STATUS LIKE "pagehistory" // - SELECT COUNT(*) WHERE owern = $pageOwner }detailedInfo();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -