diff options
| author | Simon McFarlane <simon@piston.pw> | 2015-05-26 23:31:47 -0700 |
|---|---|---|
| committer | Simon McFarlane <simon@piston.pw> | 2015-05-29 01:34:53 -0700 |
| commit | 4b40f69a4e6d190f6d342875bd084c2a6c9d8b0f (patch) | |
| tree | fcc5dc9efa24afcb0bda3740b59f0c4e81c42f62 /tools/stats.php | |
| parent | 2ac451ecb7aaae1ed1402425b8df6a5cb9831f2b (diff) | |
| parent | d20149b57929c27da87a7d9603d85717da15c5bc (diff) | |
Merge remote-tracking branch 'upstream/master' into vichan-merge
Diffstat (limited to 'tools/stats.php')
| -rwxr-xr-x | tools/stats.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/stats.php b/tools/stats.php index 0f05d6a8..cec8d2ab 100755 --- a/tools/stats.php +++ b/tools/stats.php @@ -2,11 +2,12 @@ <?php require dirname(__FILE__) . '/inc/cli.php'; -$variants = [["hour", 3600], ["day", 3600*24], ["3 days", 3600*24*3], - ["week", 3600*24*7], ["month", 3600*24*7*30]]; +$variants = array(array("hour", 3600), array("day", 3600*24), array("3 days", 3600*24*3), + array("week", 3600*24*7), array("month", 3600*24*7*30)); printf(" || "); -foreach ($variants as list($term, $time)) { +foreach ($variants as $iter) { + list($term, $time) = $iter; printf("%8s | ", $term); } print("\n"); @@ -17,7 +18,8 @@ print("\n"); $q = query("SELECT uri FROM ``boards``"); while ($f = $q->fetch()) { printf("%10s || ", $f['uri']); - foreach ($variants as list($term, $time)) { + foreach ($variants as $iter) { + list($term, $time) = $iter; $qq = query(sprintf("SELECT COUNT(*) as count FROM ``posts_%s`` WHERE time > %d", $f['uri'], time()-$time)); $c = $qq->fetch()['count']; |
