Browse Source

Add foreign boards option to config

- this will append links to other websites at the end of the board list
- added getchan.net's /GET/ and /ref/
pull/40/head
towards-a-new-leftypol 3 years ago
parent
commit
92bbc50e78
  1. 20
      inc/display.php
  2. 5
      inc/instance-config.php

20
inc/display.php

@ -50,6 +50,7 @@ function doBoardListPart($list, $root, &$boards) {
}
}
}
$body = preg_replace('/\/$/', '', $body);
return $body;
@ -68,6 +69,25 @@ function createBoardlist($mod=false) {
$body = doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards);
if (isset($config['foreign_boards'])) {
$body .= ' <span class="sub">[';
// Append links to foreign boards
$i = 0;
foreach ($config['foreign_boards'] as $fboardname => $fboardurl) {
$i++;
$body .= ' <a href="' . $fboardurl . '">' . $fboardname . '</a>';
// only put slash in between elements
if ($i != count($config['foreign_boards'])) {
$body .= ' /';
}
}
$body .= ']</span> ';
}
if ($config['boardlist_wrap_bracket'] && !preg_match('/\] $/', $body))
$body = '[' . $body . ']';

5
inc/instance-config.php

@ -23,6 +23,10 @@
) ,
array('meta')
);
$config['foreign_boards'] = array(
'GET' => 'https://getchan.net/GET/',
'ref' => 'https://getchan.net/ref/'
);
// Board categories. Only used in the "Categories" theme.
$config['categories'] = array(
'Leftypol' => array('leftypol',
@ -35,6 +39,7 @@
),
'Meta' => array('meta')
);
// Optional for the Categories theme. This is an array of name => (title, url) groups for categories
// with non-board links.
$config['custom_categories'] = array(

Loading…
Cancel
Save