Файл: aktiv.php
Строк: 205
<?
include_once 'sys/includes/start.php';
include_once 'sys/includes/compress.php';
include_once 'sys/includes/sess.php';
include_once 'sys/includes/home.php';
include_once 'sys/includes/settings.php';
include_once 'sys/includes/db_connect.php';
include_once 'sys/includes/ipua.php';
include_once 'sys/includes/fnc.php';
include_once 'sys/includes/user.php';
only_reg();
$set['title']='Активность обитателя';
include_once 'sys/includes/header.php';
title();
auter();
if (isset($user))
{
$ank['id']=$user['id'];
}
if (isset($_GET['id']))
{
$ank['id']=intval($_GET['id']);
}
if ($ank['id']==0)
{
echo "<div class='err'>";
echo "Данные об активности такого обитателя не найдены!";
echo "</div>";
include_once 'sys/includes/footer.php';
exit;
}
$ank=get_user($ank['id']);
if (!$ank)
{
echo "<div class='err'>";
echo "Данные об активности такого обитателя не найдены!";
echo "</div>";
include_once 'sys/includes/footer.php';
exit;
}
if (($user['id']==$ank['id']) || ($user['level']>=4))
{
echo "<div class='title'>";
echo "<b>Активность ".$ank['nick']."</b>";
echo "</div>";
$ban=mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time' ORDER BY `time` DESC LIMIT 5");
while ($bann=mysql_fetch_assoc($ban))
{
echo "<div class = 'forum'><div class = 'err'>";
echo "<b>Забанен до ".vremja($bann['time']).":</b>";
echo "<b>".output_text($bann['prich'])."</b><br />";
echo "</div></div>";
}
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
echo "<td class='icon14'><center>";
avatar_mini($ank['id']);
echo "</center></td>";
echo "<td class='forum_tema'>";
echo "<img src='/s-klub/img/razmer.png'> ";
echo "ID:</span> ".$ank['id']."<br />";
echo "".status($ank['id'])." ";
echo GradientText("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo " ".online($ank['id'])." ";
echo "<br />";
if ($ank['group_access']>1)
{
echo "<img src='/s-klub/img/adm.png'> ";
echo "".$ank['group_name']."<br />";
}
echo "<img src='/s-klub/img/who.png'> ";
echo "Пол: ";
if ($ank['pol']==0)
{
echo "Жен. <img src='/s-klub/ank/0.png'>";
}else{
echo "Муж. <img src='/s-klub/ank/1.png'>";
}
echo "</td>";
echo "</tr></table>";
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/ban.png'> ";
$narush=mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]'"), 0);
echo "Нарушений: ".(($narush==0)?"Нету<br />":"$narush<br />");
echo "</div>";
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/activ.png'> ";
echo "Рейтинг: ".$ank['rating']."<br />";
echo "</div>";
$forum_temu=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/forum_temu.png'> ";
echo "Тем в форуме: ".$forum_temu."<br />";
echo "</div>";
$forum_mess=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/forum_mess.png'> ";
echo "Постов в форуме: ".$forum_mess."<br />";
echo "</div>";
$zakl=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/zakl.png'> ";
echo "Закладок: ".$zakl."<br />";
echo "</div>";
$guest=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/guest.png'> ";
echo "Постов в гостевой: ".$guest."<br />";
echo "</div>";
$mail=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/mails.png'> ";
echo "Приватных сообщений: ".$mail."<br />";
echo "</div>";
$komm_loads=mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_komm` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/komm_loads.png'> ";
echo "Комментарии в загрузках: ".$komm_loads."<br />";
echo "</div>";
$news_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/news_komm.png'> ";
echo "Комментариев к новостям: ".$news_komm."<br />";
echo "</div>";
$voice=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_voice2` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'"),0);
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/voice.png'> ";
echo "Рейтинги: ".$voice."<br />";
echo "</div>";
$votes_user=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_user` WHERE `u_id` = '$ank[id]'"),0);
if ($votes_user==0)
{
$votes='0';
}else{
$votes='$votes_user';
}
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/voise.png'> ";
echo "Голосования: ".$votes."<br />";
echo "</div>";
$timediff=mysql_result(mysql_query("SELECT `time` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1",$db), 0);
$oneMinute=60;
$oneHour=60*60;
$hourfield=floor(($timediff)/$oneHour);
$minutefield=floor(($timediff-$hourfield*$oneHour)/$oneMinute);
$secondfield=floor(($timediff-$hourfield*$oneHour-$minutefield*$oneMinute));
$sHoursLeft=$hourfield;
$sHoursText = "часов";
$nHoursLeftLength = strlen($sHoursLeft);
$h_1=substr($sHoursLeft,-1,1);
if (substr($sHoursLeft,-2,1) != 1 && $nHoursLeftLength>1)
{
if ($h_1== 2 || $h_1== 3 || $h_1== 4)
{
$sHoursText = "часа";
}
else if ($h_1== 1)
{
$sHoursText = "час";
}
}
if ($nHoursLeftLength==1)
{
if ($h_1== 2 || $h_1== 3 || $h_1== 4)
{
$sHoursText = "часа";
}
else if ($h_1== 1)
{
$sHoursText = "час";
}
}
$sMinsLeft =$minutefield;
$sMinsText = "минут";
$nMinsLeftLength = strlen($sMinsLeft);
$m_1=substr($sMinsLeft,-1,1);
if ($nMinsLeftLength>1 && substr($sMinsLeft,-2,1) != 1)
{
if ($m_1== 2 || $m_1== 3 || $m_1== 4)
{
$sMinsText = "минуты";
}
else if ($m_1== 1)
{
$sMinsText = "минута";
}
}
if ($nMinsLeftLength==1)
{
if ($m_1== 2 || $m_1==3 || $m_1== 4)
{
$sMinsText = "минуты";
}
else if ($m_1== "1")
{
$sMinsText = "минута";
}
}
$displaystring="".
$sHoursLeft." ".
$sHoursText." ".
$sMinsLeft." ".
$sMinsText." ";
if ($timediff<0) $displaystring='дата уже наступила';
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/date.png'> ";
echo "Регистрация: ".vremja($ank['date_reg'])."<br />";
echo "</div>";
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/time.png'> ";
if ($ank['pol']==0)
{
$pr='провел';
}else{
$pr='провела';
}
echo "На сайте ".$pr.": ".$displaystring."<br />";
echo "</div>";
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/ank/time_go.png'> ";
echo "Посл. посещение: ".vremja($ank['date_last'])."<br />";
echo "</div>";
}else{
header("Location: /index.php?".SID);
exit;
}
echo "<a href='/info.php?id=$ank[id]'><div class='foot'>";
echo "<img src='/s-klub/img/left.png'> ";
echo "<b>Личная страница ".$ank['nick']."</b>";
echo "</div></a>";
include_once 'sys/includes/footer.php';
?>