Файл: WM_dvig/index.php
Строк: 72
<?php
$verx = 'Главная';
require_once ('system/function.php');
require_once ('system/header.php');
if(!$user['id']) {
echo '<div class="auth"><a href="/auth" class="aut2">
<span class = "white">Авторизация</span></a>
<a href="/reg" class="aut2"><span class = "white">Регистрация</span>
</a></div>';
} else {
echo '<div class="auth">
<a href="/cab" class="aut2"><span class = "white">Кабинет</span></a>
<a href="/exit" class="aut2"><span class = "white">Выход</span></a>';
if($user['level'] > 1) echo ' <a href="/admin_cabinet" class="aut2"><span class = "white">Админ кабинет</span></a>';
echo '</a></div>';
}
$a = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1");
while($b = mysql_fetch_assoc($a))
{
$text = $b['text'];
$array = explode(" ", $text);
$text_num = array_slice($array, 0, 25);
$text_v = implode(" ", $text_num);
if(count($array) > 3) {
$text_v .= '';
}
echo '<div class="news"><div class="divnews">
'.text($text_v).' [<a href="/news/">Читать всё</a>]
<br />
<img src="/design/imgdes/neww.png" alt="*" /> <b>Добавил:</b> '.nick($b['us']).' ('.times($b['time']).')
<br />
<img src="/design/imgdes/neww.png" alt="*" /> <a href="/news/comm'.$b['id'].'">Комментарии</a> ('.mysql_result(mysql_query('select count(`id`) from `news_comm` where `news` = "'.$b['id'].'"'),0).')
</div></div>';
}
$forum_count = mysql_result(mysql_query('select count(`id`) from `forum_thema`'),0);
$forum_new = mysql_result(mysql_query('select count(`id`) from `forum_thema` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$forum_count_post = mysql_result(mysql_query('select count(`id`) from `forum_post`'),0);
$forum_new_post = mysql_result(mysql_query('select count(`id`) from `forum_post` where `time` > "'.(time()-((60*60)*24)).'"'),0);
echo '<div class="razd" style="font-weight:bold;"><a href="/forum">Форум</a> ('.$forum_count.'<font color="red">+'.$forum_new.'</font>/'.$forum_count_post.'<font color="green">+'.$forum_new_post.'</font>)</div>';
if($forum_count == 0) echo '<div class="home"><center>Пусто.</center></div>';
$a = mysql_query("SELECT * FROM `forum_thema` ORDER BY `up` DESC LIMIT 5");
while($b = mysql_fetch_assoc($a))
{
if($b['status'] == 0) $i = 'tem'; else $i = 'close';
echo '<div class="menu_j"><a href="/forum/thema'.$b['id'].'?selection=top" class="top_menu_j"><img src="/design/imgdes/'.$i.'.png" alt="*"/> '.$b['name'].' ('.mysql_result(mysql_query('select count(`id`) from `forum_post` WHERE `thema` = "'.$b['id'].'"'),0).')</a></div>';
}
echo '<div class="razd" style="font-weight:bold;">Разделы сайта</div>';
echo '<div class="menu_j"><a href="/online" class="top_menu_j"><img src="/design/imgdes/onl.png" alt="*"/> Кто онлайн ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `vizit` > '".(time()-720)."'"),0).')</a></div>';
require_once ('system/footer.php');
?>