6 usleep(100000); //DoS protection
8 $page->title
= _('Stats and Stuff');
15 'today' => mktime(0, 0, 0),
16 'week' => mktime(0, 0, 0) - 86400*(gmdate('w')-1),
17 'month' => mktime(0, 0, 0, gmdate('m'), 1),
18 '24h' => (time() - 86400),
19 '7d' => (time() - 86400*7),
20 '30d' => (time() - 86400*30)
23 function getrow($sql) { //getlost
26 foreach ($date as $num)
27 $return .= '<td>'.$DB->query(sprintf($sql, $num))->fetch_object()->result
.'</td> ';
32 echo '<!--I am insane-->
33 <table id="board_stats" style="empty-cells: hide">
34 <caption>',_('Board Statistics'),'</caption>
36 <colgroup title="',_('Row headers'),'">
37 <col title="',_('Type of data'),'"/>
39 <colgroup title="',_('Fuzzy statistics'),'">
42 <colgroup title="',_('Raw statistics'),'">
43 <col/><col/><col/><col/>
49 <th scope="col">',_('Today'),'</th>
50 <th scope="col">',_('This week'),'</th>
51 <th scope="col">',_('This month'),'</th>
52 <th scope="col">',_('Last 24 hours'),'</th>
53 <th scope="col">',_('Last 7 days'),'</th>
54 <th scope="col">',_('Last 30 days'),'</th>
55 <th scope="col">',_('Total'),'</th>
61 <tr class="content c',(++
$a&1),'">
62 <th scope="row" title="',_('Count of all messages'),'">',_('Posts'),'</th>
63 ',getrow('SELECT COUNT(*) AS `result` FROM `messages` WHERE `m_time` > %d'),'
64 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `messages`')->fetch_object()->result
,'</td>
67 <tr class="content c',(++
$a&1),'">
68 <th scope="row" title="',_('Any post in direct reply to someone else\'s'),'">',_('Replies'),'</th>
69 ',getrow('SELECT COUNT(*) AS `result` FROM `messages` WHERE `m_replyto` IS NOT NULL AND `m_time` > %d'),'
70 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `messages` WHERE `m_replyto` IS NOT NULL')->fetch_object()->result
,'</td>
73 <tr class="content c',(++
$a&1),'">
74 <th scope="row" title="',_('Count of all topics'),'">',_('Topics'),'</th>
75 ',getrow('SELECT COUNT(DISTINCT(`m_topic`)) AS `result` FROM `messages` WHERE `m_time` > %d'),'
76 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `topics`')->fetch_object()->result
,'</td>
79 <tr class="content c',(++
$a&1),'">
80 <th scope="row" title="',_('Number of new users in a time period'),'">',_('Users'),'</th>
81 ',getrow('SELECT COUNT(*) AS `result` FROM `users` WHERE `u_firstactive` > %d'),'
82 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `users`')->fetch_object()->result
,'</td>
85 <tr class="content c',(++
$a&1),'">
86 <th scope="row" title="',_('Users who\'ve logged in at some point after they registered'),'">',_('Online Users'),'</th>
87 ',getrow('SELECT COUNT(`userid`) AS `result` FROM `users` WHERE `u_lastactive` > `u_firstactive` AND `u_lastactive` > %d'),'
88 <td>',$DB->query('SELECT COUNT(*) AS `result` FROM `users` WHERE `u_lastactive` > `u_firstactive`')->fetch_object()->result
,'</td>
91 <tr class="content c',(++
$a&1),'">
92 <th scope="row" title="',_('Users who\'ve posted at least once'),'">',_('Active Users'),'</th>
93 ',getrow('SELECT COUNT(DISTINCT(`userid`)) AS `result` FROM `users`, `messages`
94 WHERE `messages`.`m_poster` = `users`.`userid` AND `messages`.`m_time` > %d'),'
95 <td>',$DB->query('SELECT COUNT(DISTINCT(`userid`)) AS `result` FROM `users`, `messages`
96 WHERE `messages`.`m_poster` = `users`.`userid`')->fetch_object()->result
,'</td>
104 <h3
>Terms of Service
</h3
>
106 <li
>Don
't be a fucking idiot.</li>