From a7475765e5c538d19987fe86d45876df90f4ea25 Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 30 Mar 2015 18:11:44 +0200 Subject: [PATCH] fix --- _sakura/components/Main.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index bc15ae9..81b1b83 100644 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -151,11 +151,11 @@ class Main { $newsPosts = Database::fetch('news', true, null, ['id', true], ($limit ? [$limit] : null)); // Get user data - foreach($newsPosts as $newsPost) { - $newsPost['udata'] = Users::getUser($newsPost['uid']); - $newsPost['gdata'] = Users::getGroup($newsPost['udata']['group_main']); + foreach($newsPosts as $newsId => $newsPost) { + $newsPosts[$newsId]['udata'] = Users::getUser($newsPost['uid']); + $newsPosts[$newsId]['gdata'] = Users::getGroup($newsPost['udata']['group_main']); } -print_r($newsPosts);print '
'; + // Return posts return $newsPosts;