Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

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

This discussion is related to the Reverse Comment Sort addon.
edited April 2012 in Vanilla 2.0 - 2.2

hi guys, anyone got a reverse sorted discussion ?

Comments

  • 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.