From 84d600a880f368ced8332be30bac1306df48c9ee Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 29 Sep 2014 07:17:00 +0000 Subject: [PATCH 1/3] unique ips column --- boards.php | 7 +++++-- templates/8chan/boards.html | 12 +++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/boards.php b/boards.php index ce6ac945..f1d6656e 100644 --- a/boards.php +++ b/boards.php @@ -21,8 +21,10 @@ foreach ($boards as $i => $board) { $query = prepare(sprintf(" 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(id) FROM ``posts_%s``) count FROM ``posts_%s`` -", $board['uri'], $board['uri'], $board['uri'], $board['uri'])); +(SELECT count(id) FROM ``posts_%s``) count, +(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)); $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]['ppd'] = $ppd; $boards[$i]['max'] = $r['max']; + $boards[$i]['uniq_ip'] = $r['uniq_ip']; } usort($boards, diff --git a/templates/8chan/boards.html b/templates/8chan/boards.html index 3e7c402d..34d9bb7e 100644 --- a/templates/8chan/boards.html +++ b/templates/8chan/boards.html @@ -23,7 +23,16 @@ th.headerSortDown {

{% trans %}There are currently {{n_boards}} boards + {{hidden_boards_total}} unindexed boards = {{t_boards}} 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 %}

- +
L{% trans %}Board{% endtrans %}{% trans %}Board title{% endtrans %}{% trans %}Posts in last hour{% endtrans %}{% trans %}Total posts{% endtrans %}{% trans %}Created{% endtrans %}
+ + + + + + + + + {% for board in boards %} @@ -31,6 +40,7 @@ th.headerSortDown { + {% endfor %}
L{% trans %}Board{% endtrans %}{% trans %}Board title{% endtrans %}{% trans %}Posts in last hour{% endtrans %}{% trans %}Total posts{% endtrans %}{% trans %}Unique IPs{% endtrans %}{% trans %}Created{% endtrans %}
{{ board.img|raw }}{{ board['title'] }} {{board['pph']}} {{board['max']}}{{board['uniq_ip']}} {{board['time']}} ({{board['ago']}} ago)
From e6ab91e66c8b25514bd62291a1395bb4a1e55055 Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 29 Sep 2014 07:17:19 +0000 Subject: [PATCH 2/3] no board may be called reports --- create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create.php b/create.php index 88f3952e..e4b28215 100644 --- a/create.php +++ b/create.php @@ -12,7 +12,7 @@ include "inc/lib/recaptcha/recaptchalib.php"; checkBan('*'); -$bannedWords = array('/^cake$/', '8ch', '/^cp$/', 'child', '/^inc$/', '/^static$/', '/^templates$/', '/^js$/', '/^stylesheets$/', '/^tools$/', '/^pedo$/'); +$bannedWords = array('/^cake$/', '8ch', '/^cp$/', 'child', '/^inc$/', '/^static$/', '/^templates$/', '/^js$/', '/^stylesheets$/', '/^tools$/', '/^pedo$/', '/^reports$/'); $ayah = (($config['ayah_enabled']) ? new AYAH() : false); From f3000b6d8ad605116171a0e89b73bd5d77ad4dba Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 29 Sep 2014 07:17:39 +0000 Subject: [PATCH 3/3] Reset to global locale before openBoard --- tools/rebuild.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/rebuild.php b/tools/rebuild.php index 3501f8f6..82df3e19 100755 --- a/tools/rebuild.php +++ b/tools/rebuild.php @@ -26,6 +26,7 @@ $start = microtime(true); // parse command line $opts = getopt('qfb:', Array('board:', 'quick', 'full', 'quiet')); $options = Array(); +$global_locale = $config['locale']; $options['board'] = isset($opts['board']) ? $opts['board'] : (isset($opts['b']) ? $opts['b'] : false); $options['quiet'] = isset($opts['q']) || isset($opts['quiet']); @@ -59,6 +60,8 @@ foreach($boards as &$board) { if(!$options['quiet']) echo "Opening board /{$board['uri']}/...\n"; + // Reset locale to global locale + $config['locale'] = $global_locale; openBoard($board['uri']); $config['try_smarter'] = false;