Fixed oversights on landing page.

This commit is contained in:
flash 2024-02-08 00:06:23 +00:00
parent 070dc5e782
commit be54ce2c22
1 changed files with 3 additions and 3 deletions

View File

@ -53,14 +53,14 @@ class HomeRoutes extends RouteHandler {
private array $newsCategoryInfos = [];
private function getFeaturedNewsPosts(int $amount, bool $decorate): array {
private function getFeaturedNewsPosts(int $amount, bool $decorate): iterable {
$postInfos = $this->news->getPosts(
onlyFeatured: true,
pagination: new Pagination($amount)
);
if(!$decorate)
return $postInfos;
return iterator_to_array($postInfos);
$posts = [];
@ -221,7 +221,7 @@ class HomeRoutes extends RouteHandler {
} else $linkedData = null;
$stats = $this->getStats();
$onlineUserInfos = $this->getOnlineUsers();
$onlineUserInfos = iterator_to_array($this->getOnlineUsers());
$featuredNews = $this->getFeaturedNewsPosts(3, false);
$popularTopics = $this->getPopularForumTopics($config['landing.forum_categories']);
$activeTopics = $this->getActiveForumTopics($config['landing.forum_categories']);