-
-
-
- -
-
diff --git a/templates/themes/catalog/info.php b/templates/themes/catalog/info.php index c20a0ca3..d637069a 100644 --- a/templates/themes/catalog/info.php +++ b/templates/themes/catalog/info.php @@ -17,17 +17,12 @@ 'default' => 'Catalog' ); - $__boards = listBoards(); - $__default_boards = Array(); - foreach ($__boards as $__board) - $__default_boards[] = $__board['uri']; - $theme['config'][] = Array( 'title' => 'Included boards', 'name' => 'boards', 'type' => 'text', 'comment' => '(space seperated)', - 'default' => implode(' ', $__default_boards) + 'default' => '*' ); $theme['config'][] = Array( diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 2f0cfe7a..afe2ff90 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -1,6 +1,15 @@ fetch(PDO::FETCH_ASSOC)) { + $boards[] = $board['uri']; + } + return $boards; + } + function catalog_build($action, $settings, $board) { global $config; @@ -13,6 +22,11 @@ $boards = explode(' ', $settings['boards']); + if (in_array('*', $boards)) { + $boards = get_all_boards(); + } + + if ($action == 'all') { foreach ($boards as $board) { $b = new Catalog(); diff --git a/templates/themes/index/index.html b/templates/themes/index/index.html index 953e7bf4..2d037ccc 100644 --- a/templates/themes/index/index.html +++ b/templates/themes/index/index.html @@ -23,7 +23,7 @@
(No news to show.)
diff --git a/templates/themes/index/info.php b/templates/themes/index/info.php index 4b15023f..2d01cba0 100644 --- a/templates/themes/index/info.php +++ b/templates/themes/index/info.php @@ -74,12 +74,19 @@ ); $theme['config'][] = Array( - 'title' => 'Excluded boards', + 'title' => 'Excluded boards (recent posts)', 'name' => 'exclude', 'type' => 'text', 'comment' => '(space seperated)' ); + $theme['config'][] = Array( + 'title' => 'Excluded boards (boardlist)', + 'name' => 'excludeboardlist', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + $theme['config'][] = Array( 'title' => '# of recent images', 'name' => 'limit_images', diff --git a/templates/themes/index/theme.php b/templates/themes/index/theme.php index f9262b82..fc75b77b 100644 --- a/templates/themes/index/theme.php +++ b/templates/themes/index/theme.php @@ -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 )); } };