File size: 1.51Kb
<?
$query = mysql_query("SELECT * FROM `news` WHERE `index` = '1' ORDER BY `time` DESC LIMIT 1");
while ($act = mysql_fetch_assoc($query))
{
$check = mysql_result(mysql_query("SELECT COUNT(*) FROM `news_read` WHERE `news` = '".$act['id']."' AND `user` = '".$user['id']."'"),0);
if(empty($check)){
$list = mysql_fetch_assoc(mysql_query("SELECT name FROM `news_list` WHERE `id` = '".$act['list']."' LIMIT 1"));
$name = htmlspecialchars ($list['name']);
echo'
<link rel="stylesheet" href="/news/style.css" type="text/css">
<div class="wrapper-nobg">
<div class="wrapper" style ="margin: -1px 5px;">
<div class="block attaches_limiter">
<div class="oh">
<span class="right"> <span class="grey">' . vremja($act['time']) . '</span> </span>
<img class="p14" src="/news/ico/news.png" alt="(ON)">
<a class="break-word arrow_link strong_link" href="/news/news/?id='.$act['id'].'"> '.text($act['title']) .' </a>
'.($act['file'] > null ?'</br><img src="/news/photo/img/'.$act['file'].'" style =" max-width: 100% !important;max-height: 200px;"class="preview s0_360">':'').'
</br>'.output_text($act['msg']).'
<div class="oh grey pad_t_a"> '.$name.'
<span class="right">
<img src="/news/ico/eye.png " alt="" class="m">
<span class="m">'.$act['view'].'</span>
</span>
'.(isset($user) ? '</br><a href="/news/read/?id='.$act['id'].'">Скрыть</a> <img src="/news/ico/arr_r_darkblue.png" class="m arr" width="8" height="12">':'').'
</div>
</div></div></div></div>
';
}
}
?>