aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/post
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/post')
-rw-r--r--core/include/post/list.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/include/post/list.php b/core/include/post/list.php
index 0f5ef1f..68183c7 100644
--- a/core/include/post/list.php
+++ b/core/include/post/list.php
@@ -30,12 +30,12 @@ if(Application::get('POST.SINGLE_REDIRECT') === TRUE AND $count === '1') {
HTTP::redirect($Post->getURL());
}
-$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);