</script> <?php $permlist = array(); $fpermlist = array(); echo ' <form action="" method="POST"> <table class="layout-table"> <tr><td style="width:50%;vertical-align:top;padding-right:0.5em;"> <table class="outline margin"> <tr class="header1"><th colspan="2">' . __('General permissions') . '</th></tr>'; $perms = Query("SELECT * FROM {permissions} WHERE applyto={0} AND id={1} AND perm!={2} AND arg=0 ORDER BY perm", $applyto, $id, 'forum.viewforum'); while ($perm = Fetch($perms)) { $permlist[$perm['perm']] = $perm['value']; } foreach ($permCats as $cat => $blarg) { PermTable($cat); } echo ' </table> </td><td style="vertical-align:top;padding-left:0.5em;"> <table class="outline margin"> <tr class="header1"><th colspan="2">' . __('Per-forum permissions') . '</th></tr>'; $fperms = Query("SELECT p.*, f.title ftitle FROM {permissions} p LEFT JOIN {forums} f ON f.id=p.arg\n\tWHERE p.applyto={0} AND p.id={1} AND (SUBSTR(p.perm,1,6)={2} OR SUBSTR(p.perm,1,4)={3}) AND p.arg!=0 ORDER BY p.arg, p.perm", $applyto, $id, 'forum.', 'mod.'); while ($fperm = Fetch($fperms)) { $fpermlist[$fperm['arg']][$fperm['perm']] = $fperm['value']; if (!$fpermlist[$fperm['arg']]['_ftitle']) { $fpermlist[$fperm['arg']]['_ftitle'] = $fperm['ftitle']; } } if (!empty($fpermlist)) { foreach ($fpermlist as $fid => $fpl) {
<table class="outline margin"> <tr> <td class="cell1 center"><input type="submit" name="saveaction" value="' . __('Save all changes') . '"></td> </tr> </table> <table style="width:100%;"><tr><td style="vertical-align:top;width:50%;padding-right:0.5em;"> <table class="outline margin"> <tr class="header1"><th colspan="2">' . __('General permissions') . '</th></tr>'; $perms = Query("SELECT * FROM {permissions} WHERE applyto=0 AND id={0} AND perm!={1} AND arg=0 ORDER BY perm", $gid, 'forum.viewforum'); while ($perm = Fetch($perms)) { $permlist[$perm['perm']] = $perm['value']; } PermTable('user'); PermTable('forum'); PermTable('mod'); PermTable('admin'); echo ' </table> </td><td style="vertical-align:top;padding-left:0.5em;"> <table class="outline margin"> <tr class="header1"><th colspan="2">' . __('Per-forum permissions') . '</th></tr>'; $fperms = Query("SELECT p.*, f.title ftitle FROM {permissions} p LEFT JOIN {forums} f ON f.id=p.arg\n\tWHERE p.applyto=0 AND p.id={0} AND (SUBSTR(p.perm,1,6)={1} OR SUBSTR(p.perm,1,4)={2}) AND p.arg!=0 ORDER BY p.arg, p.perm", $gid, 'forum.', 'mod.'); while ($fperm = Fetch($fperms)) { $fpermlist[$fperm['arg']][$fperm['perm']] = $fperm['value']; if (!$fpermlist[$fperm['arg']]['_ftitle']) { $fpermlist[$fperm['arg']]['_ftitle'] = $fperm['ftitle']; } } if (!empty($fpermlist)) { foreach ($fpermlist as $fid => $fpl) { ForumPermTable($fid, $fpl);