Файл: top.php
Строк: 22
<?php
require_once('core/start.php');
$title = 'ТОP 10 статей';
require_once(root.'core/header.php');
echo ' <div class="ot4">'.$title.'</div>';
$count = core::$dbs->querySingle("SELECT count(id) FROM `blog`");
$n = new pager($count,$index_end,'?');
$array = core::$dbs->query("SELECT * FROM `blog` ORDER BY `chit` DESC LIMIT 10");
if($array->rowCount()==0) err('Записей нет!');
while($arr = $array -> fetch()){
$message = (mb_strlen($arr['text'])>120 ? mb_substr($arr['text'],0,120, 'UTF-8') . '...': out($arr['text']) . '');
echo '<div class="vib"><b>'.stripslashes($arr['name']).'</b> ['.times($arr['time']).']</div>
<div class="block">
<p>' . $message .'</p><p><br/> '.(strlen($arr['text'])>120 ? '<a class="lenk" href="/blog/'.$arr['latname'].'.html">Далее →</a> |':NULL).' <a class="lenk" href="/comment/'.$arr['id'].'">Мнения ('.core::$dbs->querySingle("SELECT COUNT(id) from `comments` where `blog` = ?",array($arr['id'])).')</a></p></div>';
}
require_once(root.'core/footer.php');
?>