Файл: index.php
Строк: 89
<?
include_once 'system/sys.php';
include 'system/funcs.php';
verh($_SERVER['HTTP_HOST']);
# Новости
echo'<div class="menu"><a href="/news" style="text-decoration:none; color:white;">Новости ресурса ('.$func->getCount('id','news').')</a></div>';
$ln = DB::$dbs->queryFetch("SELECT * FROM `news` order by `id` desc limit 1");
echo'<div class="list1">'.(mb_strlen($ln['text']) > 150 ? mb_subsrt($ln['text'], 0, 150).' <a href="/news">Читать далее..</a>':$ln['text']).'<br><span style="color: #6d6d6d;">Добавил: '.$func->uNick($ln['us']).' ('.t($ln['t']).')</span><br>
<a href="/komm'.$ln['id'].'">Комментарии</a> ('.DB::$dbs->querySingle("SELECT count(id) from `news_komm` where `id_news` = ?",array($ln['id'])).')';
echo '</div><div class="menu2"><a href="/forum" style="text-decoration:none; color:white;">Форум</a> ('.DB::$dbs->querySingle("select count(id) from `forum_thema`".($cms->us['level']>0?NULL:' where `del`='0'')."").'/'.DB::$dbs->querySingle("select count(id) from `forum_post` ".($cms->us['level']>0?NULL:'WHERE `del` = '0'')."").') (<font color="green">+'.DB::$dbs->querySingle("select count(id) from `forum_thema` where `time`>? ".($cms->us['level']>0?NULL:' and `del`='0'')."",array(time()-86400)).'</font>/<font color="red">+'.DB::$dbs->querySingle("select count(id) from `forum_post` where `time`>? ".($cms->us['level']>0?NULL:'and `del` = '0'')."",array(time()-86400)).'</font>)</div><div class="ram">';
# Форум
$themes = DB::$dbs->query("SELECT * from `forum_thema` ".($cms->us['level']>0?NULL:' where `del`='0'')." order by `last` desc limit 5",array($us['id']));
while($thema = $themes->fetch()){
echo '<div class="raz"><img src="/design/'.($thema['top'] == 1 ? 'prikrep':($thema['type'] == 1 ? 'closed':'the')).'.png" alt="*"/> <a href="/forum/thema'.$thema['id'].'">'.$thema['name'].'</a> ('.($cms->us['level']<1?DB::$dbs->querySingle("select count(id) from `forum_post` where `thema`=? AND `del` = '0'",array($thema['id'])):DB::$dbs->querySingle("select count(id) from `forum_post` where `thema`=?",array($thema['id']))).') <a href="/forum/thema'.$thema['id'].'/page'.ceil(DB::$dbs->querySingle("select count(id) from `forum_post` where `thema`=?",array($thema['id']))/10).'">>></a></div>';
}
# Загруз-центр
echo '</div><div class="menu2"><a href="/zc" style="color: #fff;">Загруз-центр</a> ('.DB::$dbs->querySingle("select count(id) from `zc_file` where `access` = '1'").'/<font color="red">+'.DB::$dbs->querySingle("select count(id) from `zc_file` where `access` = '1' and `time` > ?",array(time()-86400)).'</font>)</div><div class="ram">';
$files = DB::$dbs->query("SELECT * from `zc_file` where `access` = ? order by `id` desc limit 5",array(1));
while($file=$files->fetch()){
echo '<div class="raz"><img src="/images/ups.png" alt=""/> <a href="/zc/file'.$file['id'].'">'.$file['name'].'</a> ('.$func->ves(filesize('./files/zc/'.$file['file'])).')</div>';
}
# Меню
echo '</div><div class="menu2">Меню '.((isSet($cms->us['id']) ? 'пользователя':'гостя')).'</div><div class="list1">';
if(isSet($cms->us['id'])){
echo '<img src="/med/acn.png" alt="*"/> <a href="/kab">Личный кабинет</a><br>';
if($cms->us['level'] > 1) echo '<img src="/med/acn.png" alt="*"/> <a href="/adm"><font color="red">Админ-панель</font></a><br>';
echo '<img src="/images/coins.png" alt="*"/> <a href="/kab/money.php">Моя панель</a><br/>
<img src="/med/out.png" alt="*"/> <a href="/?exit">Выход</a>';
}else echo '<img src="/med/acn.png" alt="*"/> <a href="/log.in.php">Авторизация</a><br>
<img src="/med/acn.png" alt="*"/> <a href="/reg.php">Регистрация</a>';
echo '</div>';
# Выход
if(isset($_GET['exit']) && isset($cms->us['id'])){
setcookie('username', NULL);
setcookie('password', NULL);
header('location:/');
}
niz();
?>