query("TRUNCATE TABLE " . PREFIX . "_subscribe"); } if( $_GET['action'] == "clear" ) { $cache->delete('usergroup.php' ); $cache->delete('category.php' ); $cache->delete('banned.php' ); $cache->delete('cron.php' ); $cache->clear(); } $row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" ); $stats_news = $row['count']; $row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_subscribe" ); $count_subscribe = $row['count']; $row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_comments" ); $count_comments = $row['count']; $row = $db->super_query( "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users" ); $stats_users = $row['count']; $row = $db->super_query( "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users where banned='yes'" ); $stats_banned = $row['count']; if ($stats_banned) $stats_banned = "( {$stats_banned} )"; else $stats_banned = ""; $row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post where approve = '0'" ); $approve = $row['count']; if( $approve and $user_group[$member_id['user_group']]['allow_all_edit'] ) { $approve = "( " .$approve . " ) [ {$lang['stat_medit_link']} ]"; } else {$approve = "";} $db->query( "SHOW TABLE STATUS FROM `" . DBNAME . "`" ); $mysql_size = 0; while ( $r = $db->get_array() ) { if( strpos( $r['Name'], PREFIX . "_" ) !== false ) $mysql_size += $r['Data_length'] + $r['Index_length']; } $db->free(); $mysql_size = mksize( $mysql_size ); $cache_size = mksize( $cache->size() ); $dts = @disk_total_space("."); $dfs = @disk_free_space("."); $totalspace = mksize($dts); $freespace = mksize($dfs); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $winstats = shell_exec("net statistics server"); preg_match("(\d{1,2}/\d{1,2}/\d{4}\s+\d{1,2}\:\d{2}\s+\w{2})", $winstats, $matches); $uptimeSecs = time() - strtotime($matches[0]); $uptime = format_uptime($uptimeSecs); } else { /*$data = shell_exec('uptime'); $uptime = explode(' up ', $data); $uptime = explode(',', $uptime[1]); $uptime = $uptime[0].', '.$uptime[1];*/ $uptime = exec("cat /proc/uptime"); $uptime = split(" ",$uptime); $uptimeSecs = $uptime[0]; $uptime = format_uptime($uptimeSecs); } if( $member_id['user_group'] == 1 ) { echo <<
HTML; } else { //Информация не для админов } echo <<
Аптайм сервера: {$uptime}
{$lang['stat_allnews']} {$stats_news} {$approve}
{$lang['stat_comments']} {$count_comments} [ {$lang['last_comm']} ]
{$lang['stat_users']} {$stats_users} {$stats_banned} [ Редактировать пользователей ]
{$lang['stat_bd']} {$mysql_size}
Размер кеша: {$cache_size}
{$lang['free_size']} {$freespace} ({$totalspace})
HTML; if( ! is_writable( ROOT_DIR . "/cache/" ) or ! is_writable( ROOT_DIR . "/cache/system/" ) ) { echo "
$lang[stat_cache]
 
"; } if( $member_id['user_group'] == 1 ) { echo "
"; if ($count_subscribe) echo " "; echo "
"; } echo <<
HTML; echofooter(); ?>