View file Pink_style_for_ds_wmzo_ru/Pink-umik/sys/fnc/aut.php

File size: 4.18Kb
<?
/*--Design by DoN------------------------*/

function title()
{
global $user;

if (isset($user))
{
global $set;		

if ($set['web'] == false)
{
	
if ($_SERVER['PHP_SELF'] == '/index.php')
{
?><table class="aut_i" cellspacing="0" cellpadding="0"><tr><?
}
else
{
?><table class="aut" cellspacing="0" cellpadding="0"><tr><?
}

$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); // Почта			
			 
$lenta = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `tape` WHERE `id_user` = '$user[id]' AND `read` = '0' "),0); // Лента						 
$discuss = mysql_result(mysql_query("SELECT COUNT(`count`) FROM `discussions` WHERE `id_user` = '$user[id]' AND `count` > '0' "),0); // Обсуждения					 
$k_frend = mysql_result(mysql_query("SELECT COUNT(id) FROM `frends_new` WHERE `to` = '$user[id]'"), 0); // Друзья
$k_notif = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0); // Уведомления 

/*--Заголовок страницы--*/
if ($_SERVER['PHP_SELF'] == '/index.php')
{
?><td class="aut_01"><span class='title'><font color='red'>LO</font>GO<font color='yellow'>.Ru</font></span></td><?
} else {?>

<td class="aut_01"><span class='title'><?=$set['title']?></span></td>

<?}


/*--Домой--*/
?><td class="aut_02">
<a href="/info.php?id=<?=$user['id']?>" class="ava_don"><center><?=avatar($user['id'])?></center></a>

</span></td>
<?

/*--Почта--*/	
?><td class="aut_02"><?
if ($k_new != 0 && $k_new_fav == 0)
{			
?><a href="/new_mess.php"><center><img src="/style/themes/<?=$set['set_them']?>/icons/aut/mess.png"/><span class='aut_count'><?=$k_new?></span></center></a><?
}
else
{
?><a href="/konts.php"><center><img src="/style/themes/<?=$set['set_them']?>/icons/aut/mess.png"/></center></a><?
}
?></td><?

			
/*--Лента--*/
if ($lenta > 0)
{
$j2 = 'tape';
}
elseif ($discuss > 0)
{
$j2 = 'discussions';
}
elseif ($k_frend > 0)
{
$j2 = 'frends/new.php';
}
elseif ($k_notif > 0)
{
$j2 = 'notification';
}
else
{
$j2 = 'tape';
}	
?>
<td class='aut_02'>
<a href="/user/<?=$j2?>/index.php"><center><img src="/style/themes/<?=$set['set_them']?>/icons/aut/lenta.png"/>

<?

// Cкладываем сумму счетчиков
$k_l = $lenta + $k_notif + $discuss + $k_frend;
if($k_l > 0)
{
?>

<span class='aut_count'><?=$k_l?></span>
<?}
?>
</center></a>
</td>


			
</tr></table>
<?
}
}
else
{
global $set;
if ($set['web'] == false)
{
if ($_SERVER['PHP_SELF'] == '/index.php')
{
?><table class="aut_i" cellspacing="0" cellpadding="0"><tr><?
}
else
{
?><table class="aut" cellspacing="0" cellpadding="0"><tr><?
}

/*--Заголовок страницы--*/



/*--Просто иконка =)--*/
if ($_SERVER['PHP_SELF'] == '/index.php')
{
?>
<td class="aut_01"><span class='title'><font color='red'>LO</font>GO<font color='yellow'>.Ru</font></span></td><?
}
else
{
/*--Домой--*/
?>
<td class="aut_01">
<span class='title'><?=$set['title']?></span></td>
<td class="aut_02">
<a href="/"><center><img src="/style/themes/<?=$set['set_them']?>/icons/aut/home.png"/></center></a>
</td>
<?
}

/*--Вход--*/	
?>
<td class="aut_02">
<span class='title'><a href="/aut.php"><center><img src="/style/themes/<?=$set['set_them']?>/icons/aut/aut.png"/></center></a></span>
</td>
<?

/*--Регистрация--*/		
?>
<td class="aut_02">
<span class='title'><a href="/reg.php"><img src="/style/themes/<?=$set['set_them']?>/icons/aut/reg.png"/></a></span>
</td>

</tr></table>
<?
} 
} 
}
?>