node_title_list

  1. drupal
    1. 4.7
    2. 5 node.module
    3. 6 node.module
    4. 7 node.module
Versions
4.7 – 7 node_title_list($result, $title = NULL)

Gather a listing of links to nodes.

Parameters

$result A DB result object from a query to fetch node objects. If your query joins the <code>node_comment_statistics</code> table so that the <code>comment_count</code> field is available, a title attribute will be added to show the number of comments.

$title A heading for the resulting list.

Return value

An HTML list suitable as content for a block.

Code

modules/node.module, line 73

<?php
function node_title_list($result, $title = NULL) {
  while ($node = db_fetch_object($result)) {
    $items[] = l($node->title, 'node/' . $node->nid, $node->comment_count ? array('title' => format_plural($node->comment_count, '1 comment', '%count comments')) : '');
  }

  return theme('node_list', $items, $title);
}
?>