CoolBoy, Это я прописал в aut.php
$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);
$count=mysql_result(mysql_query(\"SELECT COUNT(*) FROM `mail` WHERE `id_user` = \'$user[id]\' AND `type` = \'to\' AND `read` = \'0\'\"
,0);
if ($k_new!=0 && $k_new_fav==0)
echo \"<img src=\'/style/icons/mess0.png\' alt=\'$count\' /> <a href=\'/mail/\'><u>+ $count</u></a> \\n\";
if ($k_new_fav!=0)
echo \"<a href=\'/mail/\'><img src=\'/style/icons/mail.gif\' alt=\'$k_new_fav\' /></a> \\n\";