aboutsummaryrefslogtreecommitdiff
path: root/friends
diff options
context:
space:
mode:
Diffstat (limited to 'friends')
-rw-r--r--friends/index.php18
-rw-r--r--friends/of.php18
2 files changed, 6 insertions, 30 deletions
diff --git a/friends/index.php b/friends/index.php
index 6629a2fc6..8b5e17ef0 100644
--- a/friends/index.php
+++ b/friends/index.php
@@ -13,24 +13,12 @@
if (!$owner = page_owner_entity()) {
gatekeeper();
+ set_page_owner($_SESSION['user']->getGUID());
$owner = $_SESSION['user'];
}
- $offset = (int) get_input('offset');
-
- if ($friends = $owner->getFriends("",50,$offset)) {
-
- $body = elgg_view("friends/list",array('friends' => $friends));
-
- } else {
-
- if (page_owner() != $_SESSION['guid']) {
- $body = elgg_echo("friends:none");
- } else {
- $body = elgg_echo("friends:none:you");
- }
-
- }
+ $area1 = list_entities_from_relationship('friend',$owner->getGUID(),false,'user','');
+ $body = elgg_view_layout('one_column',$area1);
echo page_draw(sprintf(elgg_echo("friends:owned"),$owner->name),$body);
diff --git a/friends/of.php b/friends/of.php
index 7886c6c14..68aa47778 100644
--- a/friends/of.php
+++ b/friends/of.php
@@ -13,24 +13,12 @@
if (!$owner = page_owner_entity()) {
gatekeeper();
+ set_page_owner($_SESSION['user']->getGUID());
$owner = $_SESSION['user'];
}
- $offset = (int) get_input('offset');
-
- if ($friends = $owner->getFriendsOf("",50,$offset)) {
-
- $body = elgg_view("friends/list",array('friends' => $friends));
-
- } else {
-
- if (page_owner() != $_SESSION['guid']) {
- $body = elgg_echo("friends:of:none");
- } else {
- $body = elgg_echo("friends:of:none:you");
- }
-
- }
+ $area1 = list_entities_from_relationship('friend',$owner->getGUID(),true,'user','');
+ $body = elgg_view_layout('one_column',$area1);
echo page_draw(sprintf(elgg_echo("friends:of:owned"),$owner->name),$body);