You are here

function node_title_list in Drupal 5

Same name and namespace in other branches
  1. 8 core/modules/node/node.module \node_title_list()
  2. 4 modules/node.module \node_title_list()
  3. 6 modules/node/node.module \node_title_list()
  4. 7 modules/node/node.module \node_title_list()
  5. 9 core/modules/node/node.module \node_title_list()

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.

3 calls to node_title_list()
blog_block in modules/blog/blog.module
Implementation of hook_block().
forum_block in modules/forum/forum.module
Implementation of hook_block().
statistics_block in modules/statistics/statistics.module
Implementation of hook_block().

File

modules/node/node.module, line 65
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

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);
}