Adds support to prepend foreign boards on the boardlist. Used to add the overboard.

This commit is contained in:
nonmakina 2021-01-09 17:01:44 -06:00
parent a037341613
commit ab4b6592b5
2 changed files with 25 additions and 1 deletions

View File

@ -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 .= ' <span class="sub">[';
$body = doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards);
// Append links to foreign boards
$i = 0;
foreach ($config['prepended_foreign_boards'] as $fboardname => $fboardurl) {
$i++;
$body .= ' <a href="' . $fboardurl . '">' . $fboardname . '</a>';
// only put slash in between elements
if ($i != count($config['prepended_foreign_boards'])) {
$body .= ' /';
}
}
$body .= ']</span> ';
}
$body .= doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards);
if (isset($config['foreign_boards'])) {

View File

@ -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/'