Файл: sys/fnc/aut.php
Строк: 43
<?php
function aut() {
global $set;
$rekl = mysql_result(mysql_query("SELECT COUNT(*) FROM `rekl` WHERE `sel` = '1'"), 0);
if ($rekl > 0) {
echo "<div class='rekl'>n";
rekl(1);
echo "</div>n";
}
global $user;
if (isset($user)) {
if (@$_GET['del'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `mess` WHERE `id` = '" . intval($_GET['del']) . "'"), 0) == 1) {
$post = mysql_fetch_assoc(mysql_query("SELECT * FROM `mess` WHERE `id` = '" . intval($_GET['del']) . "' LIMIT 1"));
mysql_query("DELETE FROM `mess` WHERE `id` = '$post[id]'");
}
$q = mysql_result(mysql_query("SELECT COUNT(*) FROM `mess` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
if ($q != 0) {
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mess` WHERE `id_kont` = '" . $user['id'] . "'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$qis = mysql_query("SELECT * FROM `mess` WHERE `id_kont` = '" . $user['id'] . "' ORDER BY id DESC LIMIT 1");
while ($post = mysql_fetch_array($qis)) {
echo "<div class='new'>";
echo "<div class = 'right' id = 'hide'>";
echo "<a href = '?del=$post[id]' title = 'Отметить как прочитанное'><img src = '/style/icons/hide.png' /></a>";
echo "</div>";
echo "<img src = '/style/icons/mail_red.png' /> " . output_text($post['msg']) . "<br />";
echo "</div>";
}
}
}
if (isset($user)) {
echo "<a href='/info.php'><table class = 'auts'><tr><td class = 'icon14'>";
echo "<img class='Photo' src='/sys/avatar/";
if (is_file(H . "sys/avatar/$user[id].gif")) {
echo "$user[id].gif";
} elseif (is_file(H . "sys/avatar/$user[id].jpg")) {
echo "$user[id].jpg";
} elseif (is_file(H . "sys/avatar/$user[id].png")) {
echo "$user[id].png";
} else {
echo "avatar.png";
}
echo "' /></td><td class = 'null'><span class='Name'>";
echo text::gradient("$user[nick]", "$user[ncolor]", "$user[ncolor2]");
echo "</span><br />";
if ($user['welcome'] != NULL) {
echo "<small><i>" . output_text($user['welcome']) . "</i></small>";
}
echo "</td></tr></table></a>";
} else {
echo "<div class='auts'>";
echo "<a href='/aut.php'><font color = 'gray'>Вход</font></a> <a href='/reg.php'><font color = 'gray'>Регистрация</font></a><br />n";
echo "</div>n";
}
if (isset($user)) {
$leader = mysql_fetch_array(mysql_query("SELECT * FROM `leader`"));
if ($leader['time'] >= TIME) {
echo "<span style = 'border: 1px #E5E5E5 solid;border-radius: 5px;background: #F2F2F2;padding: 3px;margin: 2px;'>";
echo "<a href = '/info.php?id=$leader[id_user]'><b>$leader[nick_user]</b></a> ";
echo "<a href = '/pages/shop/'><img src = '/style/icons/basket_put.png' /></a>";
echo "</span>n";
}
}
}