You are here

function _petreference_titles in Previewable email templates 6

Helper function for formatters.

Store pet titles collected in the curent request.

File

modules/petreference/petreference.module, line 312
Defines a field type for referencing pet template to a node.

Code

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