Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

Getting number of new posts in discussion

This discussion is related to the Latest Post List addon.

Hi. Some quick background: I've recently switched from Vanilla 1 to 2 after a very long wait. The primary thing preventing me from switching was that my board relies heavily on whatever plugin was similar to this one in Vanilla 1; albeit a modified version of it.

This plugin is great and has gotten us over that hump. however, I really want to find a way to modify it so that it will show not only the totally number of comments within a discussion, but also the number of NEW comments for the current user within that discussion. Much like the discussion panel does.

Has anyone done something like this? If not, does anyone have any pointers? I am fairly lost in the structure of vanilla 2 still.

Comments

  • hgtonighthgtonight ∞ · New Moderator

    Welcome to 2.1!

    Thanks for trying my addon. This could be added fairly easily since the data is already loaded.

    In /plugins/LatestPostList/modules/class.latestpostlistmodule.php fine the PostList() function and inside the foreach loop, find the unread comment count by using $UnreadCount = $Post->CountComments - $Post->CountCommentWatch;.

    Then you need to add it to the string being generated.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    Bleistivt
  • Hey that is awesome. Thanks!

    hgtonight
Sign In or Register to comment.