mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-24 07:30:10 +01:00
Added boardlinks
This commit is contained in:
parent
9443c0f234
commit
c5aa3fdcc1
@ -19,6 +19,32 @@
|
|||||||
return (intval($n) < 1000) ? $n : commaize(substr($n, 0, -3)) . ',' . substr($n, -3);
|
return (intval($n) < 1000) ? $n : commaize(substr($n, 0, -3)) . ',' . substr($n, -3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doBoardListPart($list, $root) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$body = '';
|
||||||
|
foreach($list as $board) {
|
||||||
|
if(is_array($board))
|
||||||
|
$body .= ' [' . doBoardListPart($board, $root) . '] ';
|
||||||
|
else {
|
||||||
|
$body .= ' <a href="' . $root . $board . '/' . $config['file_index'] . '">' . $board . '</a> /';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$body = preg_replace('/\/$/', '', $body);
|
||||||
|
|
||||||
|
return $body;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createBoardlist($mod=false) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
if(!isset($config['boards'])) return '';
|
||||||
|
|
||||||
|
$body = doBoardListPart($config['boards'], $mod?'?/':$config['root']);
|
||||||
|
|
||||||
|
return '<div class="boardlist">' . $body . '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
function error($message) {
|
function error($message) {
|
||||||
global $board, $mod, $config;
|
global $board, $mod, $config;
|
||||||
|
|
||||||
|
@ -476,7 +476,14 @@
|
|||||||
$body .= $thread->build(true);
|
$body .= $thread->build(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Array('button'=>$config['button_newtopic'], 'board'=>$board, 'body'=>$body, 'post_url' => $config['post_url'], 'index' => $config['root']);
|
return Array(
|
||||||
|
'button'=>$config['button_newtopic'],
|
||||||
|
'board'=>$board,
|
||||||
|
'body'=>$body,
|
||||||
|
'post_url' => $config['post_url'],
|
||||||
|
'index' => $config['root'],
|
||||||
|
'boardlist' => createBoardlist($mod)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPageButtons($pages, $mod=false) {
|
function getPageButtons($pages, $mod=false) {
|
||||||
@ -967,6 +974,7 @@
|
|||||||
'index' => $config['root'],
|
'index' => $config['root'],
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'mod' => $mod,
|
'mod' => $mod,
|
||||||
|
'boardlist' => createBoardlist($mod),
|
||||||
'hidden_inputs' => $content['hidden_inputs'] = createHiddenInputs(),
|
'hidden_inputs' => $content['hidden_inputs'] = createHiddenInputs(),
|
||||||
'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['uri'] . '/' . $config['file_index'])
|
'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['uri'] . '/' . $config['file_index'])
|
||||||
));
|
));
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<script type="text/javascript" src="{index}main.js"></script>
|
<script type="text/javascript" src="{index}main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
{boardlist}
|
||||||
<h1>{board[url]} - {board[name]}</h1>
|
<h1>{board[url]} - {board[name]}</h1>
|
||||||
<div class="title">{board[title]?{board[title]}}<p>{mod?<a href="?/">Return to dashboard</a>}</p></div>
|
<div class="title">{board[title]?{board[title]}}<p>{mod?<a href="?/">Return to dashboard</a>}</p></div>
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<script type="text/javascript" src="{index}main.js"></script>
|
<script type="text/javascript" src="{index}main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
{boardlist}
|
||||||
<h1>{board[url]} - {board[name]}</h1>
|
<h1>{board[url]} - {board[name]}</h1>
|
||||||
<div class="title">{board[title]?{board[title]}}<p>{mod?<a href="?/">Return to dashboard</a>}</p></div>
|
<div class="title">{board[title]?{board[title]}}<p>{mod?<a href="?/">Return to dashboard</a>}</p></div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user