3 * Statistics, FAQ & TOS
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
12 $page->title
= 'Stats and 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
>Board Statistics
</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
>
70 '<tr class="content c',(++
$a&1),'">
71 <th scope="row">Posts</th>
72 ',getrow('SELECT COUNT(*) AS `result` FROM `messages` WHERE `mtime` > %d'),'
73 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `messages`')->fetch_object()->result
,'</td>
76 <tr class="content c',(++
$a&1),'">
77 <th scope="row">Replies only</th>
78 ',getrow('SELECT COUNT(*) AS `result` FROM `messages` WHERE `replyto` IS NOT NULL AND `mtime` > %d'),'
79 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `messages`
80 WHERE `replyto` IS NOT NULL')->fetch_object()->result
,'</td>
83 <tr class="content c',(++
$a&1),'">
84 <th scope="row">Topics</th>
85 ',getrow('SELECT COUNT(DISTINCT(`topicid`)) AS `result` FROM `messages` WHERE `mtime` > %d'),'
86 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `topics`')->fetch_object()->result
,'</td>
89 <tr class="content c',(++
$a&1),'">
90 <th scope="row">Total users</th>
91 ',getrow('SELECT COUNT(*) AS `result` FROM `users` WHERE `register_date` > %d'),'
92 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `users`')->fetch_object()->result
,'</td>
95 <tr class="content c',(++
$a&1),'">
96 <th scope="row">Online users</th>
97 ',getrow('SELECT COUNT(`userid`) AS `result` FROM `users`
98 WHERE `last_active_date` > `register_date` AND `last_active_date` > %d'),'
99 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `users`
100 WHERE `last_active_date` > `register_date`')->fetch_object()->result
,'</td>
103 <tr class="content c',(++
$a&1),'">
104 <th scope="row">Active users</th>
105 ',getrow('SELECT COUNT(DISTINCT(`users`.`userid`)) AS `result` FROM `users`
106 NATURAL LEFT JOIN `messages` WHERE `messages`.`mtime` > %d'),'
107 <td>',$DB->query('SELECT COUNT(DISTINCT(`users`.`userid`)) AS `result`
108 FROM `users` NATURAL LEFT JOIN `messages`')->fetch_object()->result ?
></td
>
114 <h2
>Terms of Service
</h2
>
116 <li
>Don
't be a fucking idiot.</li>
117 <li>Don't invite them
.</li
>
118 <li
>This site is not affiliated with AOL
. Don
't behave like an AOLer here.</li>