From 7676186f7b4bb6a891f08175dd22110c3885316b Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 27 Jun 2008 15:36:58 +0000 Subject: Introducing elgg_count_comments git-svn-id: https://code.elgg.org/elgg/trunk@1187 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index d4feabf53..f810cc8ca 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -481,7 +481,17 @@ return $comments; } - + + /** + * Count the number of comments attached to an entity + * + * @param ElggEntity $entity + * @return int Number of comments + */ + function elgg_count_comments($entity) { + return count_annotations($entity_guid, "", "", $name); + } + /** * Wrapper function to display search listings. * -- cgit v1.2.3