From 5595bc79c6824175e999ed6f661f2d42435ce24f Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Tue, 14 Sep 2004 22:55:40 +0000 Subject: #10279: Adding a note to taxonomy_render_nodes when there are no nodes to show, rather than showing an empty page. --- modules/taxonomy/taxonomy.module | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modules/taxonomy/taxonomy.module') diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 221373a16..8754d5da3 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -805,11 +805,15 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p * taxonomy_select_nodes(), and formats each node along with a pager. */ function taxonomy_render_nodes($result) { - - while ($node = db_fetch_object($result)) { - $output .= node_view(node_load(array('nid' => $node->nid)), 1); + if (db_num_rows($result) > 0) { + while ($node = db_fetch_object($result)) { + $output .= node_view(node_load(array('nid' => $node->nid)), 1); + } + $output .= theme('pager', NULL, variable_get('default_nodes_main', 10), 0); + } + else { + $output .= t('There are currently no posts in this category.'); } - $output .= theme('pager', NULL, variable_get('default_nodes_main', 10), 0); return $output; } -- cgit v1.2.3