    inf_1 ( , -      default/main.html)
$module =        










$module = 'news';
$Register = Register::getInstance();
$Cache = $Register['Cache'];
$key = 'pop_news';
if ($this->Cache->check($key)) {
$popular_news = json_decode($this->Cache->read($key), true);
} else {
$popular_news = $FpsDB->select($module, DB_ALL, array('order' => 'views DESC', 'limit' => 1));
$this->Cache->write(json_encode($popular_news), $key, array(), array('lifetime' => 7200));
}


if (count($popular_news) > 0) {
foreach ($popular_news as $news) {

$image = $FpsDB->select($module.'_attaches', DB_ALL, array('cond' => array('entity_id' => $news['id'])));
if (count($image) > 0) {
    $img = '<img src="'.get_url('/data/files/'.$module.'/'.$image[0]['filename']).'" />';
} else {
    $img = '<img src="'.get_url(getTemplateName().'/image/noimage.png').'" />';
}

$author = $FpsDB->select('users', DB_ALL, array('cond' => array('id' => $news['author_id'])));

$link = '<a href="'.get_url('/users/info/'.$news[author_id]).'">'. $author[0]['name'] .'</a>';
$url_full = get_url(WWW_ROOT . $module .'/view/'. $news['id']);
$Register = Register::getInstance();
$announce = $Register['PrintText']->getAnnounce($news['main'], $url_full, 0, 200);
$title = $Register['PrintText']->getAnnounce($news['title'], $url_full, 0, 10);
echo '<div class="post-b"> <div class="post-i"><div>'. $img .'<a href="#"><span></span></a></div></div> <div class="post-d"> <div class="post-t"><a href="'. $url_full .'">'. $title .'</a></div> <div class="post-f">'. $announce .'</div> </div> <div class="post-m"> <div class="post-mr"><a href="'. $url_full .'"> ></a></div> <div class="post-l"> <span class="m-date" title="">'. $news['date'] .'</span> <span class="m-name" title="">'. $link  .'</span> <span class="m-read" title="">'. $news['views'] .'</span> <span class="m-comm" title=""><a href="'. $url_full .'">'. $news['comments'] .'</a></span> <div class="clr"></div> </div> </div> <div class="clr"></div> </div>';
}
}
?>

<hr class="ph-hr">
<?

$Cache_new = $Register['Cache'];
$new_key = 'new_news';
if ($this->Cache->check($new_key)) {
$new_news = json_decode($this->Cache->read($new_key), true);
} else {
$new_news = $FpsDB->select($module, DB_ALL, array('order' => 'date DESC', 'limit' => 6));
$this->Cache->write(json_encode($new_news), $new_key, array(), array('lifetime' => 10));
}
if (count($new_news) > 0) {
foreach ($new_news as $Nnews) {
$images = $FpsDB->select($module.'_attaches', DB_ALL, array('cond' => array('entity_id' => $Nnews['id'])));
if (count($images) > 0) {
$imgm = '<img src="'.get_url('/data/files/'.$module.'/'.$images[0]['filename']).'" />';
} else {
$imgm = '<img src="'.get_url(getTemplateName().'/image/noimage.png').'" />';
}
$link_full = get_url(WWW_ROOT . $module .'/view/'. $Nnews['id']);
$news_title = $Nnews['title'];
if (strlen($news_title) > 15) {
$news_title = mb_substr($news_title, 0, 15);
$news_title .= '...';
}

echo '<div class="post-b post-sml post-news"> <div class="post-i"><div>'. $imgm .'<a href="'. $link_full .'"><span></span></a></div></div> <div class="post-d"> <div class="post-t"><a href="'. $link_full .'" title="'. $Nnews['title'] .'">'. $news_title .'</a></div> <span class="post_fps" title="">'. $Nnews['views'] .'</span> 
 </div> <div class="clr"></div> </div>';
}
}