<?
include '../config.php';
include '../func.php';
head();
ban();

/////////////////////////////

if ( $id_session )



$razdel = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id` = '".num($_GET['id'])."'"));
mysql_query("UPDATE `profile` SET `online` = 'forum".$razdel['id']."' WHERE `id` = '".$id_session."'");
echo head . "<b>".$razdel['name']."</b>" . div;  
echo link1 . "<a href=\"index.php\">Назад</a>" . div;

if(isset($razdel['id'])){


$all = mysql_result(mysql_query("SELECT count(*) FROM `forum_podrazdel` WHERE `razdel_id` = '".num($_GET['id'])."'"), 0);

if($all == 0)
{
    echo katalog . "Подразделы не созданы" . div;

} else {

//echo katalog;
$result = mysql_query("SELECT * FROM forum_podrazdel WHERE `razdel_id` = '".num($_GET['id'])."'");
while($podforum = mysql_fetch_assoc($result)){

$all_theme = mysql_result(mysql_query("SELECT count(*) FROM `forum_themes` WHERE `pod_forum` = '".num($podforum['id'])."'"), 0);


echo "<div class='link2'><a href=\"themes.php?razdel=".num($_GET['id'])."&pod_forum=".num($podforum['id'])."\">".$podforum['name']."</a> [".$all_theme."]</div>";

}

echo div;
}


} else {
	
    header('Location: index.php?');
    
}




pod_navig();
foot();
?>