siteimagesowner.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Most recently uploaded images - logged in user's images
  4. *
  5. */
  6. $owner_guid = get_input('guid');
  7. $owner = get_entity($owner_guid);
  8. if(!$owner || !(elgg_instanceof($owner, 'user'))) {
  9. $owner = elgg_get_logged_in_user_entity();
  10. $filter = elgg_view('filter_override/siteimages', array('selected' => 'mine'));
  11. } else {
  12. $filter = '';
  13. }
  14. // set up breadcrumbs
  15. elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
  16. elgg_push_breadcrumb($owner->name);
  17. $offset = (int)get_input('offset', 0);
  18. $limit = (int)get_input('limit', 16);
  19. // grab the html to display the most recent images
  20. $result = elgg_list_entities(array('type' => 'object',
  21. 'subtype' => 'image',
  22. 'owner_guid' => $owner->guid,
  23. 'limit' => $limit,
  24. 'offset' => $offset,
  25. 'full_view' => false,
  26. 'list_type' => 'gallery',
  27. 'gallery_class' => 'tidypics-gallery'
  28. ));
  29. $title = elgg_echo('tidypics:siteimagesowner', array($owner->name));
  30. $owner_guid = elgg_get_logged_in_user_guid();
  31. elgg_register_menu_item('title', array('name' => 'addphotos',
  32. 'href' => "ajax/view/photos/selectalbum/?owner_guid=$owner_guid",
  33. 'text' => elgg_echo("photos:addphotos"),
  34. 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
  35. // only show slideshow link if slideshow is enabled in plugin settings and there are images
  36. if (elgg_get_plugin_setting('slideshow', 'tidypics') && !empty($result)) {
  37. $url = elgg_get_site_url() . "photos/siteimagesowner?limit=64&offset=$offset&view=rss";
  38. $url = elgg_format_url($url);
  39. $slideshow_link = "javascript:PicLensLite.start({maxScale:0, feedUrl:'$url'})";
  40. elgg_register_menu_item('title', array('name' => 'slideshow',
  41. 'href' => $slideshow_link,
  42. 'text' => "<img src=\"".elgg_get_site_url() ."mod/tidypics/graphics/slideshow.png\" alt=\"".elgg_echo('album:slideshow')."\">",
  43. 'title' => elgg_echo('album:slideshow'),
  44. 'link_class' => 'elgg-button elgg-button-action'));
  45. }
  46. if (!empty($result)) {
  47. $area2 = $result;
  48. } else {
  49. $area2 = elgg_echo('tidypics:siteimagesowner:nosuccess');
  50. }
  51. $body = elgg_view_layout('content', array(
  52. 'filter_override' => $filter,
  53. 'content' => $area2,
  54. 'title' => $title,
  55. 'sidebar' => elgg_view('photos/sidebar', array('page' => 'all')),
  56. ));
  57. // Draw it
  58. echo elgg_view_page($title, $body);