コード例 #1
0
/**
 * Lists entities
 *
 * @see elgg_view_entity_list
 *
 * @param string  $entity_type    Type of entity.
 * @param string  $entity_subtype Subtype of entity.
 * @param string  $name           Name of annotation.
 * @param string  $value          Value of annotation.
 * @param int     $limit          Maximum number of results to return.
 * @param int     $owner_guid     Owner.
 * @param int     $group_guid     Group container. Currently only supported if entity_type is object
 * @param boolean $asc            Whether to list in ascending or descending order (default: desc)
 * @param boolean $fullview       Whether to display the entities in full
 * @param boolean $listtypetoggle Can 'gallery' view can be displayed (default: no)
 *
 * @deprecated 1.7 Use elgg_list_entities_from_annotations()
 * @return string Formatted entity list
 */
function list_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "", $value = "", $limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true, $listtypetoggle = false)
{
    $msg = 'list_entities_from_annotations is deprecated by elgg_list_entities_from_annotations';
    elgg_deprecated_notice($msg, 1.8);
    $options = array();
    if ($entity_type) {
        $options['types'] = $entity_type;
    }
    if ($entity_subtype) {
        $options['subtypes'] = $entity_subtype;
    }
    if ($name) {
        $options['annotation_names'] = $name;
    }
    if ($value) {
        $options['annotation_values'] = $value;
    }
    if ($limit) {
        $options['limit'] = $limit;
    }
    if ($owner_guid) {
        $options['annotation_owner_guid'] = $owner_guid;
    }
    if ($group_guid) {
        $options['container_guid'] = $group_guid;
    }
    if ($asc) {
        $options['order_by'] = 'maxtime desc';
    }
    if ($offset = sanitise_int(get_input('offset', null))) {
        $options['offset'] = $offset;
    }
    $options['full_view'] = $fullview;
    $options['list_type_toggle'] = $listtypetoggle;
    $options['pagination'] = true;
    return elgg_list_entities_from_annotations($options);
}
コード例 #2
0
<?php

/**
 * Most recently voted images - world view only
 *
 */
// set up breadcrumbs
elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
elgg_push_breadcrumb(elgg_echo('tidypics:recentlyvoted'));
$offset = (int) get_input('offset', 0);
$limit = (int) get_input('limit', 16);
$options = array('type' => 'object', 'subtype' => 'image', 'limit' => $limit, 'offset' => $offset, 'annotation_name' => 'fivestar', 'order_by_annotation' => "n_table.time_created desc", 'full_view' => false, 'list_type' => 'gallery', 'gallery_class' => 'tidypics-gallery');
$result = elgg_list_entities_from_annotations($options);
$title = elgg_echo('tidypics:recentlyvoted');
if (elgg_is_logged_in()) {
    $logged_in_guid = elgg_get_logged_in_user_guid();
    elgg_register_menu_item('title', array('name' => 'addphotos', 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_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/recentvotes?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:recentlyvoted:nosuccess');
}
$body = elgg_view_layout('content', array('filter_override' => '', 'content' => $area2, 'title' => $title, 'sidebar' => elgg_view('photos/sidebar_im', array('page' => 'all'))));
コード例 #3
0
<?php

namespace hypeJunction\Gallery;

$page_owner = elgg_get_page_owner_entity();
echo '<div id="gallery-dashboard-favorites">';
echo elgg_list_entities_from_annotations(array('types' => 'object', 'subtypes' => array(hjAlbum::SUBTYPE, hjAlbumImage::SUBTYPE), 'annotation_names' => array('likes'), 'annotation_owner_guids' => $page_owner->guid, 'full_view' => false, 'list_type' => get_input('list_type', 'gallery'), 'list_type_toggle' => true, 'gallery_class' => 'gallery-photostream', 'pagination' => true, 'limit' => get_input('limit', 20), 'offset' => get_input('offset-albums', 0), 'offset_key' => 'offset-albums'));
echo '</div>';
コード例 #4
0
ファイル: content.php プロジェクト: epsylon/Hydra-dev
namespace AU\LikedContent;

$widget = $vars['entity'];
liked_content_set_defaults($widget);
$container = $widget->getContainerEntity();
$options = eligo_get_display_entities_options($widget);
$options['annotation_names'] = array('likes');
if (elgg_instanceof($container, 'user') && $widget->my_likes !== "0") {
    $options['annotation_owner_guids'] = $container->guid;
}
if (!elgg_instanceof($container, 'user') && !elgg_instanceof($container, 'group')) {
    unset($options['container_guids']);
}
if ($widget->eligo_sortby == 'mostliked') {
    $dbprefix = elgg_get_config('dbprefix');
    $likes_metastring = elgg_get_metastring_id('likes');
    $options['selects'] = array("(SELECT count(distinct l.id) FROM {$dbprefix}annotations l WHERE l.name_id = {$likes_metastring} AND l.entity_guid = e.guid) AS likes");
    $options['order_by'] = 'likes ASC';
    if ($widget->eligo_sortby_dir == 'desc') {
        $options['order_by'] = 'likes DESC';
    }
}
$context = elgg_get_context();
elgg_set_context('liked_content_widget');
$content = elgg_list_entities_from_annotations($options);
elgg_set_context($context);
if ($content) {
    echo $content;
} else {
    echo elgg_echo('liked_content:noresults');
}
コード例 #5
0
ファイル: view.php プロジェクト: epsylon/Hydra-dev
<?php

if (!elgg_is_logged_in()) {
    return;
}
$current_user = elgg_get_logged_in_user_entity();
$fav_options = array('type' => 'object', 'annotation_name' => 'favourite', 'order_by_annotation' => "n_table.time_created desc", 'full_view' => false, 'view_type_toggle' => FALSE, 'annotation_owner_guid' => $current_user->guid);
/*
$fav_options = array(
	'type' => 'object',
        'annotation_names' => array('favourite'),
	//'relationship_guid' => elgg_get_logged_in_user_guid(), 
	//'relationship' => 'flags_content', 
        'annotation_owner_guids' => array($user->guid);
	'full_view' => FALSE, 
	'view_type_toggle' => FALSE, 
);*/
//echo elgg_list_entities_from_relationship($fav_options);
echo elgg_list_entities_from_annotations($fav_options);
コード例 #6
0
ファイル: friends.php プロジェクト: akudan/elgg-markdown_wiki
 *
 *	Elgg-markdown_wiki friend's markdown_wiki page
 **/
$offset = (int) get_input('offset', 0);
$timelower = (int) get_input('timelower', 0);
$timeupper = (int) get_input('timeupper', 0);
$owner = elgg_get_logged_in_user_entity();
if (!$owner) {
    forward('markdown_wiki/all');
}
elgg_push_breadcrumb($owner->name, "markdown_wiki/owner/{$owner->username}");
elgg_push_breadcrumb(elgg_echo('friends'));
$title = elgg_echo('markdown_wiki:friends');
//$content = list_user_friends_objects($owner->guid, 'markdown_wiki', 10, false);
/* list_user_friends_objects check for friend object with strange config with container_guid.
 * We have to rewrite it
 */
if ($friends = get_user_friends($owner->guid, "", 999999, 0)) {
    $friendguids = array();
    foreach ($friends as $friend) {
        $friendguids[] = $friend->getGUID();
    }
    $content = elgg_list_entities_from_annotations(array('type' => 'object', 'subtype' => 'markdown_wiki', 'annotation_owner_guids' => $friendguids, 'full_view' => false, 'limit' => '20', 'offset' => $offset, 'created_time_lower' => $timelower, 'created_time_upper' => $timeupper));
}
if (!$content) {
    $content = elgg_echo('markdown_wiki:none');
}
$sidebar = elgg_view('markdown_wiki/sidebar/sidebar');
$params = array('filter_context' => 'friends', 'content' => $content, 'title' => $title, 'sidebar' => $sidebar);
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body);
コード例 #7
0
ファイル: users.php プロジェクト: epsylon/Hydra-dev
<?php

$fav_options = array('type' => 'user', 'annotation_name' => 'favourite', 'order_by_annotation' => "n_table.time_created desc", 'full_view' => false, 'view_type_toggle' => FALSE, 'annotation_owner_guid' => $current_user->guid);
$fav_user_body = elgg_list_entities_from_annotations($fav_options);
if ($fav_user_body) {
    echo elgg_view_module('aside', elgg_echo('favorites:users'), $fav_user_body);
}
コード例 #8
0
ファイル: owner.php プロジェクト: akudan/elgg-markdown_wiki
 **/
$owner = elgg_get_page_owner_entity();
if (!$owner) {
    forward('wiki/all');
}
// access check for closed groups
group_gatekeeper();
if (elgg_instanceof($owner, 'group')) {
    if ($owner->canEdit() || elgg_is_admin_logged_in()) {
        elgg_register_menu_item('title', array('name' => 'settings', 'href' => "wiki/group/{$owner->guid}/settings", 'text' => elgg_echo('markdown_wiki:settings'), 'link_class' => 'elgg-button elgg-button-action edit-button gwfb group_admin_only'));
    }
    $title = elgg_echo('markdown_wiki:groupowner', array($owner->name));
    $content = elgg_list_entities(array('types' => 'object', 'subtypes' => 'markdown_wiki', 'container_guid' => $owner->guid, 'full_view' => false));
} else {
    $title = elgg_echo('markdown_wiki:owner', array($owner->name));
    $content = elgg_list_entities_from_annotations(array('types' => 'object', 'subtypes' => 'markdown_wiki', 'annotation_owner_guids' => $owner->guid, 'full_view' => false));
}
elgg_push_breadcrumb($owner->name);
if (!$content) {
    $content = '<p>' . elgg_echo('markdown_wiki:none') . '</p>';
}
$filter_context = '';
if ($owner->guid == elgg_get_logged_in_user_guid()) {
    $filter_context = 'mine';
}
$sidebar = elgg_view('markdown_wiki/sidebar/sidebar');
$params = array('sidebar' => $sidebar, 'filter_context' => $filter_context, 'content' => $content, 'title' => $title);
if (elgg_instanceof($owner, 'group')) {
    $params['filter'] = '';
}
$body = elgg_view_layout('content', $params);
コード例 #9
0
ファイル: groups.php プロジェクト: epsylon/Hydra-dev
<?php

elgg_push_context('widgets');
$fav_group_params = array('type' => 'group', 'annotation_name' => 'favourite', 'order_by_annotation' => "n_table.time_created desc", 'full_view' => false, 'view_type_toggle' => FALSE, 'annotation_owner_guid' => $current_user->guid);
$fav_group_params['count'] = true;
if (elgg_get_entities_from_annotations($fav_group_params) == 0) {
    return true;
}
$fav_group_params['count'] = false;
$fav_group_body = elgg_list_entities_from_annotations($fav_group_params);
echo elgg_view_module('aside', elgg_echo('favourites:groups'), $fav_group_body);