forked from leftypol/leftypol
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/
This commit is contained in:
parent
254ca6e2c1
commit
85e5fa2a04
2 changed files with 69 additions and 44 deletions
|
@ -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 . ']';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue