aboutsummaryrefslogtreecommitdiffstats
path: root/admin/post/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/post/index.php')
-rw-r--r--admin/post/index.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/admin/post/index.php b/admin/post/index.php
index e18a634..1269236 100644
--- a/admin/post/index.php
+++ b/admin/post/index.php
@@ -26,14 +26,14 @@ if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
}
#===============================================================================
-# Fetch post IDs from database
+# Fetch items from database
#===============================================================================
-$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);