<?



function title()

{

global $user;

if (isset($user))

{

global $set;if (isset($_SESSION['message'])){echo "<div class='msg'>$_SESSION[message]</div>";$_SESSION['message']=NULL;}

if ($set['web']==false)

{

$k_new=mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail`

 LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]'

 WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"),0);

$k_new_fav=mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail`

 LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]'

 WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"),0);



echo "<table style='width:100%' cellspacing='0' cellpadding='0'><tr>";



 

echo "<td class='auts'>";

echo "<a href=\"/info.php?id=$user[id]\"><center><img src='/style/icons/nav_stranica.gif' alt='S'/></center></a>";

echo "</td>";





 echo "<td class='auts'>";

 if ($k_new!=0 && $k_new_fav==0){

 

echo "<a href='/new_mess.php'><center><img src='/style/icons/icon_pochta22.gif' alt='$k_new' />";

echo "<font color=\"#ff0000\">+$k_new</font></center></a>";



}else{

echo "<a href='/konts.php'><center><img src='/style/icons/nav_pochta.gif' alt='S'/></center></a>";

}

echo "</td>";





echo "<td class='auts'>";

$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `tape` WHERE `id_user` = '$user[id]' AND `read` = '0' "),0);



echo "<a href='/user/tape/index.php'><center><img src='/style/icons/nav_lenta.gif' alt='S'/>";

$k_l = $lenta;

if($k_l>0)echo "<font color=\"#ff0000\">($k_l)</font>";

echo "</center></a>";

echo "</td>";





$k_f = mysql_result(mysql_query("SELECT COUNT(id) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0);

if ($k_f>0)

{

echo "<td class='auts'>";

echo "<a href='/user/frends/new.php'><center><img src='/style/icons/icon_druzya.gif' alt='S'/><font color='red'>+$k_f</font></center></a>";

echo "</td>";

}







echo "<td class='auts'>";

echo '<a href="'.$_SERVER['REQUEST_URI'].'"><center><img src="/style/icons/nav_obnovit.gif" alt="S"></center></a>';

echo "</td>";



echo "</tr></table>";

 

 

echo "</div>\n";

}

}

}







?>