<?php
$q_men=mysql_query("SELECT * FROM `game` ORDER BY `pos` ASC");
while ($post_men = mysql_fetch_assoc($q_men))
{
if ($post_men['type']=='link')echo "<div class='main'>";
if (!isset($post_men['icon']))mysql_query('ALTER TABLE `game` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
if (!isset($post_men['type']))mysql_query("ALTER TABLE `game` ADD `type` ENUM('link', 'razd') NOT NULL DEFAULT 'link' AFTER `id`");
if ($post_men['type']=='link')echo "<img src='/style/icons/$post_men[icon]' alt='*'> ";
if ($post_men['type']=='link')echo "<a href='$post_men[url]'>";
else echo "<div class='menu_razd'>";
echo $post_men['name'];
if ($post_men['counter']!=NULL && is_file(H.$post_men['counter']))
{
echo ' (';
@include H.$post_men['counter'];
echo ')';
}
if ($post_men['type']=='link')echo "</a><br />n";
else echo "</div>n";
if ($post_men['type']=='link')echo "</div>";
}
?>