3 * Statistics, FAQ & TOS
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
12 $page->title
= 'The other stuff';
15 /* FIXME: Make these first 3 work for user timezone, not just for UTC */
17 'today' => mktime(0, 0, 0),
18 'week' => mktime(0, 0, 0) - 86400 * (gmdate('w')-1),
19 'month' => mktime(0, 0, 0, gmdate('m'), 1),
20 '24h' => (time()-86400),
21 '7d' => (time()-86400*7),
22 '30d' => (time()-86400*30)
30 foreach ($date as $num) {
31 $return .= '<td>'.$DB->query(sprintf($sql, $num))->fetch_object()->result
.'</td> ';
38 <table id
="board_stats" style
="empty-cells: hide">
39 <caption
>Stats
</caption
>
41 <colgroup title
="Row headers">
44 <colgroup title
="Fuzzy statistics">
47 <colgroup title
="Raw statistics">
48 <col
/><col
/><col
/><col
/>
54 <th title
="Since 00:00 UTC">Today
</th
>
55 <th title
="Since 00:00 UTC this Monday">This week
</th
>
56 <th title
="Since 00:00 UTC on the 1st">This month
</th
>
57 <th
>Last
24 hours
</th
>
69 '<tr class="content c',(++
$a&1),'">
70 <th scope="row">Posts</th>
71 ',getrow('SELECT COUNT(*) AS `result` FROM `messages` WHERE `mtime` > %d'),'
72 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `messages`')->fetch_object()->result
,'</td>
75 <tr class="content c',(++
$a&1),'">
76 <th scope="row">Replies only</th>
77 ',getrow('SELECT COUNT(*) AS `result` FROM `messages` WHERE `replyto` IS NOT NULL AND `mtime` > %d'),'
78 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `messages`
79 WHERE `replyto` IS NOT NULL')->fetch_object()->result
,'</td>
82 <tr class="content c',(++
$a&1),'">
83 <th scope="row">Topics</th>
84 ',getrow('SELECT COUNT(DISTINCT(`topicid`)) AS `result` FROM `messages` WHERE `mtime` > %d'),'
85 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `topics`')->fetch_object()->result
,'</td>
88 <tr class="content c',(++
$a&1),'">
89 <th scope="row">Total users</th>
90 ',getrow('SELECT COUNT(*) AS `result` FROM `users` WHERE `register_date` > %d'),'
91 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `users`')->fetch_object()->result
,'</td>
94 <tr class="content c',(++
$a&1),'">
95 <th scope="row">Online users</th>
96 ',getrow('SELECT COUNT(`userid`) AS `result` FROM `users`
97 WHERE `last_active_date` > `register_date` AND `last_active_date` > %d'),'
98 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `users`
99 WHERE `last_active_date` > `register_date`')->fetch_object()->result
,'</td>
102 <tr class="content c',(++
$a&1),'">
103 <th scope="row">Active users</th>
104 ',getrow('SELECT COUNT(DISTINCT(`users`.`userid`)) AS `result` FROM `users`
105 NATURAL LEFT JOIN `messages` WHERE `messages`.`mtime` > %d'),'
106 <td>',$DB->query('SELECT COUNT(DISTINCT(`users`.`userid`)) AS `result`
107 FROM `users` NATURAL LEFT JOIN `messages`')->fetch_object()->result ?
></td
>
114 <li
>Inactive accounts get deleted
.</li
>
115 <li
>Inviting idiots will result in a verbal warning
and those accounts being deleted without refund
.
116 Persisting will get your own account deleted
.</li
>