diff --git a/templates/themes/overboards/theme.php b/templates/themes/overboards/theme.php index 409062d6..fc1080ad 100644 --- a/templates/themes/overboards/theme.php +++ b/templates/themes/overboards/theme.php @@ -74,13 +74,21 @@ private function fetchThreads($overboard) { $query = ''; $boards = listBoards(true); + $included_boards = []; foreach ($boards as $b) { if (in_array($b, $overboard['exclude'])) continue; + $included_boards[] = $b; + } + + if (empty($included_boards)) { + return []; + } + + foreach ($included_boards as $b) { // Threads are those posts that have no parent thread - $query .= "SELECT *, '$b' AS `board` FROM ``posts_$b`` " . - "WHERE `thread` IS NULL UNION ALL "; + $query .= "SELECT *, '$b' AS `board` FROM ``posts_$b`` WHERE `thread` IS NULL UNION ALL "; } $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);