A patch is here http://drupal.org/node/113326
---

This snippet displays attached images (which requires the image module and image_attach) in a block. I'm no PHP expert, but I managed to combine the general block loading code (lines 1 & 2) with the theme_image_attach_body code from image_attach.module, which seems to work pretty well.

if (arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));
    if ($node->iid) {
        $img_size = variable_get('image_attach_size_body_'. $node->type, IMAGE_ORIGINAL);
        if ($img_size != IMAGE_ATTACH_HIDDEN) {
            $image = node_load($node->iid);
            if (!node_access('view', $image)) {
                // If the image is restricted, don't show it as an attachment.
                return NU

LL;
            }
            $output = '<div class="image-attach">';
            $output .= l(image_display($image, $img_size), "node/$node->iid", array(), NULL, NULL, FALSE, TRUE);
            $output .= '</div>'."\n";

            print $output;
        }
    }
}

Change the IMAGE_ORIGINAL to 'thumbnail' or 'yoursize' to have it display in a custom size.

Comments

VladSavitsky’s picture

Show list of attached files to node (Drupal 6):

<?php
if (arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));
    if (isset($node->files)) {
        foreach ($node->files as $file) {
          if ($file->list == 1) { //Is file should be listed
              $list[] = l($file->filename, $file->filepath);
          }
        }
        if(count($list) > 0) {
            print theme('item_list', $list);
        }
    }
}
?>