<?php
define('_IN_JOHNCMS', 1);
$textl='';
require_once ('../incfiles/core.php');
require_once ('../incfiles/head.php');
$mavzu_va_kategorya = mysql_query ("SELECT * FROM `forum` WHERE `type` = 'f' ORDER BY `realid` ASC");
while ($forum = mysql_fetch_assoc($mavzu_va_kategorya)) { $hisob = mysql_result(mysql_query ("SELECT COUNT(*) FROM `forum` WHERE `type` = 'r' AND `refid` = '" . $foruam['id'] . "'"), a);
    echo ' <a href="../forum/index.php?id=' . $forum['id'] . '"><div class="phdr"><b> ' . $forum['text'] . ' </b>
<span class="badge bg-light pull-right text-">' .$hisob. '</span></div></a>';
$mavzu_text = mysql_query("SELECT * FROM `forum` WHERE `refid` = {$forum ['id']} ");
    while ($mavzu = mysql_fetch_assoc($mavzu_text)) {
    $counter = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' AND `refid` = '" . $mavzu['id'] . "'"), 0);
echo '<div class="menu">  <img src="http://zinurasia.ru/images/dir.png" alt="" /><b> <a
href="/forum/index.php?id=' .$mavzu['id']. '"> ' .$mavzu['text']. ' </b> ' .($counter ? '<span class="count"><b><font
color="black">[' .$counter. ']</font></b></span>' : ''). '</a> </div>';
    }
}
require_once ('../incfiles/end.php');
?>
