table_exists('dune_system_boards')) { $root=$db->fetch_array($db->simple_select('dune_system_boards','fid',"kind='system' AND organisation_id='root'")); $fid=(int)($root['fid'] ?? 0); if ($fid>0) $page=str_replace('','',$page); } if (($_GET['dune_embed'] ?? '') !== '1') return; $fid=(int)($_GET['fid'] ?? 0); $identity=$GLOBALS['dune_system_board_identity'] ?? []; $boards=dune_system_board_registry(); $parents=[]; $query=$db->simple_select('forums','fid,pid'); while($row=$db->fetch_array($query))$parents[(int)$row['fid']]=(int)$row['pid']; foreach($identity['systemBoards']['organisations'] ?? [] as $grant){ $board=$boards[($grant['kind'] ?? '').':'.($grant['id'] ?? '')] ?? null; if(!$board||($grant['manage'] ?? false)!==true||!dune_board_descendant($fid,(int)$board['fid'],$parents))continue; $href='/system-board-manage.php?kind='.rawurlencode($grant['kind']).'&organisation='.rawurlencode($grant['id']).'&dune_embed=1'; $page=preg_replace('/(]*>)/i','$1
Manage board ยท Add forum or category
',$page,1); } $style = ''; $script = <<<'JS' JS; $page = str_replace('', $style.'', $page); $page = str_replace('', $script.'', $page); }