Example #1
0
    echo $config['forumzahl'];
    ?>
)</span></td>
   <td class="mbox" width="50%"><input type="text" name="forumzahl" size="5" value="0" /></td> 
  </tr>
  <tr> 
   <td class="mbox" width="50%">Hide forum from users without authorization:<br /><span class="stext">Forum will not appear if it is locked and option is checked. This only affects forums without password.</span></td>
   <td class="mbox" width="50%"><input type="checkbox" name="invisible" value="1" /></td> 
  </tr>
  <tr> 
   <td class="mbox" width="50%">Copy permissions from:<br /><span class="stext">The forum will have the same permissions as the one you select here. If no forum is selected the default settings are used. <em>Caution: This is experimental! Use with care and report bugs, please.</em></span></td>
   <td class="mbox" width="50%">
	<select name="copypermissions">
   		<option value="0">Default</option>
   		<?php 
    AdminSelectForum($tree, $categories, $boards);
    ?>
   	</select>
   </td> 
  </tr>
  <tr> 
   <td class="mbox" width="50%">Sort in:</font></td>
   <td class="mbox" width="50%"><select name="sort">
   <option value="0">before existing forums</option>
   <option value="1" selected="selected">after existing forums</option>
   </select></td> 
  </tr>
  <tr> 
   <td class="ubox" width="100%" colspan="2" align="center"><input type="submit" name="Submit" value="Submit" /></td> 
  </tr>
 </table>
function AdminSelectForum($tree, $cat, $board, $char = '&nbsp;&nbsp;', $level = 0)
{
    foreach ($tree as $cid => $boards) {
        $cdata = $cat[$cid];
        ?>
		<option style="background-color: #000000; color: #ffffff;" value="c_<?php 
        echo $cdata['id'];
        ?>
">
		<?php 
        echo str_repeat($char, $level) . $cdata['name'];
        ?>
		</option>
		<?php 
        foreach ($boards as $bid => $sub) {
            $bdata = $board[$bid];
            if ($bdata['opt'] == 're') {
                continue;
            }
            ?>
			<option value="f_<?php 
            echo $bdata['id'];
            ?>
">
			<?php 
            echo str_repeat($char, $level + 1) . '+&nbsp;' . $bdata['name'];
            ?>
			</option>
	    	<?php 
            AdminSelectForum($sub, $cat, $board, $char, $level + 2);
        }
    }
}