You are here

function _nodereference_titles in Content Construction Kit (CCK) 6.3

Same name and namespace in other branches
  1. 6 modules/nodereference/nodereference.module \_nodereference_titles()
  2. 6.2 modules/nodereference/nodereference.module \_nodereference_titles()

Helper function for formatters.

Store node titles collected in the curent request.

1 call to _nodereference_titles()
nodereference_token_values in modules/nodereference/nodereference.token.inc
Implementation of hook_token_values().

File

modules/nodereference/nodereference.module, line 382
Defines a field type for referencing one node from another.

Code

function _nodereference_titles($nid, $known_title = NULL) {
  static $titles = array();
  if (!isset($titles[$nid])) {
    $title = $known_title ? $known_title : db_result(db_query(db_rewrite_sql("SELECT n.title FROM {node} n WHERE n.nid=%d"), $nid));
    $titles[$nid] = $title ? $title : '';
  }
  return $titles[$nid];
}