diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-02-01 14:09:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-02-01 14:09:31 +0000 |
commit | 7931c778d75cec00bd0d186da18c08e5dcf9a5c4 (patch) | |
tree | e6f833984fbe5909016351d7d6190a54031ecfab /modules/taxonomy | |
parent | 171de5d46db2523bfd581a726979209efb608998 (diff) | |
download | brdo-7931c778d75cec00bd0d186da18c08e5dcf9a5c4.tar.gz brdo-7931c778d75cec00bd0d186da18c08e5dcf9a5c4.tar.bz2 |
- Patch #16513 by James (slightly modified): export categories and enclosures to RSS feeds (and made RSS feeds extensible).
NOTE: this needs to be documented.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 54f3131b1..d69f988db 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -885,6 +885,9 @@ function taxonomy_nodeapi($node, $op, $arg = 0) { case 'delete': taxonomy_node_delete($node->nid); break; + case 'rss item': + return taxonomy_rss_item($node); + break; } } @@ -1015,6 +1018,20 @@ function taxonomy_admin() { } /** + * Provides category information for rss feeds + */ +function taxonomy_rss_item($node) { + $output = array(); + $terms = taxonomy_node_get_terms($node->nid); + foreach ($terms as $term) { + $output[] = array('key' => 'category', + 'value' => $term->name, + 'attributes' => array('domain' => url('taxonomy/term/'.$term->tid, NULL, NULL, TRUE))); + } + return $output; +} + +/** * Implementation of hook_help(). */ function taxonomy_help($section) { |