SO 1-final
[specialops1.git] / editboard.php
blobb5bbd3c6418aec71477fe22d9ed4a3746c7e8975
1 <?php
2 require 'config.php';
3 $require_login = true;
4 $page_name = 'Board Editor';
5 $level_restriction = ADMIN;
6 require 'top.inc.php';
8 require 'include/levels.php';
9 foreach ( array_keys($cfg['levels']) as $level ) {
10 list($name) = explode(': ', $cfg['leveldesc'][$level]);
11 $levels[$level] = $name;
14 function levlist($fieldname, $levelnum = INACTIVE_USER)
16 global $cfg, $levels;
18 $box = '<select name="'.$fieldname.'">';
19 foreach ( $levels as $a => $b )
20 $box .= '<option value="'.$a.( $levelnum == $a ? '" selected="selected' : '' ).'">'.$a.': '.$b."</option>\n";
21 return $box."</select>\n";
25 <?php
26 $tmp = mysql_query('SELECT * FROM `board-groups`');
27 while ( $g = mysql_fetch_assoc($tmp) ) {
29 echo '<h3>Group ID ',implode(': ', $g),'</h3>
30 <table><thead><tr><th>Board Name, ID, Caption</th><th>View Level</th><th>Post Level</th><th>Topic Level</th></tr></thead><tbody>';
32 $tmp = mysql_query('SELECT * FROM `boards` WHERE `group` = '.$g['group']);
33 while ( $b = mysql_fetch_assoc($tmp) ) {
34 echo '<tr class=',colour(),">\n",
35 ' <td>',$b['name'],' (',$b['board'],')<br/><small>',$b['caption'],"</small></td>\n",
36 ' <td>',$b['view_level'],'</td><td>',$b['post_level'],'</td><td>',$b['topic_level'],"</td>\n",
37 '</tr>';
40 echo '</tbody>
41 </table>';
45 footer();