SO 1-final
[specialops1.git] / stuff.php
blobbe2fcca76a4c87951b6143bbb404260c75a77365
1 <?php
2 $page_name = 'Miscellaneous stuff';
3 require 'config.php';
4 define('CSS_INC', 'stuff');
5 require 'top.inc.php';
7 $stats = array(
8 mysql_fetch_row(mysql_query('SELECT COUNT(*), COUNT(DISTINCT `topic`), COUNT(DISTINCT `user`) FROM `messages`')),
9 mysql_fetch_row(mysql_query('SELECT COUNT(*), COUNT(DISTINCT `topic`), COUNT(DISTINCT `user`) FROM `messages`
10 WHERE `time` >= '.gmdate('YmdHis', time()-86400*30))),
11 mysql_fetch_row(mysql_query('SELECT COUNT(*), COUNT(DISTINCT `topic`), COUNT(DISTINCT `user`) FROM `messages`
12 WHERE `time` >= '.gmdate('YmdHis', time()-86400*7))),
13 mysql_fetch_row(mysql_query('SELECT COUNT(*), COUNT(DISTINCT `topic`), COUNT(DISTINCT `user`) FROM `messages`
14 WHERE `time` >= '.gmdate('YmdHis', time()-86400)))
16 $user_stats = mysql_fetch_row(mysql_query('SELECT SUM(`cookies`), SUM(`points`), COUNT(*) FROM `users`'));
18 echo '<h2>Contents</h2>
19 <ol class="c1">
20 <li><a href="#stats">Message Board Statistics</a></li>
21 <li><a href="#other">Other Stats</a></li>
22 <li><a href="#TOS">TOS</a></li>
23 <li><a href="#stuff">FAQ</a></li>
24 <li><a href="#info">More Info</a></li>
25 <li><a href="#credits">Credits</a></li>
26 <li><a href="docs/">Documentation &rarr;</a></li>
27 </ol>
29 <h2 id="stats">Message Board Statistics</h2>
30 <table>
31 <thead>
32 <tr>
33 <td/>
34 <th scope="col">Total</th>
35 <th scope="col">Last 30 days</th>
36 <th scope="col">Last 7 days</th>
37 <th scope="col">Last 24 hours</th>
38 </tr>
39 </thead>
40 <tbody>
41 <tr class=',colour(),'>
42 <th scope="row">Topics</td>
43 <td>',$stats[0][1],'</td>
44 <td>',$stats[1][1],'</td>
45 <td>',$stats[2][1],'</td>
46 <td>',$stats[3][1],'</td>
47 </tr>
48 <tr class=',colour(),'>
49 <th scope="row">Messages</td>
50 <td>',$stats[0][0],'</td>
51 <td>',$stats[1][0],'</td>
52 <td>',$stats[2][0],'</td>
53 <td>',$stats[3][0],'</td>
54 </tr>
55 <tr class=',colour(),'>
56 <th scope="row">Users</td>
57 <td>',$user_stats[2],'</td>
58 <td>',mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `register_date` >= '.gmdate('YmdHis', time()-86400*30)), 0),'</td>
59 <td>',mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `register_date` >= '.gmdate('YmdHis', time()-86400*7)), 0),'</td>
60 <td>',mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `register_date` >= '.gmdate('YmdHis', time()-86400)), 0),'</td>
61 </tr>
62 <tr class=',colour(),'>
63 <th scope="row">Active Users</td>
64 <td>',$stats[0][2],'</td>
65 <td>',$stats[1][2],'</td>
66 <td>',$stats[2][2],'</td>
67 <td>',$stats[3][2],'</td>
68 </tr>
69 <tr class=',colour(),'>
70 <th scope="row">Lurkers</td>
71 <td>',($user_stats[2] - $stats[0][2]),'</td>
72 <td>',mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `last_active` >= '.gmdate('YmdHis', time()-86400*30)), 0),'</td>
73 <td>',mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `last_active` >= '.gmdate('YmdHis', time()-86400*7)), 0),'</td>
74 <td>',mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `last_active` >= '.gmdate('YmdHis', time()-86400)), 0),'</td>
75 </tr>
76 <tr class=',colour(),'>
77 <th scope="row">Posts per user</td>
78 <td>',($stats[0][2] > 0 ? round($stats[0][0] / $stats[0][2], 2) : 0),'</td>
79 <td>',($stats[1][2] > 0 ? round($stats[1][0] / $stats[1][2], 2) : 0),'</td>
80 <td>',($stats[2][2] > 0 ? round($stats[2][0] / $stats[2][2], 2) : 0),'</td>
81 <td>',($stats[3][2] > 0 ? round($stats[3][0] / $stats[3][2], 2) : 0),'</td>
82 </tr>
83 <tr class=',colour(),'>
84 <th scope="row">Posts per topic</td>
85 <td>',($stats[0][1] > 0 ? round($stats[0][0] / $stats[0][1], 2) : 0),'</td>
86 <td>',($stats[1][1] > 0 ? round($stats[1][0] / $stats[1][1], 2) : 0),'</td>
87 <td>',($stats[2][1] > 0 ? round($stats[2][0] / $stats[2][1], 2) : 0),'</td>
88 <td>',($stats[3][1] > 0 ? round($stats[3][0] / $stats[3][1], 2) : 0),'</td>
89 </tr>
90 </tbody>
91 </table>
93 <h2 id="other">Other Stats</h2>
94 <div class="c1">
95 <h3>General</h3>
96 <ul class="plain-list">
97 <li>Total ',$strings['cookies'],': ',$user_stats[0],'</li>
98 <li>Total ',$strings['points'],': ',$user_stats[1],'</li>
99 </ul>
101 <h3>Browser Usage</h3>
102 <ul class="plain-list">
103 <li><a href="http://mozilla.org/">Gecko</a>: ',
104 ($browser1 = mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `useragent` LIKE \'%Gecko%\''), 0)),'</li>
105 <li><a href="http://kde.org/">KHTML</a>: ',
106 ($browser2 = mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `useragent` LIKE \'%KHTML%\''), 0)),'</li>
107 <li>Other: ',($user_stats[2] - $browser1 - $browser2),'</li>
108 </ul>
110 <h3>Server info</h3>
111 <ul class="plain-list">
112 <li>PHP Version: ',PHP_VERSION,'</li>
113 <li>MySQL Version: ',mysql_get_server_info(),'</li>
114 </ul>
115 </div>';
118 <h2 id="TOS">Terms of Service</h2>
119 <p>Don't be a fucking idiot.</p>
121 <h2 id="stuff">Stuff</h2>
122 <dl>
123 <dt>What's <?php echo $strings['cookies'] ?>?</dt>
124 <dd><?php echo $strings['cookies'] ?> is awarded by moderators for intelligent, funny, or otherwise good posts.
125 When you reach a certain amount you go up a level. Higher levels have more privileges and can access more boards.</dd>
126 <dt>What's <?php echo $strings['points'] ?>?</dt>
127 <dd><?php echo $strings['points'] ?> is a measure of user activity. It ranges from -20 to 50. You get one for each post you make, and when you reach the
128 upper limit you get an extra <?php echo $strings['cookies'] ?> and your <?php echo $strings['points'] ?> count is reset to 0. You lose 1 when the purge is
129 run if you log in on that day.</dd>
130 <dt>What HTML works in posts?</dt>
131 <dd>Just check the post page. There are several HTML options there and all allowed tags are shown underneath.</dd>
132 <dt>Why can I see the mod board on the board list when I'm not level [whatever]?</dt>
133 <dd>All boards are visible, you just can't go to the ones you're not allowed on. There's no point hiding them since they barely fill one screen anyway.</dd>
134 <dt>It looks like garbage.</dt>
135 <dd>Why aren't you doing anything to fix it instead of bitching about it?</dd>
136 <dt>How do I make a spinoff board?</dt>
137 <dd>If you have to ask that question, you are unfit to run anything above proboards.</dd>
138 <dt>I found a fatal exploit, where do I report it?</dt>
139 <dd>Either email me, IM me or IM someone on my closed list about it.</dd>
140 <dt>What the fuck why isn't strikethrough working</dt>
141 <dd>Short answer: You don't know how to use it. Long answer: http://goatse.ca/</dd>
142 <dt>Where do you want to go today?</dt>
143 <dd>Hell.</dd>
144 <!--[if IE]>
145 <dt>Teh boards are broked in mi internat EXPLORAR fizx thm!!1</dt>
146 <dd>No. Fuck you, commie bastard.</dd>
147 <!-[end if]-->
148 </dl>
150 <h2 id="info">Misc Info</h2>
151 <div class="c1">
152 <h3>Purge</h3>
153 <p>The purge is run nightly at 00:00 UTC. All user levels are updated at this time.
154 Unused accounts with no posts get purged on a nightly basis. The current schedule is as follows:</p>
155 <ul>
156 <li>Unconfirmed accounts (not email activated or not posted on unconfirmed board): 48 hours after last login</li>
157 <li>Banned accounts (level -2 and below): 5 months after last login</li>
158 <li>Suspended accounts: 3 months after last login</li>
159 <li>Other accounts: 1 year after last login</li>
160 </ul>
162 <h3>User Levels</h3>
163 <div style="max-width:40%; float:left">
164 <p>The current userlevels in use are shown on the right. As you earn a higher userlevel you gain more privileges.
165 Users of level <?php echo REG_USER ?> and above can use italic topic titles.
166 Users at level <?php echo VIP_USER ?> and above can use all HTML in posts.
167 A higher userlevel also gives you access to more boards; see the table below for minimum level requirements:</p>
169 <table>
170 <caption>Board Levels List</caption>
171 <tr><th>Board</th><th>Userlevel</th></tr>
172 <?php
173 $tmp = mysql_unbuffered_query('SELECT `board`, `name`, `view_level` FROM `boards` ORDER BY `view_level` ASC');
174 while ( $b = mysql_fetch_row($tmp) )
175 echo '<tr class=',colour(),'><td><a href="viewboard?b=',$b[0],'">',$b[1],'</a></td><td>',$b[2],"</td></tr>\n";
177 </table>
178 </div>
180 <table style="width:55%; margin:1em">
181 <caption>User Levels List</caption>
182 <tr><th>Level</th><th>Name</th><th>Users</th></tr>
183 <?php
184 include 'include/levels.php';
186 foreach ( array_keys($cfg['levels']) as $level ) {
187 echo '<tr class=',colour(),'><td>',$level,'</td><td>',$cfg['leveldesc'][$level],'</td>',
188 '<td>',mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `level` = '.$level), 0),"</td></tr>\n";
191 </table>
192 </div>
194 <h2 id="credits">Credits</h2>
195 <ul class="c1 plain-list">
196 <li>NeoGenesis - for making this shitty code.</li>
197 <li>Aqua/XPinion - hosted SO1 while I didn't have my own server.</li>
198 <li>Jay - thanks for nothing, asshole</li>
199 </ul>
200 <?php footer() ?>