Пример #1
0
/**
 * Most viewed images of the current year
 *
 */
// set up breadcrumbs
elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
elgg_push_breadcrumb(elgg_echo('tidypics:mostviewedthisyear'));
$offset = (int) get_input('offset', 0);
$limit = (int) get_input('limit', 16);
$start = mktime(0, 0, 0, 1, 1, date("Y"));
$end = time();
$options = array('type' => 'object', 'subtype' => 'image', 'limit' => $limit, 'offset' => $offset, 'annotation_name' => 'tp_view', 'calculation' => 'count', 'annotation_created_time_lower' => $start, 'annotation_created_time_upper' => $end, 'order_by' => 'annotation_calculation desc', 'full_view' => false, 'list_type' => 'gallery', 'gallery_class' => 'tidypics-gallery');
$result = elgg_list_entities_from_annotation_calculation($options);
$title = elgg_echo('tidypics:mostviewedthisyear');
$logged_in_user = elgg_get_logged_in_user_entity();
if (tidypics_can_add_new_photos(null, $logged_in_user)) {
    elgg_register_menu_item('title', array('name' => 'addphotos', 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_user->getGUID(), 'text' => elgg_echo("photos:addphotos"), 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
}
// only show slideshow link if slideshow is enabled in plugin settings and there are images
if (elgg_get_plugin_setting('slideshow', 'tidypics') && !empty($result)) {
    elgg_require_js('tidypics/slideshow');
    $url = elgg_get_site_url() . "photos/mostviewedthisyear?limit=64&offset={$offset}&view=rss";
    $url = elgg_format_url($url);
    elgg_register_menu_item('title', array('name' => 'slideshow', 'id' => 'slideshow', 'data-slideshowurl' => $url, 'href' => '#', 'text' => "<img src=\"" . elgg_get_simplecache_url("tidypics/slideshow.png") . "\" alt=\"" . elgg_echo('album:slideshow') . "\">", 'title' => elgg_echo('album:slideshow'), 'link_class' => 'elgg-button elgg-button-action'));
}
if (!empty($result)) {
    $area2 = $result;
} else {
    $area2 = elgg_echo('tidypics:mostviewedthisyear:nosuccess');
}
$body = elgg_view_layout('content', array('filter_override' => '', 'content' => $area2, 'title' => $title, 'sidebar' => elgg_view('photos/sidebar_im', array('page' => 'all'))));
Пример #2
0
}
$owner = elgg_get_page_owner_entity();
elgg_group_gatekeeper();
$photo->addView();
if (elgg_get_plugin_setting('tagging', 'tidypics')) {
    elgg_load_js('jquery.imgareaselect');
    elgg_require_js('tidypics/tagging');
}
// set up breadcrumbs
elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
elgg_push_breadcrumb(elgg_echo('tidypics:albums'), 'photos/all');
if (elgg_instanceof($owner, 'group')) {
    elgg_push_breadcrumb($owner->name, "photos/group/{$owner->guid}/all");
} else {
    elgg_push_breadcrumb($owner->name, "photos/owner/{$owner->username}");
}
elgg_push_breadcrumb($album->getTitle(), $album->getURL());
elgg_push_breadcrumb($photo->getTitle());
if (!$owner instanceof ElggGroup) {
    $owner = elgg_get_logged_in_user_entity();
}
if (tidypics_can_add_new_photos(null, $owner)) {
    elgg_register_menu_item('title', array('name' => 'addphotos', 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $owner->getGUID(), 'text' => elgg_echo("photos:addphotos"), 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
}
if (elgg_get_plugin_setting('download_link', 'tidypics')) {
    // add download button to title menu
    elgg_register_menu_item('title', array('name' => 'download', 'href' => "photos/download/{$photo_guid}", 'text' => elgg_echo('image:download'), 'link_class' => 'elgg-button elgg-button-action'));
}
$content = elgg_view_entity($photo, array('full_view' => true));
$body = elgg_view_layout('content', array('filter' => false, 'content' => $content, 'title' => $photo->getTitle(), 'sidebar' => elgg_view('photos/sidebar_im', array('page' => 'tp_view', 'image' => $photo))));
echo elgg_view_page($photo->getTitle(), $body);
Пример #3
0
elgg_group_gatekeeper();
$container = get_entity($container_guid);
if (!$container || !elgg_instanceof($container, 'group')) {
    forward(REFERER);
}
$db_prefix = elgg_get_config('dbprefix');
$filter = '';
// set up breadcrumbs
elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
elgg_push_breadcrumb($container->name);
$offset = (int) get_input('offset', 0);
$limit = (int) get_input('limit', 16);
// grab the html to display the most recent images
$result = elgg_list_entities(array('type' => 'object', 'subtype' => 'image', 'owner_guid' => NULL, 'joins' => array("join {$db_prefix}entities u on e.container_guid = u.guid"), 'wheres' => array("u.container_guid = {$container_guid}"), 'order_by' => "e.time_created desc", 'limit' => $limit, 'offset' => $offset, 'full_view' => false, 'list_type' => 'gallery', 'gallery_class' => 'tidypics-gallery'));
$title = elgg_echo('tidypics:siteimagesgroup', array($container->name));
if (tidypics_can_add_new_photos(null, $container)) {
    elgg_register_menu_item('title', array('name' => 'addphotos', 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $container_guid, 'text' => elgg_echo("photos:addphotos"), 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
}
// only show slideshow link if slideshow is enabled in plugin settings and there are images
if (elgg_get_plugin_setting('slideshow', 'tidypics') && !empty($result)) {
    elgg_require_js('tidypics/slideshow');
    $url = elgg_get_site_url() . "photos/siteimagesgroup/{$container_guid}?limit=64&offset={$offset}&view=rss";
    $url = elgg_format_url($url);
    elgg_register_menu_item('title', array('name' => 'slideshow', 'id' => 'slideshow', 'data-slideshowurl' => $url, 'href' => '#', 'text' => "<img src=\"" . elgg_get_simplecache_url("tidypics/slideshow.png") . "\" alt=\"" . elgg_echo('album:slideshow') . "\">", 'title' => elgg_echo('album:slideshow'), 'link_class' => 'elgg-button elgg-button-action'));
}
if (!empty($result)) {
    $area2 = $result;
} else {
    $area2 = elgg_echo('tidypics:siteimagesgroup:nosuccess');
}
$body = elgg_view_layout('content', array('filter_override' => $filter, 'content' => $area2, 'title' => $title, 'sidebar' => elgg_view('photos/sidebar_im', array('page' => 'owner'))));
Пример #4
0
<?php

/**
 * Group images module
 */
elgg_load_js('lightbox');
elgg_load_css('lightbox');
$group = $vars['entity'];
$group_guid = $group->getGUID();
if ($group->tp_images_enable == "no") {
    return true;
}
$all_link = elgg_view('output/url', array('href' => "photos/siteimagesgroup/{$group_guid}", 'text' => elgg_echo('link:view:all'), 'is_trusted' => true));
$new_link = '';
if (tidypics_can_add_new_photos(null, $group)) {
    $new_link = elgg_view('output/url', array('href' => "ajax/view/photos/selectalbum/?owner_guid=" . $group_guid, 'text' => elgg_echo("photos:addphotos"), 'class' => 'elgg-lightbox', 'link_class' => 'elgg-lightbox', 'is_trusted' => true));
}
$db_prefix = elgg_get_config('dbprefix');
elgg_push_context('groups');
$options = array('type' => 'object', 'subtype' => 'image', 'joins' => array("join {$db_prefix}entities u on e.container_guid = u.guid"), 'wheres' => array("u.container_guid = {$group_guid}"), 'order_by' => "e.time_created desc", 'limit' => 6, 'full_view' => false, 'list_type_toggle' => false, 'list_type' => 'gallery', 'pagination' => false, 'gallery_class' => 'tidypics-gallery-widget');
$content = elgg_list_entities($options);
elgg_pop_context();
if (!$content) {
    $content = '<p>' . elgg_echo('tidypics:none') . '</p>';
}
echo elgg_view('groups/profile/module', array('title' => elgg_echo('tidypics:mostrecent'), 'content' => $content, 'all_link' => $all_link, 'add_link' => $new_link));