forked from leftypol/leftypol
commit
0bdbe0f927
5 changed files with 107 additions and 30 deletions
|
@ -56,6 +56,31 @@ function doBoardListPart($list, $root, &$boards) {
|
|||
return $body;
|
||||
}
|
||||
|
||||
function createForeignBoardListSection($configKey){
|
||||
global $config;
|
||||
$body = '';
|
||||
|
||||
if (isset($config[$configKey])){
|
||||
$body .= ' <span class="sub">[';
|
||||
|
||||
// Append links to foreign boards
|
||||
$i = 0;
|
||||
foreach ($config[$configKey] as $fboardname => $fboardurl) {
|
||||
$i++;
|
||||
$body .= ' <a href="' . $fboardurl . '">' . $fboardname . '</a>';
|
||||
|
||||
// only put slash in between elements
|
||||
if ($i != count($config[$configKey])) {
|
||||
$body .= ' /';
|
||||
}
|
||||
}
|
||||
|
||||
$body .= ']</span> ';
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
function createBoardlist($mod=false) {
|
||||
global $config;
|
||||
|
||||
|
@ -66,27 +91,10 @@ function createBoardlist($mod=false) {
|
|||
foreach ($xboards as $val) {
|
||||
$boards[$val['uri']] = $val['title'];
|
||||
}
|
||||
|
||||
$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> ';
|
||||
}
|
||||
$body = '';
|
||||
$body .= createForeignBoardListSection('prepended_foreign_boards');
|
||||
$body .= doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards);
|
||||
$body .= createForeignBoardListSection('foreign_boards');
|
||||
|
||||
if ($config['boardlist_wrap_bracket'] && !preg_match('/\] $/', $body))
|
||||
$body = '[' . $body . ']';
|
||||
|
|
|
@ -23,6 +23,11 @@ $config['boards'] = array(
|
|||
) ,
|
||||
array('meta')
|
||||
);
|
||||
|
||||
$config['prepended_foreign_boards'] = array(
|
||||
'overboard' => '/overboard/',
|
||||
);
|
||||
|
||||
$config['foreign_boards'] = array(
|
||||
'GET' => 'https://getchan.net/GET/',
|
||||
'ref' => 'https://getchan.net/ref/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue