diff options
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/inc/display.php b/inc/display.php index 9009be9a..d16b12aa 100644 --- a/inc/display.php +++ b/inc/display.php @@ -19,19 +19,23 @@ function format_bytes($size) { return round($size, 2).$units[$i]; } -function doBoardListPart($list, $root) { +function doBoardListPart($list, $root, &$boards) { global $config; $body = ''; - foreach ($list as $board) { + foreach ($list as $key => $board) { if (is_array($board)) - // $body .= ' [' . doBoardListPart($board, $root) . '] '; - $body .= ' <span class="sub">[' . doBoardListPart($board, $root) . ']</span> '; + $body .= ' <span class="sub" data-description="' . $key . '">[' . doBoardListPart($board, $root, $boards) . ']</span> '; else { - if (($key = array_search($board, $list)) && gettype($key) == 'string') { + if (gettype($key) == 'string') { $body .= ' <a href="' . $board . '">' . $key . '</a> /'; - } else { - $body .= ' <a href="' . $root . $board . '/' . $config['file_index'] . '">' . $board . '</a> /'; + } else { + $title = ''; + if (isset ($boards[$board])) { + $title = ' title="'.$boards[$board].'"'; + } + + $body .= ' <a href="' . $root . $board . '/' . $config['file_index'] . '"'.$title.'>' . $board . '</a> /'; } } } @@ -45,7 +49,13 @@ function createBoardlist($mod=false) { if (!isset($config['boards'])) return array('top'=>'','bottom'=>''); - $body = doBoardListPart($config['boards'], $mod?'?/':$config['root']); + $xboards = listBoards(); + $boards = array(); + foreach ($xboards as $val) { + $boards[$val['uri']] = $val['title']; + } + + $body = doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards); if ($config['boardlist_wrap_bracket'] && !preg_match('/\] $/', $body)) $body = '[' . $body . ']'; |
