Файл: setk/sys/fnc/footer.php
Строк: 71
<?
function footer()
{
global $user;
if (isset($user))
{
global $set;
if ($set['web'] == false)
{
?><table style="width:100%;" 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); // Уведомления
/*
=================================
Страничка
=================================
*/
?>
<td class="footer">
<a href="/info.php?id=<?=$user['id']?>"><center>Дом</center></a>
</td>
<?
/*
=================================
Почта
=================================
*/
?><td class="footer"><?
if ($k_new != 0 && $k_new_fav == 0)
{
?><a href="/new_mess.php"><center>Почта<span class="count"><?=$k_new?></span></center></a><?
}
else
{
?><a href="/konts.php"><center>Почта</center></a><?
}
?></td><?
/*
=================================
Лента
=================================
*/
if ($lenta > 0)
{
$j2 = 'tape';
}
elseif ($discuss > 0)
{
$j2 = 'discussions';
}
elseif ($k_notif > 0)
{
$j2 = 'notification';
}
else
{
$j2 = 'tape';
}
?>
<td class='footer'>
<a href="/user/<?=$j2?>/index.php"><center>Лента
<?
// Cкладываем сумму счетчиков
$k_l = $lenta + $k_notif + $discuss;
if($k_l > 0)
{
?>
<span class="count"><?=$k_l?></span>
<?
}
?>
</center></a>
</td>
<?
/*
=================================
Друзья
=================================
*/
if ($k_frend > 0)
{
?>
<td class='footer'>
<a href="/user/frends/new.php"><center>Друзья<span class="count"><?=$k_frend?></span></center></a>
</td>
<?
}
/*
=================================
Обновить
=================================
*/
?>
<td class='footer'>
<a href="<?=text($_SERVER['REQUEST_URI'])?>"><center>Обнов</center></a>
</td>
</tr></table>
<?
}
}
}
?>