Файл: php-zona.ru/index.php
Строк: 54
<?php
/*
ALTER TABLE `forum_post` ADD `plus` INT( 11 ) NOT NULL DEFAULT '0', ADD `minus` INT( 11 ) NOT NULL DEFAULT '0'
*/
/*
ALTER TABLE `forum_topic` ADD `top` INT( 1 ) NOT NULL DEFAULT '0'
*/
//Создаем титл страницы
$title='Php-Zona.Ru - зона настоящих мастеров';
//Инклюдим шапку
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
if(isset($_GET['hidden_news'])){
$db->query("UPDATE `users` SET `hidden_news`='1' WHERE `id`='".$user['id']."'");
success('Новость успешно скрыта!');
}
?>
<div class="title"><a href="news">Новости</a> (<?=$db->query("SELECT `id` FROM `news`")->num_rows?>)</div>
<?if($user['hidden_news']==0){?>
<div class="text">
<?
$news=$db->query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1")->fetch_assoc();
?>
<b><?=$news['name']?></b><br/>
<?=output($news['text'])?><br/>
Автор: <?=nick($news['author'])?><br/>
Создана: <?=times($news['time'])?><br/>
<a href="/news_comm/<?=$news['id']?>">Комментарии</a> (<?=$db->query("SELECT `id` FROM `news_comm` WHERE `id_news`='".$news['id']."'")->num_rows?>)<br/>
<?if(isset($user['id'])){?>
<a href="?hidden_news">[Скрыть]</a>
<?}?>
</div>
<?}?>
<div class="title"><a href="/forum">Форум</a> (<?=$db->query("SELECT `id` FROM `forum_topic`")->num_rows?> / <?=$db->query("SELECT `id` FROM `forum_post`")->num_rows?>)</div>
<?
$q = $db->query("SELECT `id`, `name` FROM `forum_topic` ORDER BY `up` DESC LIMIT 5");
while($t = $q->fetch_assoc()){
?>
<div class="section"><a href="/forum/topic/<?=$t['id']?>"><?=htmlspecialchars($t['name'])?></a> (<?=$db->query("SELECT `id` FROM `forum_post` WHERE `id_topic`='".$t['id']."'")->num_rows?>)</div>
<?
}
?>
<div class="title"><a href="/zc">Загруз центр</a> (<?=$db->query("SELECT `id` FROM `zc_file` WHERE `moderation`='1'")->num_rows?>
<?
if ($db->query("SELECT `id` FROM `zc_file` WHERE `time`>='".time()."-86400' AND `moderation`='1'")->num_rows!=0) {
?>
<font color="red"> +<?=$db->query("SELECT `id` FROM `zc_file` WHERE `time`>='".time()."-86400' AND `moderation`='1'")->num_rows?></font>
<?
}
?>
)
</div>
<?
$sqlz =$db->query("SELECT `id`, `name` FROM `zc_file` WHERE `moderation`='1' AND `dir`!=20 ORDER BY `id` DESC LIMIT 3");
while($f = $sqlz->fetch_assoc()){
?>
<div class="section">
<a href="/zc/file/<?=$f['id']?>"><?=$f['name']?></a>
</div>
<?
}
?>
<div class="title">Меню</div>
<div class="section"><a href="/users">Пользователи</a> (<?=$db->query("SELECT `id` FROM `users`")->num_rows?>)</div>
<div class="section"><a href="/rules">Правила сайта</a> (<?=$db->query('SELECT `id` FROM `rules`')->num_rows?>)</div>
<?
//инклюдим ноги
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>