Размер файла: 3.34Kb
<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: Новости
=============================================
Official website: http://shcms.ru
=============================================
*/
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
$shcmsengine['title'] = 'Новости';
include_once'../template/head.php';
$allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM uncos"),0);
$newlist = new Navigation($allfield, 10, true);
$news1 = mysql_query("SELECT * FROM `uncos` ORDER BY `id` DESC ". $newlist->limit());
$news = mysql_fetch_array($news1);
echo '<div class="maintext"><img src="../template/icon/new_doc.png"> <a href="categories.php"><strong>Все категории</strong></a>
<img src="../template/icon/news.png"> <a href="topnews.php"><strong>Популярные новости</strong></a></div>';
if($news == null)
{
echo '<div class="posts"><img class="img_s" src="/template/icon/empty.png">Новостей сейчас нет</div>';
}
else
{
do
{
if($news['all_news'] != 1) {
$uncos_result = mysql_result(mysql_query("SELECT COUNT(*) FROM `uncos_comment` WHERE `id_uncos`='$news[id]'"),0);
echo "<div class='maintitle'><img src='/template/icon/news.png'/> <a href='categories.php?act=more&id=".$news['id']."'><b>".$news['title']." </b></a>";
echo "<div class='maintime'>".$timedate->times($news['time'])."</div></div>";
echo "<div class='maintext'>".processing($news['text'])."<div style='text-align:right'>";
users_list($news['user_id']);
echo "</div></div> <div class='maintext'><a href='comments.php?id=".$news['id']."'>Оставить комментарий (".$uncos_result.")</a>";
if($user4['team'] == 6)
{
echo "<span class='mainforum'>";
if($news['send'] == 0 && $users_user['team'] == 6 && $user_id) {
echo "<a title='Разослать новость на E-mail' href='news_send.php?id_send=".$news['id']."'><img src='/template/icon/mail.png'></a> ";
}
echo "<a title='Редактировать новость' href='edit_news.php?id=".$news['id']."'><img src='/template/icon/edit.png'></a>
<a title='Удалить новость' href='delete_news.php?id=".$news['id']."'><img src='/template/icon/delete.png'></a>
</span>";
}
echo '</div>';
}
}
while($news = mysql_fetch_array($news1));
echo '<div class="pages">';
echo $newlist->pagination();
echo '</div>';
}
echo '<div class="maintitle mainrazd">Навигация</div>';
echo'<div class="maintext"><div class="posts"><a href="search.php">Поиск новостей</a></div>';
if($user4['team'] == 6 and $user_id){
echo'<div class="posts"><a href="add_news.php"><strong>Добавить новость</strong></a></div>';
echo'<div class="posts"><a href="list_delete.php">Удалить все новости</a></div>';
}
echo '</div>';
include_once'../template/foot.php';
?>