-
Notifications
You must be signed in to change notification settings - Fork 3
/
online.php
144 lines (144 loc) · 5.96 KB
/
online.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
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';
// 显示模式
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();
/*
==============================================
这个脚本输出 1 个随机的“领导者”和
他们整个名单的链接。(с) DCMS-Social
==============================================
*/
$k_lider = dbresult(dbquery("SELECT COUNT(*) FROM `liders` WHERE `time` > '$time'"), 0);
$liders = dbassoc(dbquery("SELECT * FROM `liders` WHERE `time` > '$time' ORDER BY rand() LIMIT 1"));
if ($k_lider > 0) {
echo '<div class="main">';
$lider = user::get_user($liders['id_user']);
echo user::nick($lider['id'], 1, 1, 0) . '<br />';//输出用户名
if ($liders['msg'])
echo output_text($liders['msg']) . '<br />';
echo '<img src="/style/icons/lider.gif" alt="S"/> <a href="/user/liders/">所有管理员</a> (' . $k_lider . ')';
echo '</div>';
}
$k_post = dbresult(dbquery("SELECT COUNT(*) FROM `user` WHERE `date_last` > '" . (time() - 600) . "'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$q = dbquery("SELECT id, 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() - 600) . "' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
echo '<table class="post">';
if ($k_post == 0) {
echo '<div class="mess">';
echo '现在网站上没有人';
echo '</div>';
}
while ($ank = dbassoc($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;
}
// 莱森卡
echo '<div class="' . ($num % 2 ? "nav1" : "nav2") . '">';
$num++;
echo user::nick($ank['id'], 1, 1, 0) .' <br />';//输出用户名
// 高级模式
if (isset($user) && isset($_SESSION['admin'])) {
// Возможные ники
$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],1,1,0);//输出用户名
}
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">IP:</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">IP (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">IP (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 />';
}
}
}
} else {
echo '<b>(' . (($ank['pol'] == 1) ? '男' : '女') . (($ank['ank_age'] == null) ? '/未指定' : '/' . $ank['ank_age']) . ')</b>';
if ($ank['ank_city'] != NULL)
echo ', ' . text($ank['ank_city']);
if ($ank['ank_o_sebe'] != NULL)
echo ', ' . text($ank['ank_o_sebe']);
echo ', <img src="/style/icons/time.png" alt="away" /> [' . vremja($ank['date_last']) . ']';
}
echo '</div>';
}
echo '</table>';
if ($k_page > 1) str("?", $k_page, $page); // 输出页数
if (user_access('user_collisions')) {
?>
<div class="foot">
<?= (!isset($_SESSION['admin']) ? '<a href="?admin">高级模式</a> | <b>正常模式</b>' : '<b>高级模式</b> | <a href="?admin=close">正常模式</a>') ?>
</div>
<?
}
include_once 'sys/inc/tfoot.php';
?>