diff options
| author | Simon McFarlane <simon@piston.pw> | 2015-06-01 16:08:19 -0700 |
|---|---|---|
| committer | Simon McFarlane <simon@piston.pw> | 2015-06-01 16:08:19 -0700 |
| commit | 209bc5400144e448e95a68e01d842c6fab53ae71 (patch) | |
| tree | ab4cc6ad241e8daccb546514330d3a5f2906e846 /tools/stats.php | |
| parent | d1c1e5a589f30d640f5eb6303e7059105a6297f8 (diff) | |
| parent | 7ab9cc43d101ed002bce392beefe1c435ab2d5b1 (diff) | |
Merge pull request #18 from lainchan/vichan-merge
Merge with the latest upstream vichan
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']; |
