function friends_of_friends_list_entities($user_guid, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) { $limit = (int) $limit; $offset = (int) get_input('offset'); $count = friends_of_friends_get_list($user_guid, "", $limit, $offset, true); $entities = friends_of_friends_get_list($user_guid); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle); }
/** * Return a list of how many users are currently online, rendered as a view. * * @return string */ function get_online_users() { $count = find_active_users(600, 10, 0, true); $objects = find_active_users(600, 10); if ($objects) { return elgg_view_entity_list($objects, array('count' => $count, 'limit' => 10)); } }
/** * Return a list of how many users are currently online, rendered as a view. * * @return string */ function get_online_users() { $offset = get_input('offset', 0); $count = find_active_users(600, 10, $offset, true); $objects = find_active_users(600, 10, $offset); if ($objects) { return elgg_view_entity_list($objects, array('count' => $count, 'offset' => $offset, 'limit' => 10)); } }
/** * Return a list of how many users are currently online, rendered as a view. */ function get_online_users() { $offset = get_input('offset', 0); $count = count(find_active_users(600, 9999)); $objects = find_active_users(600, 10, $offset); if ($objects) { return elgg_view_entity_list($objects, $count, $offset, 10, false); } }
/** * Return a list of how many users are currently online, rendered as a view. * * @return string */ function get_online_users() { $limit = max(0, (int) get_input("limit", 10)); $offset = max(0, (int) get_input("offset", 0)); $count = find_active_users(600, $limit, $offset, true); $objects = find_active_users(600, $limit, $offset); if ($objects) { return elgg_view_entity_list($objects, array('count' => $count, 'limit' => $limit, 'offset' => $offset)); } return ''; }
function threads_list_replies($entity_guid, $options = array()) { $options['relationship_guid'] = $entity_guid; $entity = get_entity($entity_guid); if (elgg_instanceof($entity, 'object', 'groupforumtopic')) { $options['pagination'] = true; $options['limit'] = 10; } else { $options['pagination'] = false; $options['limit'] = 0; } $options['offset'] = (int) get_input('offset', 0); $replies = threads_get_replies($entity_guid, $options); $options['count'] = threads_get_replies($entity_guid, array_merge($options, array('count' => true))); return elgg_view_entity_list($replies, $options); }
function hj_alive_view_comments_list($entity, $params) { $container_guid = elgg_extract('container_guid', $params, null); $river_id = elgg_extract('river_id', $params, null); $annotation_name = elgg_extract('aname', $params, 'generic_comment'); $options = array('type' => 'object', 'subtype' => 'hjannotation', 'owner_guid' => null, 'container_guid' => $container_guid, 'metadata_name_value_pairs' => array(array('name' => 'annotation_name', 'value' => $annotation_name), array('name' => 'annotation_value', 'value' => '', 'operand' => '!='), array('name' => 'river_id', 'value' => $river_id)), 'count' => false, 'limit' => 3, 'order_by' => 'e.time_created desc'); $options['count'] = true; $count = elgg_get_entities_from_metadata($options); if (elgg_instanceof($entity, 'object', 'hjannotation')) { $options['limit'] = 0; } else { $options['count'] = false; $comments = elgg_get_entities_from_metadata($options); } if ($annotation_name == 'generic_comment') { unset($params['aname']); } foreach ($params as $key => $option) { if ($option) { $data[$key] = $option; } } $vars['data-options'] = htmlentities(json_encode($data), ENT_QUOTES, 'UTF-8'); $vars['sync'] = true; $vars['pagination'] = false; $vars['list_class'] = 'hj-comments'; $vars['class'] = "hj-annotation-list-{$annotation_name}"; $visible = elgg_view_entity_list($comments, $vars); $limit = elgg_extract('limit', $options, 0); if ($count > 0 && $count > $limit) { $remainder = $count - $limit; if ($limit > 0) { $summary = elgg_echo('hj:alive:comments:remainder', array($remainder)); } else { $summary = elgg_echo('hj:alive:comments:viewall', array($remainder)); } } return elgg_view('hj/comments/list', array('summary' => $summary, 'visible' => $visible, 'hidden' => $hidden)); }
<?php /** * Tidypics full view of an image * Given a GUID, this page will try and display any entity * */ // Load Elgg engine include_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/engine/start.php"; global $CONFIG; $prefix = $CONFIG->dbprefix; $max = 24; //find timestamps for first and last days of this month $time_info = new stdClass(); $time_info->start = mktime(0, 0, 0, date("m"), 1, date("Y")); $time_info->end = mktime(); //this works but is wildly inefficient //$annotations = get_annotations(0, "object", "image", "tp_view", "", "", 5000); $sql = "SELECT ent.guid, count( * ) AS views\n\t\t\tFROM " . $prefix . "entities ent\n\t\t\tINNER JOIN " . $prefix . "entity_subtypes sub ON ent.subtype = sub.id\n\t\t\tAND sub.subtype = 'image'\n\t\t\tINNER JOIN " . $prefix . "annotations ann1 ON ann1.entity_guid = ent.guid AND ann1.owner_guid != ent.owner_guid\n\t\t\tINNER JOIN " . $prefix . "metastrings ms ON ms.id = ann1.name_id\n\t\t\tAND ms.string = 'tp_view'\n\t\t\tWHERE ann1.time_created BETWEEN {$time_info->start} AND {$time_info->end}\n\t\t\tGROUP BY ent.guid\n\t\t\tORDER BY views DESC\n\t\t\tLIMIT {$max}"; $result = get_data($sql); $entities = array(); foreach ($result as $entity) { $entities[] = get_entity($entity->guid); } tidypics_mostviewed_submenus(); $title = elgg_echo("tidypics:mostviewedthismonth"); $area2 = elgg_view_title($title); $area2 .= elgg_view_entity_list($entities, $max, 0, $max, false); $body = elgg_view_layout('two_column_left_sidebar', '', $area2); page_draw($title, $body);
/** * Returns a viewable list of entities for a given time period. * * @see elgg_view_entity_list * * @param int $start_time The start time as a unix timestamp. * @param int $end_time The end time as a unix timestamp. * @param string $type The type of entity (eg "user", "object" etc) * @param string $subtype The arbitrary subtype of the entity * @param int $owner_guid The GUID of the owning user * @param int $limit The number of entities to return; 10 by default * @param boolean $fullview Whether or not to display the full view (default: true) * @param boolean $listtypetoggle Whether or not to allow gallery view * @param boolean $navigation Display pagination? Default: true * * @return string A viewable list of entities * @access private * @deprecated 1.9 */ function list_notable_entities($start_time, $end_time, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) { elgg_deprecated_notice('list_notable_entities() has been deprecated', 1.9); $offset = (int) get_input('offset'); $count = get_notable_entities($start_time, $end_time, $type, $subtype, $owner_guid, "", $limit, $offset, true); $entities = get_notable_entities($start_time, $end_time, $type, $subtype, $owner_guid, "", $limit, $offset); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $navigation); }
<?php // generate a div which includes all the recommended groups $search_options = array('type' => 'group', 'subtype' => 0, 'offset' => 0, 'limit' => 5, 'joins' => array(), 'wheres' => array()); $search_options['metadata_name_value_pairs'][] = array('name' => 'featured_group', 'value' => 'yes'); $search_options['count'] = false; $recommended_groups = elgg_get_entities_from_metadata($search_options); $display_options = array("count" => ZHAOHU_RECOMMENDED_SHOW_LIMIT, "offset" => 0, "limit" => ZHAOHU_RECOMMENDED_SHOW_LIMIT, "full_view" => false, "pagination" => false); $header_title = elgg_echo("zhaohu:recommended_groups"); $content = "<div id='zhaohu_homepage_recommended_groups' class='zhaohu-homepage-right-sidebar-div'>"; $content .= "<div id='zhaohu_homepage_recommended_groups_header' class='zhaohu-homepage-right-sidebar-div-header'>{$header_title}</div>"; $content .= "<div id='zhaohu_homepage_recommended_groups_content' class='zhaohu-homepage-right-sidebar-div-content'>"; elgg_push_context("recommended_groups"); $list = elgg_view_entity_list($recommended_groups, $display_options); elgg_pop_context("recommended_groups"); if (!empty($list)) { $content .= $list; } else { $content .= elgg_echo('zhaohu:noresults'); } $content .= "</div>"; $content .= "</div>"; echo $content;
} $category_form = elgg_view_form('admin/plugins/filter', array('action' => 'admin/plugins', 'method' => 'get', 'disable_security' => true), array('category' => $show_category, 'category_options' => $categories, 'sort' => $sort)); $sort_options = array('priority' => elgg_echo('admin:plugins:sort:priority'), 'alpha' => elgg_echo('admin:plugins:sort:alpha'), 'date' => elgg_echo('admin:plugins:sort:date')); // security - only want a defined option if (!array_key_exists($sort, $sort_options)) { $sort = reset($sort_options); } $sort_form = elgg_view_form('admin/plugins/sort', array('action' => 'admin/plugins', 'method' => 'get', 'disable_security' => true), array('sort' => $sort, 'sort_options' => $sort_options, 'category' => $show_category)); $buttons = "<div class=\"clearfix mbm\">"; $buttons .= elgg_view_form('admin/plugins/change_state', array('action' => 'action/admin/plugins/activate_all', 'class' => 'float'), array('guids' => $guids, 'action' => 'activate')); $buttons .= elgg_view_form('admin/plugins/change_state', array('action' => 'action/admin/plugins/deactivate_all', 'class' => 'float'), array('guids' => $guids, 'action' => 'deactivate')); $buttons .= "</div>"; $buttons .= $category_form . $sort_form; // construct page header ?> <div id="content_header" class="mbm clearfix"> <div class="content-header-options"><?php echo $buttons; ?> </div> </div> <div id="elgg-plugin-list"> <?php $options = array('limit' => 0, 'full_view' => true, 'list_type_toggle' => false, 'pagination' => false); if ($show_category == 'all' && $sort == 'priority') { $options['display_reordering'] = true; } echo elgg_view_entity_list($plugin_list, $options); ?> </div>
<?php use hypeJunction\Inbox\Inbox; elgg_ajax_gatekeeper(); $user = elgg_get_logged_in_user_entity(); $inbox = new Inbox(); $inbox->setOwner($user)->displayThreaded(true); $count = $inbox->getCount(); $messages = $inbox->getMessages(); $latest_messages = array(); // Fix for 'GROUP_BY' statememtn returning wrong order foreach ($messages as $msg) { $lastMsg = $msg->getVolatileData('select:lastMsg'); if ($lastMsg && $lastMsg != $msg->guid) { $latest_messages[] = get_entity($lastMsg); } else { $latest_messages[] = $msg; } } $messages = $latest_messages; $unread = Inbox::countUnread($user); elgg_push_context('widgets'); $list = elgg_view_entity_list($messages, array('list_class' => 'elgg-list-inbox', 'no_results' => elgg_echo('inbox:empty'), 'full_view' => false, 'size' => 'tiny', 'threaded' => false, 'pagination' => false, 'threaded' => true)); elgg_pop_context(); echo json_encode(array('list' => $list, 'unread' => $unread, 'count' => $count));
<?php /** * Display a list of notification subjects */ elgg_ajax_gatekeeper(); $guid = elgg_extract('guid', $vars); $notification = get_entity($guid); if (!$notification instanceof ElggNotification) { forward('', '403'); } $content = elgg_view_entity_list($notification->getSubjects()); echo elgg_format_element('div', ['class' => 'notifier-lightbox-wrapper'], $content);
$folder_content = ''; if (empty($offset)) { $folder_content = elgg_view('file_tools/breadcrumb', ['entity' => $folder]); $sub_folders = file_tools_get_sub_folders($folder); if (empty($sub_folders)) { $sub_folders = []; } $entities = array_merge($sub_folders, $files); } else { $entities = $files; } $files_content = ''; if (!empty($entities)) { $params = ['full_view' => false, 'pagination' => false]; elgg_push_context('file_tools_selector'); $files_content = elgg_view_entity_list($entities, $params); elgg_pop_context(); } if (empty($files_content)) { $files_content = elgg_echo('file_tools:list:files:none'); } else { if ($show_more) { $more = elgg_view('input/button', ['value' => elgg_echo('file_tools:show_more'), 'class' => 'elgg-button-action', 'id' => 'file-tools-show-more-files']); $more .= elgg_view('input/hidden', ['name' => 'offset', 'value' => $limit + $offset]); if (!empty($folder)) { $more .= elgg_view('input/hidden', ['name' => 'folder_guid', 'value' => $folder->getGUID()]); } else { $more .= elgg_view('input/hidden', ['name' => 'folder_guid', 'value' => '0']); } $files_content .= elgg_format_element('div', ['id' => 'file-tools-show-more-wrapper', 'class' => 'center'], $more); }
<?php /** * Group blog module */ $group = elgg_get_page_owner_entity(); if ($group->forums_enable == "no") { return true; } $all_link = elgg_view('output/url', array('href' => "forum/group/{$group->guid}", 'text' => elgg_echo('link:view:all'), 'is_trusted' => true)); $topics = hj_forum_get_latest_topics($group->guid, 5, false, true); if (!$topics) { $content = '<p>' . elgg_echo("hj:framework:list:empty") . '</p>'; } else { elgg_push_context('widgets'); $content = elgg_view_entity_list($topics, array('full_view' => false)); elgg_pop_context(); } echo elgg_view('groups/profile/module', array('title' => elgg_echo('hj:forum:group'), 'content' => $content, 'all_link' => $all_link, 'add_link' => false));
/** * Returns a viewable list of entities based on the registered types. * * @see elgg_view_entity_list * * @param array $options Any elgg_get_entity() options plus: * * full_view => BOOL Display full view entities * * list_type_toggle => BOOL Display gallery / list switch * * allowed_types => TRUE|ARRAY True to show all types or an array of valid types. * * pagination => BOOL Display pagination links * * @return string A viewable list of entities * @since 1.7.0 */ function elgg_list_registered_entities(array $options = array()) { global $autofeed; $autofeed = true; $defaults = array('full_view' => TRUE, 'allowed_types' => TRUE, 'list_type_toggle' => FALSE, 'pagination' => TRUE, 'offset' => 0, 'types' => array(), 'type_subtype_pairs' => array()); $options = array_merge($defaults, $options); //backwards compatibility if (isset($options['view_type_toggle'])) { $options['list_type_toggle'] = $options['view_type_toggle']; } $types = get_registered_entity_types(); foreach ($types as $type => $subtype_array) { if (in_array($type, $options['allowed_types']) || $options['allowed_types'] === TRUE) { // you must explicitly register types to show up in here and in search for objects if ($type == 'object') { if (is_array($subtype_array) && count($subtype_array)) { $options['type_subtype_pairs'][$type] = $subtype_array; } } else { if (is_array($subtype_array) && count($subtype_array)) { $options['type_subtype_pairs'][$type] = $subtype_array; } else { $options['type_subtype_pairs'][$type] = ELGG_ENTITIES_ANY_VALUE; } } } } $count = elgg_get_entities(array_merge(array('count' => TRUE), $options)); $entities = elgg_get_entities($options); return elgg_view_entity_list($entities, $count, $options['offset'], $options['limit'], $options['full_view'], $options['list_type_toggle'], $options['pagination']); }
} else { if ($past_events) { $options['past_events'] = true; } } if (!empty($container_guid)) { $options["container_guid"] = $container_guid; } $options['search_type'] = $search_type; $options['query'] = $search; $options['offset'] = $offset; if ($search_type == 'list') { $limit = 10; $options['limit'] = $limit; $entities = event_manager_search_events($options); $returnData['content'] = elgg_view_entity_list($entities['entities'], array("count" => $entities['count'], "offset" => $offset, "limit" => $limit, 'full_view' => false, 'pagination' => false)); if ($entities['count'] - ($offset + $limit) > 0) { $returnData['content'] .= '<div id="event_manager_event_list_search_more" rel="' . ($offset + $limit) . '">'; $returnData['content'] .= elgg_echo('event_manager:list:showmorevents') . ' (' . ($entities['count'] - ($offset + $limit)) . ')</div>'; } if ($entities['count'] < 1) { $returnData['content'] .= elgg_echo('event_manager:list:noresults'); } } else { $options['latitude'] = $latitude; $options['longitude'] = $longitude; $options['distance'] = $distance; $options['limit'] = 50; $entities = event_manager_search_events($options); foreach ($entities['entities'] as $event) { if ($event->location) {
$user = (int) $user_guid; } else { $user = ""; } } $timelower = get_input('timelower'); if ($timelower) { $timelower = strtotime($timelower); } $timeupper = get_input('timeupper'); if ($timeupper) { $timeupper = strtotime($timeupper); } $title = elgg_view_title(elgg_echo('logbrowser')); // Get log entries $log = get_system_log($user, "", "", "", "", $limit, $offset, false, $timeupper, $timelower); $count = get_system_log($user, "", "", "", "", $limit, $offset, true, $timeupper, $timelower); $log_entries = array(); foreach ($log as $l) { $tmp = new ElggObject(); $tmp->subtype = 'logwrapper'; $tmp->entry = $l; $log_entries[] = $tmp; } $form = elgg_view('logbrowser/form', array('user_guid' => $user, 'timeupper' => $timeupper, 'timelower' => $timelower)); set_context('search'); $result = elgg_view_entity_list($log_entries, $count, $offset, $limit, false, false); $result = "<div class='admin_settings log_browser radius8 clearfloat'>" . $result . "</div>"; set_context('admin'); // Display main admin menu page_draw(elgg_echo('logbrowser'), elgg_view_layout("one_column_with_sidebar", $title . $form . $result));
$options['base_url'] = $base_url; $options['relationship'] = 'friend'; $options['inverse_relationship'] = false; $options['joins'] = array("JOIN " . $dbprefix . "users_entity u ON e.guid=u.guid"); if (!elgg_is_admin_logged_in()) { $options['wheres'] = array("(u.banned = 'no')"); } $content = elgg_list_entities_from_relationship_count($options); break; case 'online': default: $offset = get_input('offset', 0); $count = find_active_users(array('seconds' => 600, 'limit' => 10, 'offset' => $offset, 'count' => true)); $objects = gc_find_active_users(600, 10, $offset); if ($objects) { $content = elgg_view_entity_list($objects, array('count' => $count, 'offset' => $offset, 'base_url' => $base_url, 'limit' => 10)); } break; case 'newest': $options['base_url'] = $base_url; $options['joins'] = array("JOIN " . $dbprefix . "users_entity u ON e.guid=u.guid"); if (!elgg_is_admin_logged_in()) { $options['wheres'] = array("(u.banned = 'no')"); } $content = elgg_list_entities($options); break; case 'alphabetical': case 'all': $options = array("type" => "user", "full_view" => false, "limit" => 15, "joins" => array("JOIN " . $dbprefix . "users_entity u ON e.guid=u.guid"), 'base_url' => $base_url, "order_by" => "u.name asc"); if (!elgg_is_admin_logged_in()) { $options['wheres'] = array("(u.banned = 'no')");
<?php $userId = elgg_get_page_owner_guid(); $offset = get_input('offset', 0); $count = elgg_get_entities_from_relationship(array('type' => 'group', 'relationship' => 'member', 'relationship_guid' => $userId, 'inverse_relationship' => false, 'count' => true)); if (!$count) { echo elgg_echo('groups:none'); } else { $groups = elgg_get_entities_from_relationship(array('type' => 'group', 'relationship' => 'member', 'relationship_guid' => $userId, 'inverse_relationship' => false, "offset" => $offset, "limit" => ZHGROUPS_IN_PROFILE_LIMIT)); echo '<div id="zhaohu_profile_joined_groups">'; echo "<h3>" . elgg_echo("zhgroups:memberof", array($count)) . "</h3>"; elgg_push_context('inprofile'); $options = array("count" => $count, "offset" => $offset, "limit" => ZHGROUPS_IN_PROFILE_LIMIT, "full_view" => false, 'list_type' => 'gallery', "pagination" => true); //fordebug system_message("count ".$options["count"]); echo elgg_view_entity_list($groups, $options); echo '</div>'; elgg_pop_context('inprofile'); }
<?php echo elgg_view_entity_list($vars["entities"], array("count" => $vars["count"], "offset" => $vars["offset"], "limit" => 10, "full_view" => false));
/** * Displays a list of user objects that have been searched for. * * @see elgg_view_entity_list * * @param string $tag Search criteria * @param int $limit The number of entities to display on a page * * @return string The list in a form suitable to display * * @deprecated 1.7 */ function list_user_search($tag, $limit = 10) { elgg_deprecated_notice('list_user_search() deprecated by new search', 1.7); $offset = (int) get_input('offset'); $limit = (int) $limit; $count = (int) search_for_user($tag, 10, 0, '', true); $entities = search_for_user($tag, $limit, $offset); return elgg_view_entity_list($entities, $count, $offset, $limit, true, false); }
<?php /** * List all suggested groups */ elgg_push_context('zhg_contact'); $options = array("count" => elgg_extract("count", $vars), "limit" => false, "full_view" => false, "pagination" => false); $list = elgg_view_entity_list($vars["entities"], $options); elgg_pop_context('zhg_contact'); $result .= "<div id='zhaohu_manager_member_listing'>"; if (!empty($list)) { $result .= $list; } else { $result .= elgg_echo('zhaohu_manager:list:noresults'); } $result .= "</div>"; echo elgg_view_module("main", "", $result);
<?php elgg_load_css('fullcalendar'); $entities = elgg_extract('entities', $vars); $options = ['count' => elgg_extract('count', $vars), 'offset' => elgg_extract('offset', $vars), 'full_view' => false, 'pagination' => false, 'no_results' => elgg_echo('event_manager:list:noresults')]; $list = elgg_view_entity_list($entities, $options); $limit = elgg_extract('limit', $vars, 10); if ($options['count'] > $limit) { $list .= elgg_format_element('div', ['id' => 'event_manager_event_list_search_more', 'rel' => $options['offset'] ?: $limit], elgg_echo('event_manager:list:showmorevents') . ' (' . ($options['count'] - ($options['offset'] + $limit)) . ')'); } $result = elgg_format_element('div', ['id' => 'event_manager_event_listing', 'class' => 'event-manager-results'], $list); $result .= elgg_format_element('div', ['id' => 'event-manager-event-calendar', 'class' => 'event-manager-results hidden']); $result .= elgg_view('event_manager/onthemap', $vars); echo elgg_view_module('main', '', $result);
<?php /** * Group zhaohu manager module */ $group = elgg_get_page_owner_entity(); if ($group->zhaohu_manager_enable == "no") { return true; } $zhaohu_options = array(); $zhaohu_options["container_guid"] = elgg_get_page_owner_guid(); $zhaohus = zhaohu_manager_find_zhaohus($zhaohu_options); elgg_push_context("widgets"); $content = elgg_view_entity_list($zhaohus['entities'], array('count' => 0, 'offset' => 0, 'limit' => 5, 'full_view' => false)); elgg_pop_context(); if (!$content) { $content = '<p>' . elgg_echo('zhaohu:noresults') . '</p>'; } $all_link = elgg_view('output/url', array('href' => "/zhaohus/zhaohu/list/" . $group->getGUID(), 'text' => elgg_echo('link:view:all'))); $new_link = elgg_view('output/url', array('href' => "/zhaohus/zhaohu/new/" . $group->getGUID(), 'text' => elgg_echo('zhaohu:new'))); echo elgg_view('groups/profile/module', array('title' => elgg_echo('zhaohu_manager:group'), 'content' => $content, 'all_link' => $all_link, 'add_link' => $new_link));
/** * Returns a viewable list of entities based on the registered types. * * @see elgg_view_entity_list * * @param array $options Any elgg_get_entity() options plus: * * full_view => BOOL Display full view entities * * list_type_toggle => BOOL Display gallery / list switch * * allowed_types => true|ARRAY True to show all types or an array of valid types. * * pagination => BOOL Display pagination links * * @return string A viewable list of entities * @since 1.7.0 */ function elgg_list_registered_entities(array $options = array()) { global $autofeed; $autofeed = true; $defaults = array('full_view' => false, 'allowed_types' => true, 'list_type_toggle' => false, 'pagination' => true, 'offset' => 0, 'types' => array(), 'type_subtype_pairs' => array()); $options = array_merge($defaults, $options); // backward compatibility if (isset($options['view_type_toggle'])) { elgg_deprecated_notice("Option 'view_type_toggle' deprecated by 'list_type_toggle' in elgg_list* functions", 1.9); $options['list_type_toggle'] = $options['view_type_toggle']; } $types = get_registered_entity_types(); foreach ($types as $type => $subtype_array) { if (in_array($type, $options['allowed_types']) || $options['allowed_types'] === true) { // you must explicitly register types to show up in here and in search for objects if ($type == 'object') { if (is_array($subtype_array) && count($subtype_array)) { $options['type_subtype_pairs'][$type] = $subtype_array; } } else { if (is_array($subtype_array) && count($subtype_array)) { $options['type_subtype_pairs'][$type] = $subtype_array; } else { $options['type_subtype_pairs'][$type] = ELGG_ENTITIES_ANY_VALUE; } } } } if (!empty($options['type_subtype_pairs'])) { $count = elgg_get_entities(array_merge(array('count' => true), $options)); if ($count > 0) { $entities = elgg_get_entities($options); } else { $entities = array(); } } else { $count = 0; $entities = array(); } $options['count'] = $count; return elgg_view_entity_list($entities, $options); }
$where_clause = trigger_plugin_hook("extend_where", "profile_manager_member_search", null, $where_clause); // build query $query = "from {$CONFIG->dbprefix}entities e join {$CONFIG->dbprefix}users_entity u on e.guid = u.guid {$join} where " . $where_clause . $access_suffix; // execute query and retrieve entities $count = get_data_row("SELECT count(distinct e.guid) as total " . $query); $count = $count->total; if (!empty($order)) { $order = " order by " . $order; } $query = "SELECT " . $select . " " . $query . " " . $group_by . $order . " limit {$offset},{$limit}"; $entities = get_data($query, "entity_row_to_elggstar"); // present it echo "<div class='contentWrapper'>"; echo "<h3 class='settings'>" . elgg_echo("profile_manager:members:searchresults:title") . "</h3>"; if ($count > 0) { $nav = elgg_view('profile_manager/members/pagination', array('function_name' => "navigate_members_search", 'offset' => $offset, 'count' => $count, 'limit' => $limit)); $list = elgg_view_entity_list($entities, $count, $offset, $limit, false, false, false); echo "</div>"; echo $nav; echo $list; echo $nav; } else { echo elgg_echo("profile_manager:members:searchresults:noresults"); echo "</div>"; } if (isadminloggedin()) { echo "<div class='contentWrapper' id='members_search_result_query'><h3 class='settings'>" . elgg_echo("profile_manager:members:searchresults:query") . "</h3>"; echo $query; echo "</div>"; } echo "<script type='text/javascript'>setup_avatar_menu();</script>";
/** * Displays a list of user objects that have been searched for. * * @see elgg_view_entity_list * * @param string $tag Search criteria * @param int $limit The number of entities to display on a page * @return string The list in a form suitable to display */ function list_user_search($tag, $limit = 10) { $offset = (int) get_input('offset'); $limit = (int) $limit; $count = (int) search_for_user($tag, 10, 0, '', true); $entities = search_for_user($tag, $limit, $offset); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, false); }
/** * Displays a list of user objects of a particular subtype, with navigation. * * @see elgg_view_entity_list * * @param int $user_guid The GUID of the user * @param string $subtype The object subtype * @param int $limit The number of entities to display on a page * @param bool $fullview Whether or not to display the full view (default: true) * @param bool $listtypetoggle Whether or not to allow gallery view (default: true) * @param bool $pagination Whether to display pagination (default: true) * @param int $timelower The earliest time the entity can have been created. Default: all * @param int $timeupper The latest time the entity can have been created. Default: all * * @return string The list in a form suitable to display * @deprecated 1.8 Use elgg_list_entities() instead */ function list_user_objects($user_guid, $subtype = ELGG_ENTITIES_ANY_VALUE, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) { elgg_deprecated_notice("list_user_objects() was deprecated in favor of elgg_list_entities()", 1.8); $offset = (int) get_input('offset'); $limit = (int) $limit; $count = (int) count_user_objects($user_guid, $subtype, $timelower, $timeupper); $entities = get_user_objects($user_guid, $subtype, $limit, $offset, $timelower, $timeupper); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination); }
/** * Lists entities by the totals of a particular kind of annotation AND the value of a piece of metadata * * @param string $entity_type Type of entity. * @param string $entity_subtype Subtype of entity. * @param string $name Name of annotation. * @param string $mdname Metadata name * @param string $mdvalue Metadata value * @param int $limit Maximum number of results to return. * @param int $owner_guid Owner. * @param int $group_guid Group container. Currently this is only supported if $entity_type == '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 $viewtypetoggle Determines whether or not the 'gallery' view can be displayed (default: no) * @return string Formatted entity list */ function list_entities_from_annotation_count_by_metadata($entity_type = "", $entity_subtype = "", $name = "", $mdname = '', $mdvalue = '', $limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true, $viewtypetoggle = false, $pagination = true, $orderdir = 'desc') { if ($asc) { $asc = "asc"; } else { $asc = "desc"; } $offset = (int) get_input("offset", 0); $count = get_entities_from_annotation_count($entity_type, $entity_subtype, $name, $mdname, $mdvalue, $owner_guid, $limit, $offset, $orderdir, true); $entities = get_entities_from_annotation_count($entity_type, $entity_subtype, $name, $mdname, $mdvalue, $owner_guid, $limit, $offset, $orderdir, false); return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination); }