HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Getting number of new posts in discussion

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.


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

  • Options

    Hey that is awesome. Thanks!

Sign In or Register to comment.