$overboard) { $board_list[] = array( 'uri' => $uri, 'title' => $config['overboards'][$overboard]['title'] ); } /** * Allowed fields for the board object: * - code: The board code ('b', 'tech', ...) * - name: The board user-readable name ('Siberia', ...) * - sfw: Is this board sfw? * - posting_enabled: Can new posts be created belonging to this board? */ $boards = []; foreach ($board_list as $board) { // Skip non-whitelisted boards if (!in_array($board['uri'], $whitelist)) { continue; } $boards[] = [ 'code' => $board['uri'], 'name' => $board['title'], 'sfw' => !in_array($board['uri'], $nsfw_boards), 'posting_enabled' => !in_array($board['uri'], $readonly_boards), ]; } header('Content-Type: application/json'); echo json_encode([ 'captcha' => $config['captcha']['enabled'], 'recaptcha' => $config['recaptcha'], 'flags' => $config['user_flags'], 'boards' => $boards, ]);