aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-27 15:36:58 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-27 15:36:58 +0000
commit7676186f7b4bb6a891f08175dd22110c3885316b (patch)
tree66da174ebbc8f72a5f7d52fdc4694af3364035c6 /engine/lib
parent26788e119aa2acc6c9f50556be702d66698c46a3 (diff)
downloadelgg-7676186f7b4bb6a891f08175dd22110c3885316b.tar.gz
elgg-7676186f7b4bb6a891f08175dd22110c3885316b.tar.bz2
Introducing elgg_count_comments
git-svn-id: https://code.elgg.org/elgg/trunk@1187 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php12
1 files changed, 11 insertions, 1 deletions
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.
*