diff options
Diffstat (limited to 'core/include/post/list.php')
-rw-r--r-- | core/include/post/list.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/include/post/list.php b/core/include/post/list.php index 3ba2dba..6ade592 100644 --- a/core/include/post/list.php +++ b/core/include/post/list.php @@ -34,12 +34,12 @@ if(Application::get('POST.SINGLE_REDIRECT') === TRUE AND $count === '1') { # TRY: Template\Exception #=============================================================================== try { - $execSQL = "SELECT id FROM %s ORDER BY {$site_sort} LIMIT ".(($currentSite-1) * $site_size).", {$site_size}"; - $postIDs = $Database->query(sprintf($execSQL, Post\Attribute::TABLE))->fetchAll($Database::FETCH_COLUMN); + $execSQL = "SELECT * FROM %s ORDER BY {$site_sort} LIMIT ".(($currentSite-1) * $site_size).", {$site_size}"; + $Statement = $Database->query(sprintf($execSQL, Post\Attribute::TABLE)); - 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); |