summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 5c2e75ba5..b7d2bcb76 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -119,11 +119,13 @@ function node_cron() {
*/
function node_title_list($result, $title = NULL) {
$items = array();
+ $num_rows = FALSE;
while ($node = db_fetch_object($result)) {
$items[] = l($node->title, 'node/'. $node->nid, !empty($node->comment_count) ? array('title' => format_plural($node->comment_count, '1 comment', '@count comments')) : array());
+ $num_rows = TRUE;
}
- return $node ? theme('node_list', $items, $title) : FALSE;
+ return $num_rows ? theme('node_list', $items, $title) : FALSE;
}
/**
@@ -2557,11 +2559,13 @@ function node_page_default() {
$result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));
$output = '';
+ $num_rows = FALSE;
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load($node->nid), 1);
+ $num_rows = TRUE;
}
- if ($node) {
+ if ($num_rows) {
$feed_url = url('rss.xml', array('absolute' => TRUE));
drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') .' '. t('RSS'));
$output .= theme('pager', NULL, variable_get('default_nodes_main', 10));