Файл: news/inc/news-act.tpl
Строк: 46
<?
$news_s = mysql_fetch_assoc(mysql_query("SELECT * FROM `news-s`
WHERE `id` = '1'"));
if($news_s['news-act']==0){
$total =
mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"), 0);
if
($total!=0){
$news_c = mysql_query("SELECT * FROM `news` ORDER BY
`date` DESC LIMIT 1");
while ($news =
mysql_fetch_assoc($news_c)){
$news_o =
mysql_result(mysql_query("SELECT COUNT(*) FROM `news-o` WHERE
`id-apache` = '".int($apache['id'])."' ORDER BY `id-news` =
'".int($news['id'])."'"), 0);
if($news_o==0){
echo '<div
class="main-text">Последняя
новость</div>';
echo '<div
class="main-href">';
echo '<table width="100%"
cellspacing="0" cellpadding="0">';
echo
'<tr><td class="apa-l">';
icons('news');
echo
'<name>'.$news['name'].'</name>';
echo '</td>';
echo
'<td class="apa-r">';
echo
'<time>'.vtime($news['date']).'</time>';
echo
'</td></tr>';
echo '</table>';
echo
''.mb_substr(out($news['message']), 0, 200, 'UTF-8').'...</br>';
echo
'</div>';
if (isset($apache)){
echo '<table
width="100%" cellspacing="0"
cellpadding="0">';
echo '<tr><td
class="apa-l" width="50%">';
echo '<a
class="main-href"
href="/news/news-'.int($news['id']).'.dll"
title="Читать '.$news['name'].'">';
icons('read');
echo
'Читать</a>';
echo '</td>';
echo '<td
class="apa-l"width="50%">';
echo '<a
class="main-href"
href="/news/out-'.int($news['id']).'.dll"
title="Скрыть '.$news['name'].'">';
icons('out');
echo
'Скрыть</a>';
echo '</td></tr>';
echo
'</table>';
}
}
}}
}
?>