<?
//Автор: Алексей & TeaM ICQ 95-95-466
//Скрипт: VKRUGUKENTOV.ru
//Копирование,продажа,перепродажа без согласия автора строго запрещена и будет караться плачевными последствиями
//Соблюдайте авторские права

function title($title=NULL)
{
global $set;
global $user;
if ($set['web']==false)
{
if ($title==NULL)$title=$set['title'];
echo "<div class='title'>$title</div>\n";
if (isset($user))
{

echo "<div class='linegreen'>\n";
$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 "<img src='/style/icons/mess0.png' alt='$k_new' /> <a href='/new_mess.php'><b><u>Сообщения + $k_new</u></b></a><br/> \n";


if ($k_new_fav!=0)
echo "<a href='/new_mess.php'><img src='/style/icons/mail.gif' alt='$k_new_fav' /></a> \n";

$knj=mysql_result(mysql_query("SELECT COUNT(*) FROM `present_jurnal` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0);
if ($knj>0)
echo "<a href=\"/present/jurnal.php\" title=\"Gifts\"><img src='/style/img/pod16.gif' alt='' class='icon'/> <u>+ $knj</u></a> \n";

$nj=mysql_result(mysql_query("SELECT COUNT(*) FROM `ocenka` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
if ($nj>0)echo "<a href=\"/ocenka.php\" title=\"Jurnal\"><img src='/style/icons/5.png' alt='' /> <u>+ $nj</u></a> \n";


$zoz = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]'"), 0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0) > 0)
{
echo "<a href='/frend_new.php'><img src='/style/img/frend.png' alt='' /> <u>+ $zoz</u></a> ";
}

$zoz = mysql_result(mysql_query("SELECT COUNT(*) FROM `love_new` WHERE `to` = '$user[id]'"), 0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `love_new` WHERE `to` = '$user[id]' LIMIT 1"), 0) > 0)
{
echo "<a href='/love_new.php'><img src='/style/img/frend.png' alt='' /> dd<u>+ $zoz</u></a> ";
}

$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta` WHERE `id_kont` = '$user[id]' AND `read` = '0' "),0);
if($lenta>0) echo "<a href='/lenta.php'> <img src='/style/img/lenta.gif' alt='' class='icon'/> <u>+ $lenta</u></a> ";

$new_g=mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$user[id]' AND `read`='1'"),0);
if($new_g!=0)echo "<a href='/myguests.php'><img src='/style/img/eye.png' alt='' /> <u>+ $new_g</u></a> \n";

$nj=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
if ($nj>0)echo "<a href=\"/jurnal.php\" title=\"Jurnal\"><img src='/style/img/002.png' alt='' /> <u>+ $nj</u></a> \n";


$k_n_s_zak=mysql_result(mysql_query("SELECT COUNT(`forum_zakl`.`id_them`) FROM `forum_zakl` LEFT JOIN `forum_p` ON `forum_zakl`.`id_them` = `forum_p`.`id_them` AND `forum_p`.`time` > `forum_zakl`.`time` WHERE `forum_zakl`.`id_user` = '$user[id]' AND `forum_p`.`id` IS NOT NULL"),0);
if ($k_n_s_zak>0)
echo "<a href='/zakl.php' title='Новые сообщения в закладках'><img src='/style/img/zak.png' alt='' /> <u>+ $k_n_s_zak</u></a><br />\n";



}
echo '</div>';
/*
//echo "<div class='rekl'>\n";
//rekl(1);
//echo "</div>\n";
if(isset($user)){
//echo "<div class='mytitle'>\n";

echo '<div class="mytitle">';
echo "".online($user['id'])."\n";
echo " <a href='/info.php'>$user[nick]</a><br/>\n";
echo "$title\n";
echo '</div>';

}
*/
}
}
//Автор: Алексей & TeaM ICQ 95-95-466
//Скрипт: VKRUGUKENTOV.ru
//Копирование,продажа,перепродажа без согласия автора строго запрещена и будет караться плачевными последствиями
//Соблюдайте авторские права
?>