From 14e300378c40fab033a890dcf8071c939fdac6ea Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 4 Jun 2007 03:01:36 +0000 Subject: [PATCH] Show a sensible message for no search results git-svn-id: file:///home/shish/svn/shimmie2/trunk@157 7f39781d-f577-437e-ae19-be835c7a54ca --- core/ext/index.ext.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/ext/index.ext.php b/core/ext/index.ext.php index 98e96b57..eea0d919 100644 --- a/core/ext/index.ext.php +++ b/core/ext/index.ext.php @@ -41,7 +41,9 @@ class Index extends Extension { $page_title .= "$h_term"; } */ - $page->set_subheading("Page $page_number / $total_pages"); + if(count($images) > 0) { + $page->set_subheading("Page $page_number / $total_pages"); + } } if($page_number > 1 || count($search_terms) > 0) { // $page_title .= " / $page_number"; @@ -50,8 +52,13 @@ class Index extends Extension { $page->set_title($page_title); $page->set_heading($page_title); $page->add_side_block(new Block("Navigation", $this->build_navigation($page_number, $total_pages, $search_terms)), 0); - $page->add_main_block(new Block("Images", $this->build_table($images, $query)), 10); - $page->add_main_block(new Paginator("index", $query, $page_number, $total_pages), 90); + if(count($images) > 0) { + $page->add_main_block(new Block("Images", $this->build_table($images, $query)), 10); + $page->add_main_block(new Paginator("index", $query, $page_number, $total_pages), 90); + } + else { + $page->add_main_block(new Block("No Images Found", "No images were found to match the search criteria")); + } } if(is_a($event, 'SetupBuildingEvent')) {