'overboard', 'title' => 'Overboard']; $board_list[] = ['uri' => 'sfw', 'title' => 'SFW Overboard']; $board_list[] = ['uri' => 'alt', 'title' => 'Alternate Overboard']; /** * Allowed fields for the board object: * - code: The board code ('b', 'tech', ...) * - name: The board user-readable name ('Siberia', ...) * - description: The board description ('Leftist Politically Incorrect', ...) * - sfw: Is this board sfw? * - alternate_spoilers: Does this board use the alunya spoiler? */ $boards = []; foreach ($board_list as $board) { // Skip archives if (endsWith($board['uri'], '_archive')) { continue; } $boards[] = [ 'code' => $board['uri'], 'name' => $board['title'], 'sfw' => !in_array($board['uri'], $nsfw_boards), 'alternate_spoilers' => in_array($board['uri'], $alunya_spoiler), 'posting_enabled' => !in_array($board['uri'], $readonly_boards), ]; } header('Content-Type: application/json'); echo json_encode([ 'captcha' => $config['securimage'], 'flags' => $config['user_flags'], 'boards' => $boards, ]);