Файл: newss/sys/inc/news_main.php
Строк: 52
<?
$q=mysql_query("SELECT * FROM `news` WHERE `main_time` > '".time()."' ORDER BY `id` DESC LIMIT 1");
if (mysql_num_rows($q)==1 && !$set['web'] && $user['news_read']==0)
{
$news = mysql_fetch_assoc($q);
echo "<div class='mess'>n";
echo "<img src='/style/icons/new.gif' alt='*' /> <a href='/news/news.php?id=$news[id]'>$news[title]</a>n";
echo "(".vremja($news['time']).")<br /><br />n";
echo rez_text($news['msg']).'<br />';
if (file_exists(H.'news/img/'.$news['img1'].'.jpg') || file_exists(H.'news/img/'.$news['img2'].'.jpg') || file_exists(H.'news/img/'.$news['img3'].'.jpg') || file_exists(H.'news/img/'.$news['img4'].'.jpg')) echo '<br />';
for ($i=1; $i<=4; $i++) {
if (file_exists(H.'news/img/'.$news['img'.$i.''].'.jpg'))
echo '<a style = "display: inline-block; margin: 1px; border: 1px solid silver;" href="/news/img/'.$news['img'.$i.''].'.jpg"><img src = "/news/img/'.$news['img'.$i.''].'.jpg" width = "50" height = "50"></a>';
}
if (file_exists(H.'news/img/'.$news['img1'].'.jpg') || file_exists(H.'news/img/'.$news['img2'].'.jpg') || file_exists(H.'news/img/'.$news['img3'].'.jpg') || file_exists(H.'news/img/'.$news['img4'].'.jpg')) echo '<br />';
echo "<br /><img src='/style/icons/komm.png' alt='*' />Обсуждений — ".mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '$news[id]'"),0)."<br />n";
if (isset($user))echo "<div style='text-align:right;'><a href='?news_read'><img src='/style/icons/delete.gif' alt='*'></a></div>";echo "</div>n";
}
?>