diff options
Diffstat (limited to 'core/include/home.php')
-rw-r--r-- | core/include/home.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/include/home.php b/core/include/home.php index dfa2a36..fe732de 100644 --- a/core/include/home.php +++ b/core/include/home.php @@ -5,14 +5,12 @@ $Database = Application::getDatabase(); $Language = Application::getLanguage(); -$execSQL = 'SELECT id FROM %s ORDER BY '.Application::get('POST.LIST_SORT').' LIMIT '.Application::get('POST.LIST_SIZE'); +$execSQL = 'SELECT * FROM %s ORDER BY '.Application::get('POST.LIST_SORT').' LIMIT '.Application::get('POST.LIST_SIZE'); $Statement = $Database->query(sprintf($execSQL, Post\Attribute::TABLE)); -$postIDs = $Statement->fetchAll($Database::FETCH_COLUMN); - -foreach($postIDs as $postID) { +while($Attribute = $Statement->fetchObject('Post\Attribute')) { try { - $Post = Post\Factory::build($postID); + $Post = Post\Factory::buildByAttribute($Attribute); $User = User\Factory::build($Post->attr('user')); $ItemTemplate = generatePostItemTemplate($Post, $User); |