Файл: news/index.php
Строк: 29
<?php
define('R', $_SERVER['DOCUMENT_ROOT']);
define('S', R.'/system');
require_once(R.'/system/kernel.php');
$tmp->header('news');
User::panel();
$count=$db->fass("SELECT COUNT(id) as count FROM `news`");
$posts=$count['count'];
if($posts==0){
$tmp->div('block', Language::config('error'));
}
$total = (($posts-1)/$num)+1;
$total = intval($total);
$page = intval($page);
if(empty($page) or $page<0) $page=1;
if($page>$total) $page=$total;
$start=$page*$num-$num;
$news= $db->query("SELECT * FROM `news` ORDER BY id DESC LIMIT ".$start.", ".$num." ");
while($n=$news->fetch_assoc())
{
$tmp->div('menu', bb(smile($n['name'])).' '.times($n['time']).' </br>'.bb(smile($n['message'])));
}
page('?');
$tmp->footer();
?>