$item->pubdate = $blogpost->lastmodified;
$item->link = $CFG->wwwroot.'/blog/index.php?postid='.$blogpost->id;
$item->description = format_text($blogpost->summary, $blogpost->format);
+ if ( !empty($CFG->usetags) && ($blogtags = tag_get_tags_array('post', $blogpost->id)) ) {
+ if ($blogtags) {
+ $item->tags = $blogtags;
+ }
+ $item->tagscheme = $CFG->wwwroot . '/tag';
+ }
$items[] = $item;
}
$articles = rss_add_items($items); /// Change structure to XML
if (isset($item->category)) {
$result .= rss_full_tag('category',3,false,$item->category);
}
+ if (isset($item->tags)) {
+ $attributes = array();
+ if (isset($item->tagscheme)) {
+ $attributes['domain'] = $item->tagscheme;
+ }
+ foreach ($item->tags as $tag) {
+ $result .= rss_full_tag('category', 3, false, $tag, $attributes);
+ }
+ }
$result .= rss_full_tag('title',3,false,strip_tags($item->title));
$result .= rss_full_tag('link',3,false,$item->link);
$result .= rss_add_enclosures($item);