aboutsummaryrefslogtreecommitdiffstats
path: root/admin/page/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/page/index.php')
-rw-r--r--admin/page/index.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/admin/page/index.php b/admin/page/index.php
index 7c8b1a6..82ac05f 100644
--- a/admin/page/index.php
+++ b/admin/page/index.php
@@ -26,14 +26,14 @@ if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
}
#===============================================================================
-# Fetch page IDs from database
+# Fetch items from database
#===============================================================================
-$execSQL = "SELECT id FROM %s ORDER BY {$site_sort} LIMIT ".(($currentSite-1) * $site_size).", {$site_size}";
-$pageIDs = $Database->query(sprintf($execSQL, Page\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, Page\Attribute::TABLE));
-foreach($pageIDs as $pageID) {
+while($Attribute = $Statement->fetchObject('Page\Attribute')) {
try {
- $Page = Page\Factory::build($pageID);
+ $Page = Page\Factory::buildByAttribute($Attribute);
$User = User\Factory::build($Page->attr('user'));
$ItemTemplate = generatePageItemTemplate($Page, $User);