<?

echo "<div class='main_menu'>\n";
rekl(2);

$currD=date("d", time());
$currm=date("m", time());
$k_birsday=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm'",$db), 0);
           if ($k_birsday > 0)
           {
    echo'<img src=/style/icons/gifts.gif><a href="/list_bday.php">Дни рождения на сайте</a> ('.$k_birsday.')<br/>';
		   }


$fot=mysql_fetch_array(mysql_query("SELECT * FROM `foto_conf`"));
if ($fot['set_konkurs']==1)
{
echo '<div class=menu_razd>
<div align="center"><b><span style="color:red">К</span>
<span style="color:blue">о</span>
<span style="color:green">н</span>
<span style="color:yellow">ку</span>
<span style="color:green">р</span>
<span style="color:blue">с</span>
<span style="color:red">ы</span></b></div></div>';
echo '<a href="/foto_konkurs/">Фотоконкурс</a> (';
include 'foto_konkurs/count.php';
echo ')';
}




$q_menu=mysql_query("SELECT * FROM `menu` ORDER BY `pos` ASC");
while ($post_menu = mysql_fetch_assoc($q_menu))
{



if (!isset($post_menu['icon']))mysql_query('ALTER TABLE `menu` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
if (!isset($post_menu['type']))mysql_query("ALTER TABLE  `menu` ADD  `type` ENUM('link', 'razd') NOT NULL DEFAULT 'link' AFTER `id`");

if ($post_menu['type']=='link')echo icons($post_menu['icon'],'code');

if ($post_menu['type']=='link')echo "<a href='$post_menu[url]'>";
else echo "<div class='menu_razd'>";
echo $post_menu['name'];

if ($post_menu['counter']!=NULL && is_file(H.$post_menu['counter']))
{
echo ' (';
@include H.$post_menu['counter'];
echo ')';
}

if ($post_menu['type']=='link')echo "</a><br />\n";
else echo "</div>\n";



}
echo "</div>\n";
?>