From b742445f508a1a7a61ea2d27f2500dd0a5067873 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Wed, 13 Mar 2024 14:19:24 +0100 Subject: [PATCH] Add overboard index support. Yet another ugly hack --- inc/mod/pages.php | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 6b56b3d2..b4d3b544 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -786,34 +786,18 @@ function mod_view_board($boardName, $page_no = 1) { global $config, $mod; if (!openBoard($boardName)){ - if (in_array($boardName, array_keys($config['overboards']))){ - $type = $config['overboards'][$boardName]['type']; - require_once("templates/themes/$type/theme.php"); - global $mod; - - $overboard = new $type(); - $overboard->settings = array(); - $overboard->settings['uri'] = $boardName; - $overboard->settings['title'] = $config['overboards'][$boardName]['title']; - $overboard->settings['subtitle'] = $config['overboards'][$boardName]['subtitle']; - $overboard->settings['thread_limit'] = $config['overboards'][$boardName]['thread_limit']; - if (array_key_exists('exclude',$config['overboards'][$boardName])) { - $overboard->settings['exclude'] = $config['overboards'][$boardName]['exclude']; - } - if (array_key_exists('include',$config['overboards'][$boardName])) { - $overboard->settings['include'] = $config['overboards'][$boardName]['include']; + require "templates/themes/overboards/overboards.php"; + + foreach ($overboards_config as $settings) { + if ($settings['uri'] === $boardName) { + require "templates/themes/overboards/theme.php"; + + $overboard = new overboards($overboards_config); + echo $overboard->build($settings, true); + return; } - $overboard->settings['boards'] = listBoards(); - echo $overboard->build($mod); - return; - } - elseif (in_array($boardName,array_keys($config['boards_alias']))){ - $boardName = $config['boards_alias'][$boardName]; - openBoard($boardName); - } - else { - error($config['error']['noboard']); } + error($config['error']['404']); } if (!$page = index($page_no, $mod)) {