moodleou/moodle-mod_forumng — pull request #14 by nadavkav (2013-10-07 15:06:20+00:00)
Title: Fix unread discussions count (on course front page)

Translated token "hasunreadposts" used to show the unread discussion count, but not anymore.

While adding the "unread discussion count" as a parameter to the token, I noticed forumfields->numunreaddiscussions does not properly hold the actual number of discussions that has new posts in them.

So here is a suggested fix for get_num_unread_discussions() which does not seem to work properly when using it to view unread (post) discussions on the course front page.

I use it together with:
get_string('hasunreadposts', 'forumng', $forums[$cm->instance]->get_num_unread_discussions());

$string['hasunreadposts'] = '({$a} Unread posts)';

What do you think?