<?php
require_once 'inc/core.php'; //ядро
$title = 'Категории';
require_once $inc.'head.php'; //шапка
$katQuery = mysql_query("SELECT `id`,`name`,`opis` FROM `kat` ORDER BY `realid` ASC;");
echo '<div class="nav"><a href="'.$path.'">Главная</a> | Категории</div>';
$i = 0;
$old = $realtime - (24*3600);
while ($katData = mysql_fetch_array($katQuery))
{
$kol = mysql_num_rows(mysql_query("SELECT `id` FROM `site` WHERE `refid` = '$katData[id]' AND `hosts` > '0' AND `ban` = '0';"));
$kolNew = mysql_num_rows(mysql_query("SELECT `id` FROM `site` WHERE `refid` = '$katData[id]' AND `hosts` > '0' AND `ban` = '0' AND `date` > '$old';"));
$div = ceil(ceil($i / 2) - ($i / 2)) == 0 ? 'list' : 'list1';
echo '<div class="'.$div.'"><a href="'.$path.'?id='.$katData['id'].'">'.$katData['name'].'</a></b> ('.$kol.''.($kolNew != 0 ? ' <b>+'.$kolNew.'</b>' : '').')
<br/>'.(!empty($katData['opis']) ? $katData['opis'] : '').'</div>';
++$i;
}
require_once $inc.'foot.php'; //ножки
?>