Файл: soc-set/moduls/news/index.php
Строк: 26
<?php
require_once('../../core/start.php');
check_auth();
head('Новости сайта');
panel();
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".NEWS."");
echo (privilegy('news') ? DIV_LI . '<a href="'.HOME.'/panel/news/"><b>Управление новостями</b></a>' . CLOSE_DIV : NULL);
if (empty($all)) {
echo DIV_BLOCK . 'Новостей нет' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['news'],'');
$sql = DB::$dbs->query("SELECT * FROM ".NEWS." ORDER BY `id` DESC LIMIT {$n->start()}, ".$config['write']['news']."");
while($new = $sql -> fetch()) {
$comm = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".NEWS_COMM." WHERE `new_id` = ?", array($new['id']));
echo DIV_LI . '<a href="'.HOME.'/news/'.$new['id'].'/" title="Подробнее...">'.$new['title'].'</a> ['.vrem($new['time']).' / '.$comm.' комм.]' . CLOSE_DIV;
}
echo $n->navi();
}
$array = array();
nav($array);
require_once('../../core/stop.php');
?>