Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to show announcements in 'Unread Discussions' page

I use http://myforumname.com/discussions/unread quite a bit, and have added a link to it in my theme (and in the panel; I have another discussion about that). It bugged me that announcements are not included, so I added them.

On 2.1.8p2, I edited the following files:

applications/vanilla/models/class.discussionmodel.php

402a403
        ->Select('d.Announce', '', 'IsAnnounce')
424c425
<       $this->EventArguments['SortField'] = C('Vanilla.Discussions.SortField', 'd.DateLastComment');
---
  $this->EventArguments['SortField'] = C('Vanilla.Discussions.SortField', 'IsAnnounce desc, d.DateLastComment');

applications/vanilla/controllers/class.discussionscontroller.php (note the 's'! NOT discussioncontroller!):

228c228
<       $this->DiscussionData = $DiscussionModel->GetUnread($Page, $Limit);
---
  $this->DiscussionData = $DiscussionModel->GetUnread($Page, $Limit, array('Announce' => 'all'));

This did it for me - Announcements now show up in my 'unread' list!

Comments

Sign In or Register to comment.