diff options
| author | czaks <marcin@6irc.net> | 2014-09-24 03:43:14 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-09-24 03:43:23 +0200 |
| commit | fd9196f036c17a11bc793525a082d16a3e198f5a (patch) | |
| tree | 2a1500de76ab9d7741246b403624a3c0d52afb49 /tools | |
| parent | a25e5f7839fa68fe464bbb0d5fe112b9d13a3c76 (diff) | |
tools/stats.php: restore php 5.3 compatibility; fixes vichan-devel#85
Diffstat (limited to 'tools')
| -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']; |
