Файл: app/index.php
Строк: 51
<?php
$smarty->header($config['title']);
$news = $db->query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1");
while ($list = $news->fetch())
{
$listing[] = [
'title' => $list['title'],
'url' => '/news/article?id=' . $list['id'],
'icon' => 'newspaper',
'div' => 'razdel',
'count' => $db->query("SELECT `id` FROM `news_comments` WHERE `id_news` = '" . $list['id'] . "'")->rowCount()
];
$listing[] = [
'title' => Filter::output($list['text']),
'div' => 'menu'
];
}
$listing[] = [
'title' => Lang::word('Новости'),
'url' => '/news/',
'icon' => 'newspaper',
'div' => 'menu',
'count' => $db->query("SELECT `id` FROM `news`")->rowCount()
];
$listing[] = [
'title' => Lang::word('Мини-чат'),
'url' => '/minichat',
'icon' => 'bubble',
'div' => 'menu',
'count' => $db->query("SELECT `id` FROM `minichat` ")->rowCount()
];
$listing[] = [
'title' => Lang::word('Пользователи'),
'url' => '/pages/users',
'icon' => 'users',
'div' => 'menu',
'count' => $db->query("SELECT `id` FROM `users`")->rowCount()
];
$listing[] = [
'title' => Lang::word('Сейчас на сайте'),
'url' => '/pages/users/online',
'icon' => 'users',
'div' => 'menu',
'count' => $db->query("SELECT `id` FROM `users` WHERE `time_last` > '" . (time() - 600) ."'")->rowCount()
];
$smarty->assign([
'listing' => $listing
]);
$smarty->display('listing.tpl');
$smarty->footer();