simple_select('forums','fid,pid'); while($row=$db->fetch_array($query))$parents[(int)$row['fid']]=(int)$row['pid']; $manage=''; 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'; $manage='Manage board'; } $page=preg_replace_callback('/
]*)>/i',function($match){$attributes=$match[1];if(str_contains($attributes,'class="'))$attributes=str_replace('class="','class="dune-board-embedded ',$attributes);else $attributes.=' class="dune-board-embedded"';return '';},$page,1); $path=parse_url($_SERVER['REQUEST_URI'] ?? '/index.php',PHP_URL_PATH);if(!in_array($path,['/forumdisplay.php','/showthread.php'],true))$path='/index.php'; $params=$_GET;unset($params['dune_embed']);$outside='https://forums.dunerealms.com'.$path.($params?'?'.http_build_query($params):''); $toolbar=''; if(!str_contains($page,'data-system-board-toolbar'))$page=preg_replace('/(]*>)/i','$1'.$toolbar,$page,1); $style = ''; $script = <<<'JS' JS; $page = str_replace('', $style.'', $page); $page = str_replace('', $script.'