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.

would like to know if anyone got this working...?

edited April 2012 in Vanilla 2.0 - 2.8

hi guys, anyone got a reverse sorted discussion ?

Answers

  • Yes, it works currently but as a side effect, when a discussion is longer then a page, the unread comment is not updated, so it always shows that you have unread items. If you go to the last page then the unread items will disappear.

  • csakip said:
    Yes, it works currently but as a side effect, when a discussion is longer then a page, the unread comment is not updated, so it always shows that you have unread items. If you go to the last page then the unread items will disappear.>

    the side effect is a pretty sticky wicket and looks like it would probably be fairly difficult to make it work as hoped.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I've managed to find a dirty solution to the problem that the unread comments doesn't get updated. Since now when you visit the discussion, you see the last comment on top, this will clear the unread comments no matter what.

    You should insert this into the plugin's class:
    public function DiscussionController_BeforeDiscussionRender_Handler($Sender) { if($Sender->Discussion->CountComments > 1) { //This check is a dirty solution so it won't throw an error on new discussion creation :) $Sender->CommentModel->SetWatch($Sender->Discussion, $Sender->Discussion->CountComments, 0, $Sender->Discussion->CountComments); } }

  • I correct myself. Try this:

    public function DiscussionController_BeforeDiscussionRender_Handler($Sender) { if($Sender->Discussion->CountComments > 2) { //This check is a dirty solution so it won't throw an error on new discussion creation :) $Sender->CommentModel->SetWatch($Sender->Discussion, $Sender->Discussion->CountComments, 0, $Sender->Discussion->CountComments); } }

  • hey man, i've got this question open a long time ago i'd like to try your dirty solution, i'll give you a message if i can get this to work on my site ;)

Sign In or Register to comment.