Файл: sys/fnc/title.php
Строк: 69
<?php
function title($title = NULL) {
global $set;
global $user;
if ($set['web'] == false) {
if ($title == NULL) {
$title = $set['title'];
}
echo "<table class = 'title' cellspacing = '0' cellpadding = '0'><tr>";
if ($_SERVER['PHP_SELF'] != '/index.php') {
echo "<a href = '/index.php'><td class = 'titles'>";
echo img('home.png');
echo "</td></a>";
} else {
echo "<td class = 'titles'>";
echo img('home.png');
echo "</td>";
}
if (isset($user)) {
echo "<td class = 'null'>";
$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);
if ($k_new == 0) {
$k_new = "";
} else {
$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) . "";
}
echo "<span class = 'tiptip' style = 'float:right;padding-right: 7px;'>";
if ($k_new == 0) {
echo "<a href = '/mail.php' title = 'Почта'>" . img('mail.png') . " $k_new</a>";
} else {
echo "<a href = '/mails.php' title = 'Почта'>" . img('mail.png') . " $k_new</a>";
}
echo "</span>";
$journal = mysql_result(mysql_query('SELECT COUNT(*) FROM `f_journal` WHERE `read` = "0" AND `id_user` = ' . $user['id']), 0);
if ($journal != 0) {
echo "<span class = 'tiptip' style = 'float:right;padding-right: 7px;'>";
echo "<a href = '/modules/forum/journal.php?new' title = 'Журнал форума'>" . img('not.png') . " $journal</a>";
echo "</span>";
}
$friends = mysql_result(mysql_query(" SELECT COUNT(*) FROM `friends_new` WHERE `to` = '$user[id]'"), 0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `friends_new` WHERE `to` = ' $user[id] ' LIMIT 1"), 0) > 0) {
echo "<span class = 'tiptip' style = 'float:right;padding-right: 7px;'>";
echo "<a href = '/user/friends/new.php' title = 'Друзья'>" . img('friend.png') . " $friends</a>";
echo "</span>";
}
/*
echo "<span style='float : right;padding: 3px;'>";
global $user;
if (isset($user) && $user['set_times'] == 1) {
echo date("H:i");
}
echo "</span>n";
*
*/
echo "</td>n";
}
echo '</tr></table>';
}
}