Просмотр файла 0-key.ru/Modules/AllStatistics.php

Размер файла: 1.69Kb
<?PHP
	include '../System/core.php';
	
	$config['title'] = 'Статистика каталога';
	
	include '../System/header.php';
	
	if (file_exists(H.'Cache/statistic.cache') && $system['Cache_statistic'] == 1)
	{
		echo implode('', file (H.'Cache/statistic.cache'));
	}
	else
	{
	        ob_start();
		$site = mysql_result(mysql_query("SELECT COUNT(*) FROM `site`"),0); $sql_count++;
		$site_act = mysql_result(mysql_query("SELECT COUNT(*) FROM `site` WHERE `mod` = '1' AND `ban` = '0'"),0); $sql_count++;
		$site_mod = mysql_result(mysql_query("SELECT COUNT(*) FROM `site` WHERE `mod` = '0' AND `ban` = '0'"),0); $sql_count++;
		$site_ban = mysql_result(mysql_query("SELECT COUNT(*) FROM `site` WHERE `ban` = '1'"),0); $sql_count++;

		$news = mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"),0); $sql_count++;
		$category = mysql_result(mysql_query("SELECT COUNT(*) FROM `category`"),0); $sql_count++;


		echo '<div class="text">';
		echo '<b>Сайты:</b><br />';
		echo 'Всего сайтов ('.$site.')<br />';
		echo 'Активных ('.$site_act.')<br />';
		echo 'На модерациии ('.$site_mod.')<br />';
		echo 'Забаненые ('.$site_ban.')<br />';
		echo '</div>';

		echo '<div class="text">';
		echo '<b>Общая статистика</b><br />';
		echo 'Новостей ('.$news.')<br />';
		echo 'Категорий ('.$category.')<br />';
		echo '</div>';

		echo '<div class="back"><a href="/"><img src="/Style/icons/back.png" alt="" /> На главную</a></div>';

		$body = ob_get_contents();
		ob_end_clean();
		if($system['Cache_statistic'] == 1)
		{
			wCache($body, 'statistic.cache');
			echo $body;
		}
		else
			echo $body;
		
	}
	include '../System/footer.php';
?>