Browse Source

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

pull/40/head
nonmakina 3 years ago
parent
commit
ab4b6592b5
  1. 21
      inc/display.php
  2. 5
      inc/instance-config.php

21
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 .= ' <span class="sub">[';
// 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);
$body .= doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards);
if (isset($config['foreign_boards'])) {

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

Loading…
Cancel
Save