Файл: BlogExl_v_3/modules/index.php
Строк: 70
<?
head('Главная');
info();
echo '<div class="rega">'.($user['level']==2?'<a href="/admin/">Админка</a> | ':NULL).''.(isset($user['id'])?'<a
href="/my">Личный кабинет</a> | <a href="/pages/exit.php">Выход</a>':'<a
href="/pages/auth.php">Вход</a> | <a href="/pages/reg.php">Регистрация</a>').'</div>';
echo '<div
class="rega"><form method="post" action="/pages/search.php?&go"><input name="text"
type="text" maxlength="200" value=""/><input
type="image" src="/design/find.png"
align="middle" alt="*"/></form></div>';
echo '<div
class="news_glav">';
echo 'Новости блога:<br/>';
$news = $dbs->query("SELECT * FROM `news` order by `time` desc limit 1");
if(!$news->num_rows){$func->msg('Новостей нет!');}
while($n = $news->fetch_assoc()){
echo $func->out($n['msg']).'<br/><a href="/kom'.$n['id'].'">Комментарии </a>('.$dbs->query("SELECT * FROM `news_komm` where ".($user['level']>=2?NULL:'activ = 0 and')." `id_news` = '$n[id]'")->num_rows.')';
}
echo '</div>';
$blog = $dbs->query("SELECT * FROM `blog` where `activ` = '1' order by `time` desc limit 3");
if(!$blog->num_rows){$func->msg('Статей еще нет...');}
while($b = $blog->fetch_assoc()){
$raz = $dbs->query("SELECT * FROM `cat` where `id` = '$b[id_cat]' limit 1")->fetch_assoc();
echo '<div class="razd"><img
src="/design/044.png" alt="*"/> <a
href="/read'.$b['id'].'" style="text-
decoration:none;">'.$b['name'].'</a></div><div class="pod_razd">'.mb_substr($b['msg'],0,130, 'utf-8').'....<a
href="/read'.$b['id'].'"><img src="/design/020.png"
alt="*" align="middle" />читать далее</a><br/>Раздел: <a href="pages/cat.php?id='.$raz['id'].'">'.$raz['name'].'</a><br/><a href="/komm'.$b['id'].'">Комментарии </a>('.$dbs->query("SELECT * FROM `komm` where `id_blog` = '$b[id]'")->num_rows.')</div>';
}
echo '<div class="komm_razd"><img
src="/design/056.png" alt="*"/>Комменты</div>';
$kom = $dbs->query("SELECT * FROM `komm` where `type` = '0' order by `time` desc limit 3");
while($ko = $kom->fetch_assoc()){
echo '<div class="post2"><img src="/design/komm.png" alt="*"/> '.$func->nik($ko['id_us']).': '.$func->out($ko['msg']).' <small>('.times($ko['time']).')</small></div>';
}
echo '<hr></hr>';
echo '<div class="menu2"><a href="/pages/top.php">Самые читаемые
статьи</a></div><div class="menu"><a
href="/pages/all.php">Все статьи</a> ('.$dbs->query("SELECT * FROM `blog` where `activ` = '1'")->num_rows.')</div><div class="menu2"><a href="/pages/cats.php">Все разделы</a> ('.$dbs->query("SELECT * FROM `cat`")->num_rows.')</div>';
if($set['chat']==0){echo'<div class="menu2"><a href="/pages/chat.php">Мини-чат</a> ('.$dbs->query("SELECT * FROM `chat`")->num_rows.')</div>';}
echo'<div class="menu"><a href="/info/">Информация</a></div><div
class="online"><a href="/pages/online.php">Онлайн: '.$dbs->query("SELECT * FROM `blogger` where `onl` > '".(time()-$set['online'])."'")->num_rows.'</a></div>';
$reklama = $dbs->query("SELECT * FROM `blog` where `activ` = '1' ORDER BY rand() DESC LIMIT 3");
echo '<div class="rekl">';
echo 'Реклама:<br/>';
while($rekl = $reklama->fetch_assoc()){
echo '<img src="/design/014.png"
align="middle" alt="*"/><a href="/read'.$rekl['id'].'">'.$rekl['name'].'</a><br/>';
}
echo '</div>';
footer();
?>