diff --git a/lang/en/moodle.php b/lang/en/moodle.php index aee09f2e314..d2f8bbf302c 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -108,6 +108,7 @@ $string['blocks'] = 'Blocks'; $string['blocksetup'] = 'Setting up block tables'; $string['blocksuccess'] = '$a tables have been set up correctly'; $string['bycourseorder'] = 'By course order'; +$string['byname'] = 'by $a'; $string['cancel'] = 'Cancel'; $string['categories'] = 'Course categories'; $string['category'] = 'Category'; diff --git a/mod/forum/rsslib.php b/mod/forum/rsslib.php index 3553aac86c1..fd4bc4b5a61 100644 --- a/mod/forum/rsslib.php +++ b/mod/forum/rsslib.php @@ -130,7 +130,8 @@ u.firstname userfirstname, u.lastname userlastname, p.message postmessage, - p.created postcreated + p.created postcreated, + p.format postformat FROM {$CFG->prefix}forum_discussions d, {$CFG->prefix}forum_posts p, {$CFG->prefix}user u @@ -152,7 +153,7 @@ $item->author = fullname($user); $item->pubdate = $rec->postcreated; $item->link = $CFG->wwwroot."/mod/forum/discuss.php?d=".$rec->discussionid; - $item->description = $rec->postmessage; + $item->description = format_text($rec->postmessage,$rec->postformat,NULL,$forum->course); $items[] = $item; $articlesleft--; if ($articlesleft < 1) { @@ -173,12 +174,13 @@ if ($recs = get_records_sql ("SELECT p.id postid, d.id discussionid, - d.name discussionname, u.id userid, u.firstname userfirstname, u.lastname userlastname, + p.subject postsubject, p.message postmessage, - p.created postcreated + p.created postcreated, + p.format postformat FROM {$CFG->prefix}forum_discussions d, {$CFG->prefix}forum_posts p, {$CFG->prefix}user u @@ -193,13 +195,13 @@ foreach ($recs as $rec) { unset($item); unset($user); - $item->title = $rec->discussionname; + $item->title = $rec->postsubject; $user->firstname = $rec->userfirstname; $user->lastname = $rec->userlastname; $item->author = fullname($user); $item->pubdate = $rec->postcreated; $item->link = $CFG->wwwroot."/mod/forum/discuss.php?d=".$rec->discussionid."&parent=".$rec->postid; - $item->description = $rec->postmessage; + $item->description = format_text($rec->postmessage,$rec->postformat,NULL,$forum->course); $items[] = $item; $articlesleft--; if ($articlesleft < 1) { diff --git a/rss/rsslib.php b/rss/rsslib.php index 094b8c0a0b7..6e9d56da07e 100644 --- a/rss/rsslib.php +++ b/rss/rsslib.php @@ -181,7 +181,7 @@ function rss_standard_header($title = NULL, $link = NULL, $description = NULL) { //This function returns the rss XML code for every item passed in the array //item->title: The title of the item -//item->author: The author of the item +//item->author: The author of the item. Optional !! //item->pubdate: The pubdate of the item //item->link: The link url of the item //item->description: The content of the item @@ -197,6 +197,10 @@ function rss_add_items($items) { $result .= rss_full_tag("title",3,false,$item->title); $result .= rss_full_tag("link",3,false,$item->link); $result .= rss_full_tag("pubDate",3,false,date("r",$item->pubdate)); + //Include the author if exists + if (isset($item->author)) { + $item->description = get_string("byname","",$item->author)."

".$item->description; + } $result .= rss_full_tag("description",3,false,$item->description); $result .= rss_end_tag("item",2,true);