Файл: app/news/index.php
Строк: 10
<?php
$smarty->header('Новости');
$all = $db->query("SELECT `id` FROM `news` ")->rowCount();
$pages = new Pages($all, $config['pages']);
$query = $db->query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT " . $start . ", " . $config['pages']);
while ($list = $query->fetch())
{
$posts[] = [
'title' => Filter::text($list['title']),
'url' => '/news/article?id=' . $list['id'],
'post' => Filter::output($list['text']),
'time' => Core::time($list['time'])
];
}
if ($all == 0)
$posts[] = [
'title' => Lang::word('Нет новостей.')
];
$smarty->assign([
'post' => $posts
]);
$smarty->display('posts.tpl');
$pages->view('?');
$smarty->footer();