Browse Source

boardlist work part 1: boardname in subtitle; work to make js restyling feasible

pull/40/head
czaks 9 years ago
parent
commit
946c49ac5a
  1. 26
      inc/display.php

26
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 . ']';

Loading…
Cancel
Save