Файл: sys/info/stat.php
Строк: 187
<?php
echo "<div class='list-group-item'>";
if (!isset($_GET['stat'])) {
echo "<a href='/$ank[mylink]?stat'><span class='fa fa-pie-chart fa-fw'></span> " . lang('Статистика профиля') . " <span class='fa fa-chevron-down'></span></a><br />";
} else {
echo "<a href='/$ank[mylink]?'><span class='fa fa-pie-chart fa-fw'></span> " . lang('Статистика профиля') . " <span class='fa fa-chevron-up'></span></a><br /><br />";
if ($user['id'] != $ank['id'] and $user['group_access'] > 1 and $user['group_access'] >= $ank['group_access'] and $ank['url'] != null and $ank['url_title'] != null) {
echo "<span class='fa fa-map-marker fa-fw'></span> " . lang('Находится') . ": <span style='color:grey;'><a href='$ank[url]'>" . output_text($user['url_title']) . "</a></span><br />";
}
$k_them = mysql_result(query("SELECT COUNT(*) FROM `forum_themes` WHERE `id_user` = '$ank[id]'"), 0);
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Тем в форуме') . ": <span style='color:grey;'>[$k_them]</span><br />n";
$k_p_forum = mysql_result(query("SELECT COUNT(*) FROM `forum_posts` WHERE `id_user` = '$ank[id]'"), 0);
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Сообщений в форуме') . ": <span style='color:grey;'>[$k_p_forum]</span><br />n";
$mail3 = mysql_result(query("SELECT COUNT(*) FROM `mail` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'"), 0);
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Приватные сообщения') . ": <span style='color:grey;'>[$mail3]</span><br />n";
$obmennik3 = mysql_result(query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$ank[id]'"), 0);
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Файлы в обменнике') . ": <span style='color:grey;'>[$obmennik3]</span><br />n";
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Баллы') . ": <span style='color:grey;'>[$ank[balls]]</span><br />n";
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Рейтинг') . ": <span style='color:grey;'>" . rating::output($ank['id']) . "</span><br />n";
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Монеты') . ": <span style='color:grey;'>[$ank[money]]</span><br />n";
$narush = mysql_result(query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]'"), 0);
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Нарушений') . ": " . ($narush == 0 ? " <span style='color:grey;'>" . lang('нет') . "</span>" : "<span style='color:grey;'>[<a href='/user/histori_ban?id={$ank['id']}'>$narush</a>]</span>") . '<br/>';
$timediff = mysql_result(query("SELECT `time` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"), 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 = lang('часов');
$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 = lang('часа');
} elseif ($h_1 == 1) {
$sHoursText = lang('час');
}
}
if ($nHoursLeftLength == 1) {
if ($h_1 == 2 || $h_1 == 3 || $h_1 == 4) {
$sHoursText = lang('часа');
} elseif ($h_1 == 1) {
$sHoursText = lang('час');
}
}
$sMinsLeft = $minutefield;
$sMinsText = lang('минут');
$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 = lang('минуты');
} else if ($m_1 == 1) {
$sMinsText = lang('минута');
}
}
if ($nMinsLeftLength == 1) {
if ($m_1 == 2 || $m_1 == 3 || $m_1 == 4) {
$sMinsText = lang('минуты');
} elseif ($m_1 == 1) {
$sMinsText = lang('минута');
}
}
$displaystring = "" .
$sHoursLeft . " " .
$sHoursText . " " .
$sMinsLeft . " " .
$sMinsText . " ";
if ($timediff < 0) {
$displaystring = null;
}
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Регистрация') . ": <span style='color:grey;'>" . date::time($ank['date_reg']) . "</span><br />n";
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('На сайте провел' . ($ank['pol'] == 0 ? 'а' : false)) . ": <span style='color:grey;'>$displaystring</span><br />n";
echo "<span class='fa fa-caret-square-o-right fa-fw'></span> " . lang('Посл. посещение') . ": <span style='color:grey;' title='" . date::time($ank['date_last']) . "'>" . date::times($ank['date_last']) . "</span><br />n";
}
echo "</div>";