|
|
@ -56,28 +56,20 @@ function doBoardListPart($list, $root, &$boards) { |
|
|
|
return $body; |
|
|
|
} |
|
|
|
|
|
|
|
function createBoardlist($mod=false) { |
|
|
|
global $config; |
|
|
|
|
|
|
|
if (!isset($config['boards'])) return array('top'=>'','bottom'=>''); |
|
|
|
|
|
|
|
$xboards = listBoards(); |
|
|
|
$boards = array(); |
|
|
|
foreach ($xboards as $val) { |
|
|
|
$boards[$val['uri']] = $val['title']; |
|
|
|
} |
|
|
|
function createForeignBoardListSection($configKey){ |
|
|
|
$body = ''; |
|
|
|
if (isset($config['prepended_foreign_boards'])){ |
|
|
|
|
|
|
|
if (isset($config[$configKey])){ |
|
|
|
$body .= ' <span class="sub">['; |
|
|
|
|
|
|
|
// Append links to foreign boards |
|
|
|
$i = 0; |
|
|
|
foreach ($config['prepended_foreign_boards'] as $fboardname => $fboardurl) { |
|
|
|
foreach ($config[$configKey] as $fboardname => $fboardurl) { |
|
|
|
$i++; |
|
|
|
$body .= ' <a href="' . $fboardurl . '">' . $fboardname . '</a>'; |
|
|
|
|
|
|
|
// only put slash in between elements |
|
|
|
if ($i != count($config['prepended_foreign_boards'])) { |
|
|
|
if ($i != count($configKey)) { |
|
|
|
$body .= ' /'; |
|
|
|
} |
|
|
|
} |
|
|
@ -85,27 +77,25 @@ function createBoardlist($mod=false) { |
|
|
|
$body .= ']</span> '; |
|
|
|
} |
|
|
|
|
|
|
|
return body; |
|
|
|
} |
|
|
|
|
|
|
|
$body .= doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards); |
|
|
|
|
|
|
|
if (isset($config['foreign_boards'])) { |
|
|
|
|
|
|
|
$body .= ' <span class="sub">['; |
|
|
|
function createBoardlist($mod=false) { |
|
|
|
global $config; |
|
|
|
|
|
|
|
// Append links to foreign boards |
|
|
|
$i = 0; |
|
|
|
foreach ($config['foreign_boards'] as $fboardname => $fboardurl) { |
|
|
|
$i++; |
|
|
|
$body .= ' <a href="' . $fboardurl . '">' . $fboardname . '</a>'; |
|
|
|
if (!isset($config['boards'])) return array('top'=>'','bottom'=>''); |
|
|
|
|
|
|
|
// only put slash in between elements |
|
|
|
if ($i != count($config['foreign_boards'])) { |
|
|
|
$body .= ' /'; |
|
|
|
} |
|
|
|
$xboards = listBoards(); |
|
|
|
$boards = array(); |
|
|
|
foreach ($xboards as $val) { |
|
|
|
$boards[$val['uri']] = $val['title']; |
|
|
|
} |
|
|
|
$body = ''; |
|
|
|
$body .= createForeignBoardListSection('prepended_foreign_boards'); |
|
|
|
|
|
|
|
$body .= ']</span> '; |
|
|
|
} |
|
|
|
|
|
|
|
$body .= doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards); |
|
|
|
$body .= createForeignBoardListSection('foreign_boards'); |
|
|
|
|
|
|
|
if ($config['boardlist_wrap_bracket'] && !preg_match('/\] $/', $body)) |
|
|
|
$body = '[' . $body . ']'; |
|
|
|