diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-10 13:29:18 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-10 13:29:18 +0000 |
commit | 68df2c81ff1ab57a00cd349aeb225368d8c806c7 (patch) | |
tree | a363cc7e172167be84aab97c97a107a1a3760412 | |
parent | b86f37c1aca7f8a90a41682dafd9cd06a72cbc6a (diff) | |
download | elgg-68df2c81ff1ab57a00cd349aeb225368d8c806c7.tar.gz elgg-68df2c81ff1ab57a00cd349aeb225368d8c806c7.tar.bz2 |
Added a plugin hook for counting comments.
git-svn-id: https://code.elgg.org/elgg/trunk@1390 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/elgglib.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 404c818a9..bde7d9499 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -517,6 +517,9 @@ } else {
$selected = false;
}
+
+ $submenu .= "<!-- {$item->value} {$_SERVER['REQUEST_URI']} -->";
+
$submenu .= elgg_view('canvas_header/submenu_template',
array(
'href' => $item->value,
@@ -564,6 +567,10 @@ * @return int Number of comments
*/
function elgg_count_comments($entity) {
+
+ if ($commentno = trigger_plugin_hook('comments:count',$entity->getType(),array('entity' => $entity),false)) {
+ return $commentno;
+ } else
return count_annotations($entity->getGUID(), "", "", "generic_comment");
}
|