Просмотр файла sdark.mobi/news/index.php

Размер файла: 1.54Kb
<?
include_once '../core/system.php';
echo only_reg();
echo ban();
$header = 'Новости';
mysql_query("UPDATE `user` set `mesto` = 'Новости' where `id` = '".$user['id']."'");
//if($user['prava']<5){header('location: /'); $_SESSION['err'] = 'Ведутся технические работы';}

include_once '../core/head.php';
$k_post = mysql_result(mysql_query("SELECT COUNT(*)  FROM `news`"),0);
$k_page = k_page($k_post,8);
$page = page($k_page);
$start = 8*$page-8;
$q = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT ".$start.", 8");
if($k_post == 0)echo "<div class='foot grey'>Нет новостей</div>";
echo "<div class='but-list'>";
while($post = mysql_fetch_array($q)) {
$timep = date('j M Y', $post['time']);
$timep = str_replace("Jan", "янв", $timep);
$timep = str_replace("Feb", "фев", $timep);
$timep = str_replace("Mar", "мар", $timep);
$timep = str_replace("May", "мая", $timep);
$timep = str_replace("Apr", "апр", $timep);
$timep = str_replace("Jun", "июн", $timep);
$timep = str_replace("Jul", "июл", $timep);
$timep = str_replace("Aug", "авг", $timep);
$timep = str_replace("Sep", "сен", $timep);
$timep = str_replace("Oct", "окт", $timep);
$timep = str_replace("Nov", "ноя", $timep);
$timep = str_replace("Dec", "дек", $timep);
echo "<a href='/news/post/".$post['id']."/'><img src='/images/icon/section.png'> ".$post['title']." <span class='float-right grey'>".$timep."</span></a>";
}
echo "</div>";
if ($k_page>1)echo'<hr>';
str('?',$k_page,$page); 
include_once '../core/foot.php';
?>