1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

allow excluding boards from the boardlist

This commit is contained in:
Lorenzo Yario 2024-07-14 04:38:11 -07:00 committed by GitHub
parent c223b1c55d
commit 541f31f4d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,6 +158,13 @@
$settings['no_recent'] = (int) $settings['no_recent'];
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC" . ($settings['no_recent'] ? ' LIMIT ' . $settings['no_recent'] : '')) or error(db_error());
$news = $query->fetchAll(PDO::FETCH_ASSOC);
// Excluded boards for the boardlist
$excluded_boards = isset($settings['excludeboardlist']) ? explode(' ', $settings['excludeboardlist']) : [];
$boardlist = array_filter($boards, function($board) use ($excluded_boards) {
return !in_array($board['uri'], $excluded_boards);
});
return Element('themes/index/index.html', Array(
'settings' => $settings,
@ -167,7 +174,7 @@
'recent_posts' => $recent_posts,
'stats' => $stats,
'news' => $news,
'boards' => listBoards()
'boards' => $boardlist
));
}
};