Файл: index.php
Строк: 56
<?php
/*
- Автор скрипт: Ak47res1
- ICQ: 646099815
- Живой пример http://s.wmliga.in
*/
$title = 'Страница блога';
include_once 'sys/db.php';
include_once 'sys/fnc.php';
include_once H.'sys/head.php';
$user_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `user`"),0);
$guest_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest`"),0);
$blog_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_article`"),0);
$user_on = mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `time_last` > ". (time()-600) .""), 0);
echo $div->div_menu.' <img src="'.$HOME.'/style/img/link.png"> Онлайн: '. $user_on .' </div>';
// Вывод статей
$subsection = mysql_query("SELECT `id`,`time`,`name`,`text`,`id_dir` FROM `blog_article` ORDER BY `id` DESC LIMIT 3");
while ($blog = mysql_fetch_object($subsection)) {
$text = mb_substr($blog->text, 0, 140, 'utf-8');
$f_name = mysql_fetch_object(mysql_query("SELECT `id_dir` FROM `blog_article` WHERE `id_dir` = '$blog->id_dir' LIMIT 1"));
$dir_name = mysql_fetch_object(mysql_query("SELECT `name` FROM `blog_category` WHERE `id` = '$f_name->id_dir' LIMIT 1"));
echo '<div class="menu"><a href="'.$HOME.'/blog'. $blog->id .'">'. output($blog->name).'</a><br> '. output($text) .'
<br />Раздел: <a href="'.$HOME.'/scripts/blog/?dir='.$blog->id_dir.'">'.$dir_name->name.'</a></div>';
}
// Вывод ссылки управление
echo $div->div_razd.' Управление</div>';
echo $div->div_menu.' <img src="'.$HOME.'/style/img/guestbook.png"> <a href="scripts/guest/">Гостевая книга</a> <span class="count">'.$guest_count.'</span></div>';
echo $div->div_menu.' <img src="'.$HOME.'/style/img/All_blogs.png"> <a href="scripts/blog/">Все блоги</a> <span class="count">'.$blog_count.'</span></div>';
echo $div->div_menu.' <img src="'.$HOME.'/style/img/bloggers.png"> <a href="scripts/user/">Блогеры</a> <span class="count">'.$user_count.'</span></div>';
// Показует для пользователей
if (isset($user)){
echo $div->div_menu.' <img src="'.$HOME.'/style/img/cabinet.png"> <a href="scripts/user/cabinet">Кабинет</a></div>';
echo $div->div_menu.' <img src="'.$HOME.'/style/img/link.png"> Логин: '.$user->login.' </div>';
}
include_once H.'sys/foot.php';
?>