Размер файла: 1.02Kb
<?php
$title='Новости';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php"; echo'<div class="i">Новости<br></div>';$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"),0);
$page = abs((int)$_GET['page']);
if($page < 0 || $page > $total) $page = 0;
if ($total < $page + 10) $end = $total;
else $end = $page + 10;
$snews=mysql_query("select * from news order by id_news desc limit $page,10");
if($total==0){
echo'<div class="p">
Пока нет новостей...<br>
</div>';
}else{
while($news=mysql_fetch_array($snews)){
$koments=mysql_num_rows(mysql_query("select * from koments where type='news' and id_kogo='".$news['id_news']."'"));
echo'<div class="p">['.$news['dater'].']<br>
'.vizual($news['ntext']).'<br>
<a href="koments.php?id_wm='.$news['id_news'].'&type=news">Комментарии</a> ['.$koments.']<br>
</div>';
}
strpage($page, 10, $total, 'news.php');
}
require"../system/foot.php";
?>