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.

Exclude original post from comment count

Hi there,

I would like to exclude the first/original post of a discussion from the comment count. I want the comment count to be changed on all areas of the wbesite. So for example, if we were in the 'all categories' view and there was a category with only 1 discussion with only the original comment then the count would read:
1 discussion, 0 comments

Or for example if we were inside that specific category and viewing the dicussions that same discussion would read:
0 comments

I noticed in applications/vanilla/models/class.commentmodel.php there is some code that has '+ 1' hardcoded with the comment:
// Include the first comment (in the discussion table) in the count.

I removed this in both cases in this file but this is only affecting the count in the discussions view, and even then it doesn't seem to be working correctly all the time.

I noticed when creating a new discussion the CountComments in the Discussion table is 1 but I can't find where it is being set in the PHP.

Any help would be appreciated, thanks.

Comments

Sign In or Register to comment.