Infestro,
<?
$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);
if ($k_new!=0 && $k_new_fav==0){
echo "<a href='/new_mess.php'><span class='link_title'><img src='/style/themes/web2/images/mail.png' alt=''/> <b class='count'>+$k_new</b>
<br/> Почта </span></a>";
}else{
echo "<a href='/konts.php'><span class='link_title'><img src='/style/themes/web2/images/mail.png' alt=''/>
<br/>Почта</span></a>";
}
?>