From ab4b6592b5376dfcc887abfae7dead6c75e5fd73 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Sat, 9 Jan 2021 17:01:44 -0600 Subject: [PATCH] Adds support to prepend foreign boards on the boardlist. Used to add the overboard. --- inc/display.php | 21 ++++++++++++++++++++- inc/instance-config.php | 5 +++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/inc/display.php b/inc/display.php index 0c846cf9..be0881fd 100644 --- a/inc/display.php +++ b/inc/display.php @@ -66,8 +66,27 @@ function createBoardlist($mod=false) { foreach ($xboards as $val) { $boards[$val['uri']] = $val['title']; } + $body = ''; + if (isset($config['prepended_foreign_boards'])){ + $body .= ' ['; + + // Append links to foreign boards + $i = 0; + foreach ($config['prepended_foreign_boards'] as $fboardname => $fboardurl) { + $i++; + $body .= ' ' . $fboardname . ''; + + // only put slash in between elements + if ($i != count($config['prepended_foreign_boards'])) { + $body .= ' /'; + } + } + + $body .= '] '; + } + - $body = doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards); + $body .= doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards); if (isset($config['foreign_boards'])) { diff --git a/inc/instance-config.php b/inc/instance-config.php index eca5bb01..f50b647e 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -23,6 +23,11 @@ $config['boards'] = array( ) , array('meta') ); + +$config['prepended_foreign_boards'] = array( + 'overboard' => 'overboard/index.html', +); + $config['foreign_boards'] = array( 'GET' => 'https://getchan.net/GET/', 'ref' => 'https://getchan.net/ref/'