Файл: user/inc/online.php
Строк: 109
<?php
$set['title'] = 'Онлайн на сайте';
$k_post = count::query('user', ' `date_last`>"' . (time() - $set['user_online']) . '"');
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
if ($k_post == 0) {
msg(lang("Сейчас на сайте никого нет"));
} else {
$q = $db->query('SELECT `user`.`id`, `user`.`group_access`, `user`.`ip`, `user`.`ua`, `user`.`url_title`, `user`.`date_reg`, `user`.`date_last`,
`user_group`.`name` AS group_name
FROM `user`
LEFT JOIN `user_group` ON `user_group`.`id`=`user`.`group_access`
WHERE `date_last` > ?i ORDER BY `date_last` DESC LIMIT ?i, ?i', [(time() - $set['user_online']), $start, $set['p_str']]);
echo '<table class="post" style="width:100%;border:0;border-spacing:1px1px;padding:0px;table-layout:inherit;">' . PHP_EOL;
while ($ank = $q->row()) {
echo ' <tr>' . PHP_EOL;
echo ' <td class="avar" style="width:80px;padding:7px;">' . PHP_EOL;
avatar($ank['id'], 80, 80);
echo ' </td>' . PHP_EOL;
echo ' <td class="p_m" style="vertical-align:top;">' . PHP_EOL;
echo nick($ank['id']);
if ($ank['group_access'] > 1) {
echo ' (<span class="status"><small>' . lang($ank['group_name']) .
'</small></span>)';
}
if ($ank['url_title'] != null and $user['group_access'] > 1) {
echo '<span class="ank_d"> ' . output_text($ank['url_title']) . '</span>' . PHP_EOL;
}
echo '<br />' . PHP_EOL;
echo ' <span class="ank_n">' . lang('Регистрация') . ':</span> <span class="ank_d">' .
vremja($ank['date_reg']) . '</span><br />' . PHP_EOL;
echo ' <span class="ank_n">' . lang('Посл. посещение') . ':</span> <span class="ank_d">' .
vremja($ank['date_last']) . '</span><br />' . PHP_EOL;
if (isset($ank['ua']) && user_access('user_show_ua') && $user['group_access'] > $ank['group_access']) {
echo '<span class="ank_n">UA:</span> <span class="ank_d">' . $ank['ua'] . '</span><br />' . PHP_EOL;
}
if (user_access('user_show_ip') && $ank['ip'] != 0 and $ank['ip'] != null and $user['group_access'] >
$ank['group_access']) {
echo ' <span class="ank_n">IP:</span> <span class="ank_d">' . long2ip($ank['ip']) .
'</span><br />' . PHP_EOL;
}
if ($set['user_collision_online'] == 1) {
if (user_access('user_collisions') and $user['group_access'] > $ank['group_access']) {
$mass[0] = $ank['id'];
$collisions = user_collision($mass);
if (count($collisions) > 1) {
echo ' <span class="ank_n">' . lang('Возможные ники') . ':</span>' . PHP_EOL;
echo ' <span class="ank_d">';
for ($i = 1; $i < count($collisions); $i++) {
$ank_coll = $db->query('SELECT `nick`, `mylink` FROM `user` WHERE `id` =?i LIMIT ?i', [$collisions[$i]])->row();
echo '<a href="/' . $ank_coll['mylink'] . '">' . nick($ank_coll['nick']) .
'</a>';
}
echo '</span>' . PHP_EOL;
}
}
}
if ($user['id'] != $ank['id']) {
echo ' <span style="float:right;">';
echo '<a href="/mail.php?id=' . $ank['id'] . '"><img src="/style/themes/' . $set['set_them'] . '/mail.png" alt="*"/></a>';
echo '</span>' . PHP_EOL;
}
echo ' </td>' . PHP_EOL;
echo ' </tr>' . PHP_EOL;
}
echo '</table>' . PHP_EOL;
if ($k_page > 1) {
str('?', $k_page, $page);
}
}