Swank, <?php
defined('_IN_JOHNCMS') or die('Error: restricted access');
$mp = new mainpage();
echo '<div class="phdr"><b>Лента | Ахбор.Ru</b></div>';
$count = mysql_result(mysql_query("select count(*) from `cms_news` where `time`<='" . time() . "' and `refid` = 1"), 0);
$trans_req = mysql_query("select * from `cms_news` where `time`<='" . time() . "' and `refid` = 1 order by `time` desc limit $start, $kmess;");
while ($trans_res = mysql_fetch_array($trans_req)) {
$comm = mysql_result(mysql_query("select count(*) from `cms_news_comments` where `refid` = '".$trans_res['id']."'"), 0);
echo '<div class="list1"><span class="time">' . date('H:i', $trans_res['time'] + $sdvigclock * 3600) . '</span> <a href="news/index.php?act=view&id=' . $trans_res['id'] . '">' . htmlentities($trans_res['name'], ENT_QUOTES, 'UTF-8') . '</a><span class="red"> ['.$comm.']</span></div>';
}
if ($count > $kmess)
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news_cat`"), 0);
/*
if($total) {
if ($total > $kmess)
echo '<div class="topmenu">' . functions::display_pagination('index.php?', $start, $total, $kmess) . '</div>';
$req = mysql_query("SELECT `cms_news_cat`.`name`, `cms_news_cat`.`id`
FROM `cms_news_cat`
ORDER BY `cms_news_cat`.`realid` ASC LIMIT " . $start . "," . $kmess);
*/
echo '<div class="topmenu">' . functions::display_pagination('index.php?', $start, $count, $kmess) . '</div>';