Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Counting Approved comments


Reply


3 Posts   1083 Views

Avatar
Adam .

Community Member, 2 Posts

27 March 2013 at 3:12am

I'm using the blog module and I need to get a count of all the comments that have been moderated/approved. I'm currently using $Comments.Count but that counts all comments not the just the moderated comments. Does anyone know how i can count just the moderated comments?

Avatar
Adam .

Community Member, 2 Posts

28 March 2013 at 12:32am

SOLVED!

add this to BlogEntry.php

public function getApprovedComments(){
   return $this->Comments('Comment.Moderated = 1');
}

Avatar
RuthAdele

Community Member, 19 Posts

27 June 2013 at 2:38pm

I'd like to add for clarity that you now need to call ApprovedComments in your template.