Файл: modules/all_news.php
Строк: 54
<?php
////////////////////////////////////////
///// Основа ApiCMS //////
///// Автор биллинга - IvanDanilov /////
///// Автор биллинга - IvanDanilov /////
///// ICQ 936545, mail: KyberID@ya.ru //
////////////////////////////////////////
/////////////////////////////////////////
$title = 'Новости за весь период';
require_once '../api_core/apicms_system.php';
require_once '../api_core/head.php';
/////////////////////////////////////////
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"),0);
$k_page=k_page($k_post,$api_settings['on_page']);
$page=page($k_page);
$start=$api_settings['on_page']*$page-$api_settings['on_page'];
if ($k_post==0)echo "<div class='content'><center>Новостей сайта не найдено</center></div>";
/////////////////////////////////////////
$query = mysql_query("SELECT * FROM `news` ORDER BY time DESC LIMIT $start, $api_settings[on_page]");
while ($newsone = mysql_fetch_assoc($query)){
$koms = mysql_result(mysql_query("SELECT COUNT(*) FROM `news_comm` WHERE `id_news` = '$newsone[id]'"),0);
if ($koms==0)$koms=NULL;
else $koms = ' +'.$koms.'';
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '$newsone[id_user]' LIMIT 1"));
echo '<div class="subhead"><strong>'.apicms_smiles(apicms_bb_code(apicms_br(htmlspecialchars($newsone['name'])))).'</strong> <span style="float:right"><small>'.apicms_data($newsone['time']).'</small></span> </br> '.apicms_smiles(apicms_bb_code(apicms_br(htmlspecialchars($newsone['txt'])))).'
<hr><a href="/modules/news_comm.php?id='.$newsone['id'].'"><small>Комментарии '.$koms.'</small></a> <span style="float:right"> <small>'.htmlspecialchars($ank['login']).'</small> <img src="/design/menu/rsnews.png"/></span></div>';
}
/////////////////////////////////////////
if ($k_page > 1){
echo '<div class="subhead"><center>';
str('?',$k_page,$page); // генерируем постраничную навигацию
echo '</center></div>';
}
apicms_foot();
?>