diff options
Diffstat (limited to 'admin')
-rw-r--r-- | admin/page/search.php | 16 | ||||
-rw-r--r-- | admin/post/search.php | 16 |
2 files changed, 14 insertions, 18 deletions
diff --git a/admin/page/search.php b/admin/page/search.php index d97370d..0506a0d 100644 --- a/admin/page/search.php +++ b/admin/page/search.php @@ -14,17 +14,15 @@ require '../../core/application.php'; # IF: Handle search request #=============================================================================== if($search = HTTP::GET('q')) { - if($pageIDs = Page\Item::getSearchResultIDs($search, $Database)) { - foreach($pageIDs as $pageID) { - try { - $Page = Page\Factory::build($pageID); - $User = User\Factory::build($Page->attr('user')); + foreach(Page\Item::getSearchResults($search, $Database) as $Attribute) { + try { + $Page = Page\Factory::buildByAttribute($Attribute); + $User = User\Factory::build($Page->attr('user')); - $pages[] = generatePageItemTemplate($Page, $User); - } - catch(Page\Exception $Exception){} - catch(User\Exception $Exception){} + $pages[] = generatePageItemTemplate($Page, $User); } + catch(Page\Exception $Exception){} + catch(User\Exception $Exception){} } } diff --git a/admin/post/search.php b/admin/post/search.php index c2c83ca..ac472f8 100644 --- a/admin/post/search.php +++ b/admin/post/search.php @@ -14,17 +14,15 @@ require '../../core/application.php'; # IF: Handle search request #=============================================================================== if($search = HTTP::GET('q')) { - if($postIDs = Post\Item::getSearchResultIDs($search, [NULL, NULL, NULL], $Database)) { - foreach($postIDs as $postID) { - try { - $Post = Post\Factory::build($postID); - $User = User\Factory::build($Post->attr('user')); + foreach(Post\Item::getSearchResults($search, [NULL, NULL, NULL], $Database) as $Attribute) { + try { + $Post = Post\Factory::buildByAttribute($Attribute); + $User = User\Factory::build($Post->attr('user')); - $posts[] = generatePostItemTemplate($Post, $User); - } - catch(Post\Exception $Exception){} - catch(User\Exception $Exception){} + $posts[] = generatePostItemTemplate($Post, $User); } + catch(Post\Exception $Exception){} + catch(User\Exception $Exception){} } } |