Размер файла: 1.35Kb
<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Official website: http://shcms.ru
=============================================
Данный код защищен авторскими правами
=============================================
*/
/*
====================================
Вывод последних новостей
====================================
*/
function news_list()
{
$new_news1 = mysql_query("SELECT * FROM `uncos` ORDER BY `id` DESC LIMIT 1");
$new_news = mysql_fetch_array($new_news1);
$system_un= mysql_result(mysql_query("SELECT COUNT(*) FROM `uncos` WHERE `time` > '".(time()-86400)."'"), 0);
$users_uncos = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$new_news[user_id]'"));
if($system_un)
{
$mysql_count = mysql_result(mysql_query("SELECT COUNT(*) FROM uncos_comment WHERE id_uncos=".$new_news['id'].""),0);
if($new_news == null)
{}
else
{
echo '<div class="upper">'.$new_news['title'].'</div>';
echo '<div class="posts">'.$new_news['text'].'<span style="float:right;">
<a href="'.DIR_SHCMS.'change_view.php?id='.$users_uncos ['id'].'">'.$users_uncos ['login'].'</a></span>
<hr/> <a href="/uncos/comments.php?id='.$new_news['id'].'">Комментарии</a> ('.$mysql_count.')</div>';
}}}
?>