Файл: sys/s-fnc/auter.php
Строк: 136
<?
function auter()
{
global $set;
if ($set['web']==false)
{
global $user;
if (isset($user))
{
echo "<div class='hello'>";
echo "<img src='/s-klub/img/j-f.png'> ";
$chas=date("H",time());
if($chas>24)
{
$chas=round($chas-24);
}
if ($chas<0)
{
$chas=round($chas+24);
}
if ($chas<=4 || $chas>=23)
{
echo "Доброй ночи, ";
}
else if($chas>=5 && $chas<=10)
{
echo "Доброго утра, ";
}
else if ($chas>=11 && $chas<=17)
{
echo "Удачного дня, ";
}
else if ($chas>=18 && $chas<=22)
{
echo "Приятного вечера, ";
}
echo GradientText("$user[nick]", "$user[ncolor]", "$user[ncolor2]");
echo " ".online($user['id'])."<br />";
echo "<img src='/s-klub/img/time.png'> ";
echo "Местное время ".vremja($user['date_last'])."<br/>n";
echo "</div>";
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
echo "<td class='pan_u'><center>";
echo '<a href="/index.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/home.png" alt="" title="Главная" width="20" height="20"/></a>';
echo "</center></td>";
echo "<td class='pan_u'><center>";
if ($user['pol'] == 1)
{
echo '<a href="/info.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/man.png" alt="" title="Личная страница" width="20" height="20"/></a>';
}else{
echo '<a href="/info.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/man2.png" alt="" title="Личная страница" width="20" height="20"/></a>';
}
echo "</center></td>";
$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 "<td class='pan_u'><center>";
echo '<a href="/new_mess.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/mail_plus.png" alt="" title="Входящие сообщения + '.$k_new.'" width="20" height="20"/>+'.$k_new.'</a>';
echo "</center></td>";
}
if ($k_new_fav!=0)
{
echo "<td class='pan_u'><center>";
echo '<a href="/new_mess.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/mail-share.png" alt="" title="Входящие сообщения + '.$k_new_fav.'" width="20" height="20"/>'.$k_new_fav.'</a>';
echo "</center></td>";
}
if ($k_new==0 && $k_new_fav==0)
{
echo "<td class='pan_u'><center>";
echo '<a href="/konts.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/mail.png" alt="" title="Контакты" width="20" height="20"/></a>';
echo "</center></td>";
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `id_ank` = '".$user['id']."' AND `sogl` = '0' LIMIT 1"), 0) > 0)
{
$friends=mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `id_ank` = '".$user['id']."' AND `sogl` = '0'"), 0);
echo "<td class='pan_u'><center>";
echo "<a href='/frends/new.php' title='Предложения дружбы'><img src='/s-klub/ank/frend_add.png'> <font color='red'>+ ".$friends."</font></a>";
echo "</center></td>";
}
echo "<td class='pan_u'><center>";
echo '<a href="/umenu.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/umenu.png" alt="" title="Кабинет" width="20" height="20"/></a>';
echo "</center></td>";
$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 "<td class='pan_u'><center>";
echo '<a href="/zakl.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/zakl.png" alt="" title="Сообщения в закладках + '.$k_n_s_zak.'" width="20" height="20"/>+'.$k_n_s_zak.'</a>';
echo "</center></td>";
}
$for=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal_forum` WHERE `id_user` = '$user[id]' AND `upset` = '1' AND `otkl` = '0' "), 0);
echo "<td class='pan_u'><center>";
if ($for!=0)
{
echo '<a href="/jur_forum/jurnal_up.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/j-f-add.png" alt="" title="Извещений с форума - '.$for.'" width="20" height="20"/>+'.$for.'</a>';
}else{
echo '<a href="/jur_forum/jurnal_vse.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/j-f.png" alt="" title="Извещения с форума" width="20" height="20"/></a>';
}
echo "</center></td>";
echo "<td class='pan_u'><center>";
echo '<a href="/exit.php"><img src="/s-klub/thems/'.$set["set_them"].'/panel/exit.png" alt="" title="Покинуть сайт" width="20" height="20"/></a>';
echo "</center></td>";
echo "</tr></table>";
}else{
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
echo "<td class='pan_u'><center>";
echo "<a href='/aut.php'><img src='/s-klub/thems/".$set['set_them']."/panel/aut.png'> Авторизация</a>";
echo "</center></td>";
echo "<td class='pan_u'><center>";
echo "<a href='/reg.php'><img src='/s-klub/thems/".$set['set_them']."/panel/reg.png'> Регистрация</a>";
echo "</center></td>";
echo "</tr></table>";
}
}
}
?>