File size: 1.43Kb
<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Official website: http://shcms.ru
=============================================
Данный код защищен авторскими правами
=============================================
*/
/*
====================================
Вывод последних новостей
====================================
*/
function news_list()
{
global $timedate;
$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">'.$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>';
}}}
?>