mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 01:10:51 +01:00
allow excluding boards from the boardlist
This commit is contained in:
parent
c223b1c55d
commit
541f31f4d1
@ -159,6 +159,13 @@
|
|||||||
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC" . ($settings['no_recent'] ? ' LIMIT ' . $settings['no_recent'] : '')) or error(db_error());
|
$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);
|
$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(
|
return Element('themes/index/index.html', Array(
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
'config' => $config,
|
'config' => $config,
|
||||||
@ -167,7 +174,7 @@
|
|||||||
'recent_posts' => $recent_posts,
|
'recent_posts' => $recent_posts,
|
||||||
'stats' => $stats,
|
'stats' => $stats,
|
||||||
'news' => $news,
|
'news' => $news,
|
||||||
'boards' => listBoards()
|
'boards' => $boardlist
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user