從 fid 提取上傳檔案的資料 Get file info from fid: Drupal6

Get views result anywhere use:

<?php
views_get_view_result
($view_name,$display_name);
 
?>

EDIT 2011-01-10: or use $view->preview()

But it only return fid in imagefield

To get to filepath and other info, you have to:

<?php
$file
= field_file_load($node->website_logo_fid);
$output .= "<p><img src="".$file['filepath']."" alt="" /></p>";
?>

source: http://snipplr.com/view/26812/drupal--get-the-image-path-of-a-cck-field-...

result:

last, output image tag:

<?php
echo theme_image($path,$alt,$title);
?>

http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_image/6
AttachmentSize
Image icon views_get_view_result.JPG48.23 KB
Image icon field_file_load.JPG36.58 KB
Google