Файл: news.php
Строк: 69
<?php
include_once('./inc/head.php');
include_once('./inc/prov.php');
title('Новости');
$new_msg = mysql_result(mysql_query("SELECT COUNT(*) FROM `ferm_privat` WHERE `komu` = '".$uinf['login']."' and `view` = '1'"), 0);
if($uinf['id'] == $profil['id'] or $uinf['adm'] == '1')
echo '<div class="title"><b>'.$uinf['login'].' <a href="./privat.php?privat=vhod"><img src="http://144.76.127.94/view/image/icons/post.png" height="15" width="15" align="top" alt="ic">'.$new_msg.'</a> | '.$uinf['hp'].'<img src="http://warbk.com/graph/ico/hp.png" width="16" height="16" > | <img src="http://warbk.com/img/lvl.png" width="16" height="16" > '.$uinf['lvl'].'</b> | <b>Золото: </b> '.$uinf['zoloto'].' <img src="./theme/gold.png" height="16" width="16" align="top" alt="ic"> | <b>Рубли: </b> '.$uinf['rub'].' <img src="http://144.76.127.94/view/image/icons/buy_gold.png" height="16" width="16" align="top" alt="ic"></div>';
$count_news = mysql_result(mysql_query("SELECT COUNT(*) FROM `ferm_news`"), 0); // подсчёт для навигации
$count_news = mysql_result(mysql_query("SELECT COUNT(*) FROM `ferm_news`"), 0);
if($count_news == '0') {
echo '<div class="content">Новостей нет</div>';
}
echo '<div class="content">';
$view_news = mysql_query("SELECT * FROM `ferm_news` ORDER BY `id` DESC LIMIT $start, $kmess");
while($view_n = mysql_fetch_assoc($view_news)) {
echo '<b>'.$view_n[tema].'</b><br/><font size="1"><font color="red">Администрация</font></font><br/><br>';
echo ''.$view_n[text].'<br/><br><br>';
echo 'Добавил:<font color="red"> '.$view_n[avtor].'</font><br/>';
}
echo '</div>';
if ($count_news > $kmess) {
echo '<div class="content"><center>';
echo '' . pagenav('?menu=news&', $start, $count_news, $kmess) . '';
echo '</center></div>';
}
include_once('./inc/foot.php');
?>