Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.420 diff -u -r1.420 common.inc --- includes/common.inc 22 Jan 2005 11:15:24 -0000 1.420 +++ includes/common.inc 31 Jan 2005 21:46:52 -0000 @@ -689,7 +689,29 @@ $output .= ' '. drupal_specialchars(strip_tags($link)) ."\n"; $output .= ' '. drupal_specialchars($description) ."\n"; foreach ($args as $key => $value) { - $output .= ' <'. $key .'>'. drupal_specialchars(strip_tags($value)) ."\n"; + if (is_array($value)) { + $attr = array(); + foreach ($value as $k => $v) { + if ($k == 'value') { + $val = $v; + } + else { + $attr[$k] = $v; + } + } + $output .= ' <'. $key; + $output .= drupal_attributes($attr); + if ($val) { + $output .= '>'. drupal_specialchars(strip_tags($val)) . "\n"; + } + else { + $output .= " />\n"; + } + + } + else { + $output .= ' <'. $key .'>'. drupal_specialchars(strip_tags($value)) ."\n"; + } } $output .= "\n"; Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.454 diff -u -r1.454 node.module --- modules/node.module 30 Jan 2005 09:53:19 -0000 1.454 +++ modules/node.module 31 Jan 2005 21:46:52 -0000 @@ -1041,7 +1041,10 @@ // Allow modules to change $node->body before viewing. node_invoke_nodeapi($item, 'view', false, false); - $items .= format_rss_item($item->title, $link, $item->teaser, array('pubDate' => date('r', $item->changed))); + // Allow modules to add additional item fields + $extra = node_invoke_nodeapi($item, 'rss item'); + $extra = array_merge($extra, array('pubDate' => date('r', $item->changed), 'author' => $item->name)); + $items .= format_rss_item($item->title, $link, $item->teaser, $extra); } $channel_defaults = array( Index: modules/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v retrieving revision 1.172 diff -u -r1.172 taxonomy.module --- modules/taxonomy.module 29 Jan 2005 22:02:37 -0000 1.172 +++ modules/taxonomy.module 31 Jan 2005 21:46:52 -0000 @@ -885,6 +885,9 @@ case 'delete': taxonomy_node_delete($node->nid); break; + case 'rss item': + return taxonomy_rss_item($node); + break; } } @@ -1012,6 +1015,20 @@ } print theme('page', $output); +} + +/** + * Provides category information for rss feeds + */ +function taxonomy_rss_item($node) { + $output = array(); + $terms = taxonomy_node_get_terms($node->nid); + if (count($terms) > 0) { + $term = array_shift($terms); + $output['category'] = array('value' => $term->name, + 'domain' => url('taxonomy/term/'.$term->tid, NULL, NULL, TRUE)); + } + return $output; } /** Index: modules/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload.module,v retrieving revision 1.22 diff -u -r1.22 upload.module --- modules/upload.module 29 Jan 2005 22:02:37 -0000 1.22 +++ modules/upload.module 31 Jan 2005 21:46:52 -0000 @@ -265,6 +265,21 @@ break; case 'search result': return $node->files ? format_plural(count($node->files), '1 attachment', '%count attachments') : null; + case 'rss item': + $files = array(); + foreach ($node->files as $file) { + if ($file->list) { + $files[] = $file; + } + } + if (count($files) > 0) { + // RSS only allows one enclosure per item + $file = array_shift($files); + return array('enclosure' => array('url' => file_create_url($file->filepath), + 'length' => $file->filesize, + 'type' => $file->filemime)); + } + break; } return $output;