of.php 822 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Elgg friends of page
  4. *
  5. * @package Elgg.Core
  6. * @subpackage Social.Friends
  7. */
  8. $owner = elgg_get_page_owner_entity();
  9. $title = elgg_echo("friends:of:owned", array($owner->name));
  10. $dbprefix = elgg_get_config('dbprefix');
  11. $options = array(
  12. 'relationship' => 'friend',
  13. 'relationship_guid' => $owner->getGUID(),
  14. 'inverse_relationship' => true,
  15. 'type' => 'user',
  16. 'joins' => array("JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"),
  17. 'order_by' => 'ue.name ASC',
  18. 'full_view' => false,
  19. 'no_results' => elgg_echo('friends:none'),
  20. );
  21. $content = elgg_list_entities_from_relationship($options);
  22. if (!$content) {
  23. $content = elgg_echo('friends:none');
  24. }
  25. $params = array(
  26. 'content' => $content,
  27. 'title' => $title,
  28. );
  29. $body = elgg_view_layout('one_sidebar', $params);
  30. echo elgg_view_page($title, $body);