<?php 
$new  = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news` WHERE `time` > '" . (time() - (86400 * 1)) . "'".($rights < 7 ? " AND `time`<='" . time() ."'":"").""), 0);
$umumiy = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news` ".($rights < 10 ? " WHERE `time`<='" . time() . "'":"").""), 0);
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news_cat`"), 0);
$req = mysql_query("SELECT `cms_news_cat`.`name`, `cms_news_cat`.`id` FROM `cms_news_cat` ORDER BY `cms_news_cat`.`realid` ASC LIMIT 20");
$i = 1;
echo '<div class="menu"><a href="/"><img src="/ico/home.png"></a> » Yangiliklar arxivi</div>';
echo '<div class="phdr"><center>Bo\'limlar</center></div>';
echo '<style>.catsTd a {color: #0D0F11;padding-left:22px; background:url(/ico/dir.png)no-repeat left center}</style>';
echo '<div class="menu"><table border="0" cellspacing="1" cellpadding="0" width="100%" class="catsTable">';
while (($row = mysql_fetch_assoc($req)) !== false) {
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news` WHERE ".($rights < 10 ? "`time`<='" . time() . "' AND ":"")."`refid`='{$row['id']}'"), 0);
echo '<tr><td style="width:100%" class="catsTd" valign="top" id="cid19"><a href="'.$home.'/news/index.php?id='.$row['id'].'">'.htmlentities($row['name'],ENT_QUOTES, 'UTF-8').'</a> <span class="catNumData" style="unicode-bidi:embed;">['.$count.']</span></td></tr>';
++$i;
}
echo '</table></div>';
 ?>