mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-29 01:34:31 +01:00
unique ips column
This commit is contained in:
parent
c9a2fe5343
commit
84d600a880
@ -21,8 +21,10 @@ foreach ($boards as $i => $board) {
|
|||||||
$query = prepare(sprintf("
|
$query = prepare(sprintf("
|
||||||
SELECT MAX(id) max, (SELECT COUNT(*) FROM ``posts_%s`` WHERE FROM_UNIXTIME(time) > DATE_SUB(NOW(), INTERVAL 1 DAY)) ppd,
|
SELECT MAX(id) max, (SELECT COUNT(*) FROM ``posts_%s`` WHERE FROM_UNIXTIME(time) > DATE_SUB(NOW(), INTERVAL 1 DAY)) ppd,
|
||||||
(SELECT COUNT(*) FROM ``posts_%s`` WHERE FROM_UNIXTIME(time) > DATE_SUB(NOW(), INTERVAL 1 HOUR)) pph,
|
(SELECT COUNT(*) FROM ``posts_%s`` WHERE FROM_UNIXTIME(time) > DATE_SUB(NOW(), INTERVAL 1 HOUR)) pph,
|
||||||
(SELECT count(id) FROM ``posts_%s``) count FROM ``posts_%s``
|
(SELECT count(id) FROM ``posts_%s``) count,
|
||||||
", $board['uri'], $board['uri'], $board['uri'], $board['uri']));
|
(SELECT COUNT(DISTINCT ip) FROM ``posts_%s``) uniq_ip
|
||||||
|
FROM ``posts_%s``
|
||||||
|
", $board['uri'], $board['uri'], $board['uri'], $board['uri'], $board['uri']));
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
$r = $query->fetch(PDO::FETCH_ASSOC);
|
$r = $query->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
@ -35,6 +37,7 @@ SELECT MAX(id) max, (SELECT COUNT(*) FROM ``posts_%s`` WHERE FROM_UNIXTIME(time)
|
|||||||
$boards[$i]['pph'] = $pph;
|
$boards[$i]['pph'] = $pph;
|
||||||
$boards[$i]['ppd'] = $ppd;
|
$boards[$i]['ppd'] = $ppd;
|
||||||
$boards[$i]['max'] = $r['max'];
|
$boards[$i]['max'] = $r['max'];
|
||||||
|
$boards[$i]['uniq_ip'] = $r['uniq_ip'];
|
||||||
}
|
}
|
||||||
|
|
||||||
usort($boards,
|
usort($boards,
|
||||||
|
@ -23,7 +23,16 @@ th.headerSortDown {
|
|||||||
|
|
||||||
<p style='text-align:center'>{% trans %}There are currently <strong>{{n_boards}}</strong> boards + <strong>{{hidden_boards_total}}</strong> unindexed boards = <strong>{{t_boards}}</strong> total boards. Site-wide, {{total_posts_hour}} posts have been made in the last hour, with {{total_posts}} being made on all active boards since October 23, 2013.{% endtrans %}</p>
|
<p style='text-align:center'>{% trans %}There are currently <strong>{{n_boards}}</strong> boards + <strong>{{hidden_boards_total}}</strong> unindexed boards = <strong>{{t_boards}}</strong> total boards. Site-wide, {{total_posts_hour}} posts have been made in the last hour, with {{total_posts}} being made on all active boards since October 23, 2013.{% endtrans %}</p>
|
||||||
|
|
||||||
<table class="modlog" style="width:auto"><thead><tr><th>L</th><th>{% trans %}Board{% endtrans %}</th><th>{% trans %}Board title{% endtrans %}</th><th>{% trans %}Posts in last hour{% endtrans %}</th><th>{% trans %}Total posts{% endtrans %}</th><th>{% trans %}Created{% endtrans %}</th></tr></thead><tbody>
|
<table class="modlog" style="width:auto"><thead>
|
||||||
|
<tr>
|
||||||
|
<th>L</th>
|
||||||
|
<th>{% trans %}Board{% endtrans %}</th>
|
||||||
|
<th>{% trans %}Board title{% endtrans %}</th>
|
||||||
|
<th>{% trans %}Posts in last hour{% endtrans %}</th>
|
||||||
|
<th>{% trans %}Total posts{% endtrans %}</th>
|
||||||
|
<th>{% trans %}Unique IPs{% endtrans %}</th>
|
||||||
|
<th>{% trans %}Created{% endtrans %}</th>
|
||||||
|
</tr></thead><tbody>
|
||||||
{% for board in boards %}
|
{% for board in boards %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ board.img|raw }}</td>
|
<td>{{ board.img|raw }}</td>
|
||||||
@ -31,6 +40,7 @@ th.headerSortDown {
|
|||||||
<td>{{ board['title'] }}</td>
|
<td>{{ board['title'] }}</td>
|
||||||
<td style='text-align:right'>{{board['pph']}}</td>
|
<td style='text-align:right'>{{board['pph']}}</td>
|
||||||
<td style='text-align:right'>{{board['max']}}</td>
|
<td style='text-align:right'>{{board['max']}}</td>
|
||||||
|
<td style='text-align:right'>{{board['uniq_ip']}}</td>
|
||||||
<td>{{board['time']}} ({{board['ago']}} ago)</td></tr>
|
<td>{{board['time']}} ({{board['ago']}} ago)</td></tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
Loading…
Reference in New Issue
Block a user