diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-09-14 22:55:40 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-09-14 22:55:40 +0000 |
commit | 5595bc79c6824175e999ed6f661f2d42435ce24f (patch) | |
tree | 3e626326d20c0dc6bdd2959999ba02e3e4b8bf8c | |
parent | 318ce81a58cf522407b5dc52e61de59187a8b24e (diff) | |
download | brdo-5595bc79c6824175e999ed6f661f2d42435ce24f.tar.gz brdo-5595bc79c6824175e999ed6f661f2d42435ce24f.tar.bz2 |
#10279: Adding a note to taxonomy_render_nodes when there are no nodes to show, rather than showing an empty page.
-rw-r--r-- | modules/taxonomy.module | 12 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 221373a16..8754d5da3 100644 --- a/modules/taxonomy.module +++ b/modules/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; } 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; } |