summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-17 22:41:40 -0400
committerczaks <marcin@6irc.net>2013-08-17 22:41:40 -0400
commit946c49ac5aa00a14cf6e8333e0802a719205ccfa (patch)
tree7ad08f74d2ef3b0a0fc30f0d00f40dab8e416e99 /inc/display.php
parent7aaeb1fdf3ea2d85a1f6a9022aa4334eb0e1221d (diff)
boardlist work part 1: boardname in subtitle; work to make js restyling feasible
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php26
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 . ']';