Файл: sys/includes/news_main.php
Строк: 44
<?
$newss=mysql_query("SELECT * FROM `news` ORDER BY `time` DESC LIMIT 1");
while ($news=mysql_fetch_assoc($newss))
{
$likes=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_likes` WHERE `id_news` = '".$news['id']."'"),0);
$komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '".$news['id']."'"),0);
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
echo "<td class='icon14'><center>";
echo "<img src='/s-klub/img/big/megaphone.png'>";
echo "</center></td>";
echo "<td class='p_t'>";
echo "<span style='float : right;'>";
echo "<img src='/s-klub/img/time.png'> ".vremja($news['time'])."<br />";
echo "</span>";
echo "<a href='news.php?id=".$news['id']."'><b>".output_text($news['title'])."</b></a><br />";
echo "</td>";
echo "</tr><tr>";
echo "<td class='p_m' colspan='2'>";
echo "<img src='/s-klub/img/post.png'> <b>Суть новости:</b><br >";
echo "<div class='forum_post'>";
echo "".output_text($news['msg'])."<br />";
echo "</div>";
echo "<span style='float : right;'>";
if (isset($user))
{
$n_l=mysql_fetch_assoc(mysql_query("SELECT * FROM `news_likes` WHERE `id_news` = '".$news['id']."' AND `id_user` = '".$user['id']."'"));
if (!$n_l)
{
echo "<a href='/news/like.php?id=".$news['id']."'>";
echo "<img src='/s-klub/img/up.png'> <b>Класс</b>";
echo "</a> | ";
}
}
echo "<a href='/news/like_all.php?id=".$news['id']."'><img src='/s-klub/img/up.png'> <b>".$likes." чел.</b></a> | ";
echo "<a href='/news/komm.php?id=".$news['id']."'><img src='/s-klub/img/post.png'> <b>Комментарии (".$komm.")</b></a>";
echo "</span>";
echo "</td>";
echo "</tr></table>";
}
?>