-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProfileHistory.template.php
162 lines (140 loc) · 4.93 KB
/
ProfileHistory.template.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
/**
* @name ElkArte Forum
* @copyright ElkArte Forum contributors
* @license BSD http://opensource.org/licenses/BSD-3-Clause
*
* This software is a derived product, based on:
*
* Simple Machines Forum (SMF)
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.0
*
*/
/**
* This template shows an admin information on a users IP addresses used and errors attributed to them.
*/
function template_trackActivity()
{
global $context, $scripturl, $txt;
// The first table shows IP information about the user.
echo '
<div class="generic_list_wrapper">
<h3 class="category_header"><strong>', $txt['view_ips_by'], ' ', $context['member']['name'], '</strong></h3>';
// The last IP the user used.
echo '
<div id="tracking" class="windowbg2">
<div class="content">
<dl class="noborder">
<dt>', $txt['most_recent_ip'], ':
', (empty($context['last_ip2']) ? '' : '<br />
<span class="smalltext">(<a href="' . $scripturl . '?action=quickhelp;help=whytwoip" onclick="return reqOverlayDiv(this.href);">' . $txt['why_two_ip_address'] . '</a>)</span>'), '
</dt>
<dd>
<a href="', $scripturl, '?action=profile;area=history;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
// Second address detected?
if (!empty($context['last_ip2']))
echo '
, <a href="', $scripturl, '?action=profile;area=history;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
echo '
</dd>';
// Lists of IP addresses used in messages / error messages.
echo '
<dt>', $txt['ips_in_messages'], ':</dt>
<dd>
', (count($context['ips']) > 0 ? implode(', ', $context['ips']) : '(' . $txt['none'] . ')'), '
</dd>
<dt>', $txt['ips_in_errors'], ':</dt>
<dd>
', (count($context['ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
</dd>';
// List any members that have used the same IP addresses as the current member.
echo '
<dt>', $txt['members_in_range'], ':</dt>
<dd>
', (count($context['members_in_range']) > 0 ? implode(', ', $context['members_in_range']) : '(' . $txt['none'] . ')'), '
</dd>
</dl>
</div>
</div>
</div>
<br />';
// Show the track user list.
template_show_list('track_name_user_list');
}
/**
* The template for trackIP, allowing the admin to see where/who a certain IP has been used.
*/
function template_trackIP()
{
global $context, $txt;
// This function always defaults to the last IP used by a member but can be set to track any IP.
// The first table in the template gives an input box to allow the admin to enter another IP to track.
echo '
<div>
<h3 class="category_header">', $txt['trackIP'], '</h3>
<div class="roundframe">
<form action="', $context['base_url'], '" method="post" accept-charset="UTF-8">
<dl class="settings">
<dt>
<label for="searchip"><strong>', $txt['enter_ip'], ':</strong></label>
</dt>
<dd>
<input type="text" id="searchip" name="searchip" value="', $context['ip'], '" class="input_text" />
</dd>
</dl>
<input type="submit" value="', $txt['trackIP'], '" class="right_submit" />
</form>
</div>
</div>
<br />
<div class="generic_list_wrapper">';
// The table in between the first and second table shows links to the whois server for every region.
if ($context['single_ip'])
{
echo '
<h3 class="category_header">', $txt['whois_title'], ' ', $context['ip'], '</h3>
<div class="windowbg2">';
foreach ($context['whois_servers'] as $server)
echo '
<a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br />';
echo '
</div>';
}
// The second table lists all the members who have been logged as using this IP address.
echo '
<h3 class="category_header">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>';
if (empty($context['ips']))
echo '
<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
else
{
echo '
<table class="table_grid">
<thead>
<tr class="table_head">
<th scope="col">', $txt['ip_address'], '</th>
<th scope="col">', $txt['display_name'], '</th>
</tr>
</thead>
<tbody>';
// Loop through each of the members and display them.
foreach ($context['ips'] as $ip => $memberlist)
echo '
<tr>
<td class="windowbg2"><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
<td class="windowbg2">', implode(', ', $memberlist), '</td>
</tr>';
echo '
</tbody>
</table>';
}
echo '
</div>
<br />';
template_show_list('track_message_list');
echo '<br />';
template_show_list('track_ip_user_list');
}