View file include/stat.php

File size: 2.5Kb
<?
$all_topics = mysql_result(mysql_query("SELECT COUNT(*) FROM themes"), 0);
$all_posts = mysql_result(mysql_query("SELECT COUNT(*) FROM posts"), 0);
$all_users = mysql_result(mysql_query("SELECT COUNT(*) FROM users"), 0);
$baners = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban`"), 0);
	if($version == "wml")
	{
		header("Content-type: text/vnd.wap.wml; charset=utf-8");
		echo(doctype("Статистика форума").$tag);
		if($status == "admin")
	{
		echo("Хостов/Хитов: <b>(".$host."/".$hit.")</b><br />");
	}
		echo("
Зарегистрировано: ".mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0)."<br />
Тем/Сообщений: ".$all_topics."/".$all_posts."<br />
Забаненные: ".$baners." <br />");
if($authorize)
{
echo('<a href="./?p=0&amp;v=wml&amp;sid='.$sid.'">В форум</a>');
}
else
{
echo('<a href="./?p=0&amp;v=wml">В форум</a>');
}
echo(''.$tagC.'</p></card></wml>');
		}
		elseif($version == "xhtml")
		{
			header("Content-type: text/html; charset=utf-8");
			echo('<html>
<head>
<title>Статистика форума</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr align="center" bgcolor="'.$style['title'].'"><td colspan="2">
<font color="#FFFFFF"><b>Статистика форума</b></font>
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2"></td></tr>');
		if($status == "admin")
			{
echo('<tr bgcolor="'.$style['text'].'"><td>
'.$tag.'Хостов/Хитов:'.$tagC.'</td><td><b>('.$tag.$host.'/'.$hit.$tagC.')</b></td></tr>');
			}
echo('<tr bgcolor="'.$style['text'].'"><td>
'.$tag.'Зарегистрировано:'.$tagC.'</td><td><b>'.$tag.mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0).$tagC.'</b></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
'.$tag.'Тем/Сообщений:'.$tagC.'</td><td><b>'.$tag.$all_topics.$tagC.'/'.$tag.$all_posts.$tag.'</b></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
'.$tag.'Забаненные:'.$tagC.' </td><td><b>'.$tag.$baners.$tagC.'</b></td></tr>');
$maxonline = explode('<>', file_get_contents('online.txt'));
echo('
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">');
if($authorize)
{
echo(''.$tag.'<a href="./?p=0&amp;v=xhtml&amp;sid='.$sid.'">В форум</a>'.$tagC.'');
}
else
{
echo(''.$tag.'<a href="./?p=0&amp;v=xhtml">В форум</a>'.$tagC.'');
}
echo('</td></tr>
</table>
</body></html>');
		}
?>