Размер файла: 910B
<?php
define('_WBLIB',1);
require_once ('inc/core.php');
// Заголовки
$title = 'Top-10 статей';
require_once ('inc/head.php');
#############################
echo '<div class="title">Top-10 статей</div>';
$count = 1;
$posts = mysql_result(mysql_query("SELECT COUNT(*) FROM `article` WHERE `type` ='2'"),0);
if ($posts > 0) {
$top = mysql_query("SELECT * FROM `article`WHERE `type` = '2' ORDER by `count` DESC LIMIT 0,10");
while ($m = mysql_fetch_array($top)) {
echo '<div class="link">';
echo $count.'.<a href="'.$home.'/article.php?id='.$m['id'].'">'.$m['name'].'</a><br/><small><b>Просмотров:'.$m['count'].'</b></small><br/>'.preview_desc($m['text'],100);
echo '</div>';
$count++;
}
} else {
echo '<div class="link">Статей нет</div>';
}
echo '<div class="bar"><a href="'.$home.'">Главная</a></div>';
require_once ('inc/foot.php');
?>