You are here

function contemplate_eval_enclosure in Content Templates (Contemplate) 5

Same name and namespace in other branches
  1. 6 contemplate.module \contemplate_eval_enclosure()
  2. 7 contemplate.module \contemplate_eval_enclosure()

Eval the RSS enclosure field

1 call to contemplate_eval_enclosure()
contemplate_nodeapi in ./contemplate.module
Implementation of hook_nodeapi().

File

./contemplate.module, line 773
Create templates to customize teaser and body content.

Code

function contemplate_eval_enclosure($field, $node) {
  $tmplt = "<?php print " . $field . " ?>";
  $xml_elements = array();
  $fid = contemplate_eval($tmplt, $node, $xml_elements);
  if (is_numeric($fid)) {
    $file = db_fetch_object(db_query("SELECT * FROM {files} WHERE fid = %d", $fid));
    return $file;
  }
  return FALSE;
}