#41703, fix rss item customization, backport from HEAD, patch by drewish.

4.7.x
Gerhard Killesreiter 2006-12-05 13:07:44 +00:00
parent 733cc74484
commit 23cabc2236
1 changed files with 9 additions and 8 deletions

View File

@ -1466,6 +1466,15 @@ function node_feed($nodes = 0, $channel = array()) {
node_invoke_nodeapi($item, 'view', $teaser, FALSE);
}
// Allow modules to add additional item fields
$extra = node_invoke_nodeapi($item, 'rss item');
$extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))));
foreach ($extra as $element) {
if ($element['namespace']) {
$namespaces = array_merge($namespaces, $element['namespace']);
}
}
// Prepare the item description
switch ($item_length) {
case 'fulltext':
@ -1482,14 +1491,6 @@ function node_feed($nodes = 0, $channel = array()) {
break;
}
// Allow modules to add additional item fields
$extra = node_invoke_nodeapi($item, 'rss item');
$extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))));
foreach ($extra as $element) {
if ($element['namespace']) {
$namespaces = array_merge($namespaces, $element['namespace']);
}
}
$items .= format_rss_item($item->title, $link, $item_text, $extra);
}