Файл: people_online.php
Строк: 241
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
// Cмена режима отображения
if (isset($_GET['admin']) && user_access('user_collisions'))
{
if ($_GET['admin'] == 'close')
$_SESSION['admin'] = null;
else
$_SESSION['admin'] = true;
}
$set['title'] = 'Люди в сети'; // заголовок страницы
include_once 'sys/inc/thead.php';
title();
aut();
?>
<style>
.avatar{
border-radius:5px;
width:60px;
}
</style>
<?
echo '<table style="text-align:center;" class="mess" cellspacing="0" cellpadding="0">';
echo '<td><a style="border-right:none;" class="panel" href="/people.php">Люди</a></td>';
echo '<td style="border-right:none;" class="panel">В сети</td>';
echo '<td><a style="border-right:none;" class="panel" href="/people_day.php">За сутки</a></td>';
echo '<td><a class="panel" href="/people_search.php">Поиск</a></td>';
echo '</table>';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-1000)."'"), 0);
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT id, us_browser, ank_city, pol, ank_d_r, ank_m_r, ank_g_r, ank_o_sebe, url, level, ip, ip_xff, ip_cl, ua, date_last FROM `user` WHERE `date_last` > '".(time()-1000)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
echo '<table class="post">';
if ($k_post == 0)
{
echo '<div class="gmenu">';
echo 'В сети никого нет';
echo '</div>';
}
while ($ank = mysql_fetch_assoc($q))
{
$ank['ank_age'] = null;
if ($ank['ank_d_r'] != NULL && $ank['ank_m_r'] != NULL && $ank['ank_g_r'] != NULL)
{
$ank['ank_age'] = date("Y")-$ank['ank_g_r'];
if (date("n") < $ank['ank_m_r'])
$ank['ank_age'] = $ank['ank_age'] - 1;
elseif (date("n") == $ank['ank_m_r']&& date("j") < $ank['ank_d_r'])
$ank['ank_age'] = $ank['ank_age'] - 1;
}
$num++;
echo '<table class="mess">';
echo '<td width="13%">' . avatar($ank['id'], 0) . '</td><td style="font-size:12px;">' . group($ank['id'], 0) . ' ' . user::nick($ank['id']) . '';
echo '' . medal($ank['id']) . '';
echo '' . online($ank['id']) . '</br>';
echo 'Где: '. otkuda($ank['url']) .'';
echo '</br>';
echo ''.(($ank['pol'] == 1) ? 'М' : 'Ж') . (($ank['ank_age'] == null) ? '/Не указан' : '/' . $ank['ank_age']) . '';
if ($ank['ank_city'] != NULL)
echo ', Г. ' . text($ank['ank_city']);
echo '</br>';
echo ''.getbrowser_($ank['us_browser']);
echo '</table>';
// Расширенный режим
if (isset($user) && isset($_SESSION['admin']))
{
echo '<div class="gmenu">';
// Возможные ники
$mass[0] = $ank['id'];
$collisions = user_collision($mass);
if (count($collisions)>1)
{
echo '<span class="ank_n">Возможные ники</span> ';
echo '<span class="ank_d">';
for ($i = 1; $i < count($collisions); $i++)
{
echo ' :: ' . user::nick($collisions[$i]);
}
echo '</span><br />';
}
// IP пользователя
if ($ank['ip']!=NULL)
{
if (user_access('user_show_ip') && $ank['ip'] != 0)
{
echo '<span class="ank_n">IP:</span> <span class="ank_d">' . long2ip($ank['ip']) . '</span>';
if (user_access('adm_ban_ip'))
echo ' [<a href="/adm_panel/ban_ip.php?min=' . $ank['ip'] . '">Бан</a>]';
echo '<br />';
}
}
// IP клиента
if ($ank['ip_cl'] != NULL)
{
if (user_access('user_show_ip') && $ank['ip_cl']!=0)
{
echo '<span class="ank_n">IP (CLIENT):</span> <span class="ank_d">' . long2ip($ank['ip_cl']) . '</span>';
if (user_access('adm_ban_ip'))
echo ' [<a href="/adm_panel/ban_ip.php?min=' . $ank['ip_cl'] . '">Бан</a>]';
echo '<br />';
}
}
// IP (XFF)
if ($ank['ip_xff'] != NULL)
{
if (user_access('user_show_ip') && $ank['ip_xff'] != 0)
{
echo '<span class="ank_n">IP (XFF):</span> <span class="ank_d">' . long2ip($ank['ip_xff']) . '</span>';
if (user_access('adm_ban_ip'))
echo ' [<a href="/adm_panel/ban_ip.php?min=' . $ank['ip_xff'] . '">Бан</a>]';
echo '<br />';
}
}
// Браузер
if (user_access('user_show_ua') && $ank['ua']!=NULL)
echo '<span class="ank_n">Браузер:</span> <span class="ank_d">' . $ank['ua'] . '</span><br />';
if (user_access('user_show_ip') && opsos($ank['ip']))
echo '<span class="ank_n">Пров:</span> <span class="ank_d">' . opsos($ank['ip']) . '</span><br />';
if (user_access('user_show_ip') && opsos($ank['ip_cl']))
echo '<span class="ank_n">Пров (CL):</span> <span class="ank_d">' . opsos($ank['ip_cl']) . '</span><br />';
if (user_access('user_show_ip') && opsos($ank['ip_xff']))
echo '<span class="ank_n">Пров (XFF):</span> <span class="ank_d">' . opsos($ank['ip_xff']) . '</span><br />';
if ($user['level'] > $ank['level'] && $user['id'] != $ank['id'])
{
if (user_access('user_prof_edit'))
echo '[<a href="/adm_panel/user.php?id=' . $ank['id'] . '"><img src="/style/icons/edit.gif" alt="*" /> ред.</a>] ';
if ($user['id'] != $ank['id'])
{
if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo '[<a href="/adm_panel/ban.php?id=' . $ank['id'] . '"><img src="/style/icons/blicon.gif" alt="*" /> бан</a>] ';
if (user_access('user_delete'))
{
echo '[<a href="/adm_panel/delete_user.php?id=' . $ank['id'] . '"><img src="/style/icons/delete.gif" alt="*" /> удл.</a>] ';
echo '<br />';
}
}
}
echo '</div>';
}
}
echo '</table>';
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
if (user_access('user_collisions'))
{
?>
<div class="main">
<?=(!isset($_SESSION['admin']) ? '<a href="?admin">Расширенный режим</a> | <b>Обычный режим</b>' : '<b>Расширенный режим</b> | <a href="?admin=close">Обычный режим</a>')?>
</div>
<?
}
include_once 'sys/inc/tfoot.php';
?>