default.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Elgg user display
  4. *
  5. * @uses $vars['entity'] ElggUser entity
  6. * @uses $vars['size'] Size of the icon
  7. */
  8. $entity = $vars['entity'];
  9. $size = elgg_extract('size', $vars, 'tiny');
  10. $icon = elgg_view_entity_icon($entity, $size, $vars);
  11. // Simple XFN
  12. $rel = '';
  13. if (elgg_get_logged_in_user_guid() == $entity->guid) {
  14. $rel = 'rel="me"';
  15. } elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $entity->guid)) {
  16. $rel = 'rel="friend"';
  17. }
  18. $link = "<a href=\"" . $entity->getUrl() . "\" $rel>" . $entity->name . "</a>";
  19. if($entity->donation > time()) {
  20. $link = "<div class='profile_donation'>{$link}</div>";
  21. }
  22. $title = $link;
  23. $metadata = elgg_view_menu('entity', array(
  24. 'entity' => $entity,
  25. 'sort_by' => 'priority',
  26. 'class' => 'elgg-menu-hz',
  27. ));
  28. if (elgg_in_context('owner_block') || elgg_in_context('widgets')) {
  29. $metadata = '';
  30. }
  31. if (elgg_get_context() == 'gallery') {
  32. echo $icon;
  33. } else {
  34. if ($entity->isBanned()) {
  35. $banned = elgg_echo('banned');
  36. $params = array(
  37. 'entity' => $entity,
  38. 'title' => $title,
  39. 'metadata' => $metadata,
  40. );
  41. } else {
  42. $params = array(
  43. 'entity' => $entity,
  44. 'title' => $title,
  45. 'metadata' => $metadata,
  46. 'subtitle' => $entity->briefdescription,
  47. 'content' => elgg_view('user/status', array('entity' => $entity)),
  48. );
  49. }
  50. $list_body = elgg_view('user/elements/summary', $params);
  51. echo elgg_view_image_block($icon, $list_body, $vars);
  52. }