<?
/*
=============================================
 Движок:  SHCMS Engine
=============================================
 Official website: http://shcms.ru
=============================================
 Данный код защищен авторскими правами
=============================================
*/

/*
====================================
Вывод последних новостей
====================================
*/
function news_list()
{
global $timedate;
global $user4;
global $user_id;
$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)
{
echo '<div class="maintitle">'.$new_news['title'].'<span class="maintime">'.$timedate->times($new_news['time']).'</span></div>';
echo '<div class="maintext"><div class="posts">'.processing($new_news['text']).'</div>';
echo '<div class="posts"><a href="/uncos/comments.php?id='.$new_news['id'].'">Комментарии</a> ('.$mysql_count.')';
				    if($new_news['send'] == 0 && $user4['team'] == 6 && $user_id)
                    {
					    echo "| <a href='/uncos/news_send.php?id_send=".$new_news['id']."'>Разослать</a>";
					}
echo '</div></div>';
}}}



?>