Файл: news/index.php
Строк: 20
<?
include_once $_SERVER['DOCUMENT_ROOT'].'/core/system.php';
$title='Новости';
include_once $_SERVER['DOCUMENT_ROOT'].'/design/heads.php';
title($title).nav();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"),0);
$k_page=k_page($k_post,$count_page);
$page=page($k_page);
$start=$count_page*$page-$count_page;
if ($k_post==0)
{
echo '<div class="err">';
echo "Нет Новостейn";
echo '</div>';
}
$q=mysql_query("SELECT * FROM `news` ORDER BY id DESC LIMIT $start, $count_page");
while ($post = mysql_fetch_assoc($q))
{
echo '
<div class="lines">
'.$post['title'].'
</div>
<div class="block">
<div class="row">
'.cut_text($post['text'],650,200).' '.times($file['time']).' <a href="/news/news.php?id='.$post['id'].'">>>></a> </br>'.times($post['time']).'
</div></div>
';
}
if ($k_page>1)str('?',$k_page,$page); // Вывод страниц
include_once $_SERVER['DOCUMENT_ROOT'].'/design/footer.php';
?>