Файл: index.php
Строк: 114
<?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> <c1><?=$db->query("SELECT `id` FROM `news`")->num_rows?></c1> </div>
<?if($user['hidden_news']==0){?>
<div class="text">
<?
$news=$db->query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1")->fetch_assoc();
?>
<b><?=htmlspecialchars($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> <c1><?=$db->query("SELECT `id` FROM `forum_topic`")->num_rows?> / <?=$db->query("SELECT `id` FROM `forum_post`")->num_rows?></c1></div>
<?
$q = $db->query("SELECT `id`, `name` FROM `forum_topic` ORDER BY `up` DESC LIMIT 5");
while($t = $q->fetch_assoc()){
?>
<div class="section"><img src="style/themes/<?=$design['system_name']?>/images/chat.png" style="float:left;margin-top: -3px"><a href="/forum/topic/<?=$t['id']?>"><?=htmlspecialchars($t['name'])?></a> <c><?=$db->query("SELECT `id` FROM `forum_post` WHERE `id_topic`='".$t['id']."'")->num_rows?></c></div>
<?
}
?>
<div class="title"><a href="/zc">Загруз центр</a> <c1><?=$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>
<?
}
?>
</c1>
</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">
<img src="style/themes/<?=$design['system_name']?>/images/downloads01.png" style="float:left;margin-top: -3px"><a href="/zc/file/<?=$f['id']?>"><?=htmlspecialchars($f['name'])?></a>
</div>
<?
}
?>
<div class="title"><a href="/shop">Магазин</a> <c1><?=$db->query("SELECT `id` FROM `shop_goods` WHERE `moderation`='1'")->num_rows?>
<?
if ($db->query("SELECT `id` FROM `shop_goods` WHERE `time`>='".time()."-86400' AND `moderation`='1'")->num_rows!=0) {
?>
<font color="red"> +<?=$db->query("SELECT `id` FROM `shop_goods` WHERE `time`>='".time()."-86400' AND `moderation`='1'")->num_rows?></font>
<?
}
?>
</c1>
</div>
<?
$sqlz =$db->query("SELECT `id`, `name` FROM `shop_goods` WHERE `moderation`='1' ORDER BY `id` DESC LIMIT 3");
while($g = $sqlz->fetch_assoc()){
?>
<div class="section">
<a href="/shop/good/<?=$g['id']?>"><?=htmlspecialchars($g['name'])?></a>
</div>
<?
}
?>
<div class="title"><a href="/phpcodes">Полезные PHP коды</a> <c1><?=$db->query("SELECT `id` FROM `phpcodes_codes` WHERE `moderation`='1'")->num_rows?><?
if($db->query("SELECT `id` FROM `phpcodes_codes` WHERE `time`>=".time()."-86400 AND `moderation`='1'")->num_rows!=0){
?><font color="red">+<?=$db->query("SELECT `id` FROM `phpcodes_codes` WHERE `time`>=".time()."-86400 AND `moderation`='1'")->num_rows?></font><?
}
?></c1></div>
<?
$sqlp = $db->query("SELECT `id`, `name` FROM `phpcodes_codes` WHERE `moderation`='1' ORDER BY `id` DESC LIMIT 3 ");
while($p = $sqlp->fetch_assoc()){
?>
<div class="section">
<img src="style/themes/<?=$design['system_name']?>/images/php.png" style="float:left;margin-top: -3px"><a href="/phpcodes/code/<?=$p['id']?>"><?=htmlspecialchars($p['name'])?></a>
</div>
<?
}
?>
<div class="title"><a href="/newspaper">Газета</a> <c1><?=$db->query("SELECT `id` FROM `newspaper_article`")->num_rows?><?
if($db->query("SELECT `id` FROM `newspaper_article` WHERE `time`=".time()."-86400")->num_rows!=0){?>
<font color="red">+<?=$db->query("SELECT `id` FROM `newspaper_article` WHERE `time`=".time()."-86400")->num_rows?></font><?}?></c1></div>
<?
$query = $db->query("SELECT `id`, `name` FROM `newspaper_article` ORDER BY `id` DESC LIMIT 3");
while ($a = $query->fetch_assoc()) {
?>
<div class="section">
<a href="/newspaper/article/<?=$a['id']?>"><?=htmlspecialchars($a['name'])?></a>
</div>
<?
}
?>
<div class="title">Меню</div>
<div class="section"><img src="style/themes/<?=$design['system_name']?>/images/user.png" style="float:left;margin-top: -3px"><a href="/users">Пользователи</a> <c><?=$db->query("SELECT `id` FROM `users`")->num_rows?></c></div>
<div class="section"><img src="style/themes/<?=$design['system_name']?>/images/document.png" style="float:left;margin-top: -3px"><a href="/rules">Правила сайта</a> <c><?=$db->query('SELECT `id` FROM `rules`')->num_rows?></c></div>
<?
//инклюдим ноги
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>