SO 1-final
[specialops1.git] / modresources.php
blobe952fa9111d2f6a9cc0dce550ecd82f60534ab91
1 <?php
2 require 'config.php';
3 $require_login = true;
4 $page_name = 'Moderator Resources';
5 $level_restriction = MOD;
6 if ( isset($_GET['phpinfo']) && $userinfo['level'] >= ADMIN ) {
7 phpinfo();
8 exit;
10 require 'top.inc.php';
12 list($total_marks) = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `marks` WHERE `actioned` IS NULL'));
14 echo '<h2>Links</h2>
15 <ul class=',colour(),'>
16 <li><a href="markqueue',URL_STRING,'">Message Queue: ',$total_marks,'</a></li>
17 <li><a href="sendsysnote',URL_STRING,'">Send sysnotes</a></li>
18 <li><a href="userdir',URL_STRING,'">User Directory</a></li>
19 <li>IP address info:
20 <form action="ipinfo',URL_STRING,'" method="get" style="display: inline"><input type="text" name="ip"/></form></li>
21 </ul>
23 <h2>Moderator Activity</h2>
24 <table>
25 <thead>
26 <tr>
27 <th rowspan="2" scope="col">Moderator</th>
28 <th rowspan="2" scope="col">Marks Handled</th>
29 <th colspan="2">Suggestions Handled</th>
30 </tr>
31 <tr>
32 <th scope="col">Positive</th>
33 <th scope="col">Negative</th>
34 </tr>
35 </thead>
36 <tbody>
39 $tmp = mysql_query('SELECT `user` FROM `users` WHERE `level` >= '.MOD);
40 while ( list($m) = mysql_fetch_row($tmp) ) {
41 list($na_marks) = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `marks` WHERE `action` = 0 AND `moderator` = '.$m));
42 list($p_marks) = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `marks` WHERE `action` > 0 AND `moderator` = '.$m));
43 list($n_marks) = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `marks` WHERE `action` < 0 AND `moderator` = '.$m));
44 echo '<tr class=',colour(),'><td>',userlink($m),'</td><td>',$na_marks,'</td><td>',$p_marks,'</td><td>',$n_marks,"</td></tr>\n";
46 echo "</tbody>\n</table>\n";
48 if ( $userinfo['level'] < ADMIN )
49 stop();
51 if ( isset($_GET['purge']) ) {
52 define('FORCE_PURGE', true);
53 include 'thepurge.php';
54 echo '<div class="alert">Purge ran.</div>'."\n";
57 if ( isset($_GET['activate']) ) {
58 $tmp = mysql_query('SELECT `user` FROM `users` WHERE `level` = '.INACTIVE_USER);
59 while (list($u) = mysql_fetch_row($tmp))
60 if ( mysql_result(mysql_query('SELECT COUNT(*) FROM `messages` WHERE `user` = '.$u), 0) )
61 mysql_query('UPDATE `users` SET `level` = '.NEW_USER.' WHERE `user` = '.$u);
62 echo '<div class="alert">Users updated.</div>',"\n";
65 echo '<h2>Admin Resources</h2>
67 <h3>Editor stuff</h3>
68 <ul class="c1">
69 <li><a href="editboard',URL_STRING,'">Board Editor</a></li>
70 ',( $userinfo['level'] == ADMIN2 ? '<li><a href="editlevels'.URL_STRING.'">Level Editor</a></li>' : '' ),'
71 <li><a href="editthemes',URL_STRING,'">Themes Editor</a></li>
72 <li><a href="editpoll',URL_STRING,'">Poll Editor</a></li>
73 </ul>
75 <h3>Inactive, suspended and banned users</h3>';
77 $list_criteria = '`level` <= '.INACTIVE_USER;
78 require 'users.inc.php';
80 echo '<h3>Other</h3>
81 <ul class="c1">
82 <li><a href="',$_SERVER['PHP_SELF'],'?purge=1',URL_APPEND,'">Manual Purge</a></li>
83 <li><a href="',$_SERVER['PHP_SELF'],'?activate=1',URL_APPEND,'">Activate all inactive users</a></li>
84 ',( $userinfo['level'] == ADMIN2 ? '<li><a href="'.$_SERVER['PHP_SELF'].'?phpinfo=1">phpinfo()</a></li>' : '' ),'
85 <li>Image check: ',$cfg['img'][0],$cfg['img'][1],$cfg['img'][2],$cfg['img'][3],'</li>
86 </ul>';
88 footer();