aboutsummaryrefslogtreecommitdiff
path: root/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'start.php')
-rw-r--r--start.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/start.php b/start.php
index f3ea460cc..3f01824ec 100644
--- a/start.php
+++ b/start.php
@@ -13,9 +13,19 @@ function friendrequest_init() {
elgg_register_page_handler('friendrequests', 'friendrequest_page_handler');
if (elgg_is_logged_in()) {
+
+ $count = elgg_get_entities_from_relationship(array(
+ 'type' => 'user',
+ 'relationship' => 'friendrequest',
+ 'relationship_guid' => $page_owner->guid,
+ 'inverse_relationship' => true,
+ 'limit' => 0,
+ 'count' => true,
+ ));
+
$params = array(
'name' => 'friendrequests',
- 'text' => elgg_echo('friendrequest'),
+ 'text' => elgg_echo('friendrequest').($count? " ($count)": ""),
'href' => "friendrequests",
'contexts' => array('friends'),
);