The RSS generated from uploads using the attachment module do not appear to add enclosures. This is critical for sites supporting podcasts. This is a great module. I just need this one little feature.

Comments

matt_paz’s picture

Status: Active » Closed (fixed)

Okay, well, this is probably pretty hoaky, but it seems to work ...
I added this case to function attachment_nodeapi
--------------------------------------------------

    case 'rss item':

      foreach ((array)$node->attachments as $attachment) {
      	      
	      if (count($attachment) > 0) {
		// RSS only allows one enclosure per item
      	         
                  $file = module_invoke('filemanager', 'get_file_info', $attachment['fid']);
                  $activeurl = str_replace('&', '&', module_invoke('filemanager', 'url', $file, FALSE));

		  return array(array('key' => 'enclosure',
			  'attributes' => array('url' => $activeurl,
			  'length' => $attachment['size'],
			  'type' => $attachment['mimetype'])));      	
	      }

        }

--------------------------------------------------