aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/home.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/home.php')
-rw-r--r--core/include/home.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/include/home.php b/core/include/home.php
index ce91558..2fe81a2 100644
--- a/core/include/home.php
+++ b/core/include/home.php
@@ -9,14 +9,12 @@ $Language = Application::getLanguage();
# TRY: Template\Exception
#===============================================================================
try {
- $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);