本文整理汇总了PHP中list_entities_from_metadata函数的典型用法代码示例。如果您正苦于以下问题:PHP list_entities_from_metadata函数的具体用法?PHP list_entities_from_metadata怎么用?PHP list_entities_from_metadata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了list_entities_from_metadata函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elgg_echo
} else {
if (empty($objecttype)) {
$objecttype = 'object';
}
$itemtitle = 'item:' . $objecttype;
if (!empty($subtype)) {
$itemtitle .= ':' . $subtype;
}
$itemtitle = elgg_echo($itemtitle);
$title = sprintf(elgg_echo('advancedsearchtitle'), $itemtitle, $tag);
}
global $CONFIG;
$tagSearch = false;
if (strpos(current_page_url(), $CONFIG->wwwroot . 'tag') > -1 || strpos(current_page_url(), $CONFIG->wwwroot . 'search/?tag') > -1) {
$tagSearch = true;
}
if (!empty($tag)) {
$body = "";
$body .= elgg_view_title($title);
// elgg_view_title(sprintf(elgg_echo('searchtitle'),$tag));
//the custom search doesn't work with tag searching
if (!$tagSearch) {
$body .= trigger_plugin_hook('search', '', $tag, "");
}
$body .= elgg_view('search/startblurb', array('tag' => $tag));
$body .= list_entities_from_metadata($md_type, $tag, $objecttype, $subtype, $owner_guid_array, 10, false, false);
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
}
if ($tagSearch) {
page_draw($title, $body);
}
示例2: list_entities_location
/**
* List entities in a given location
*
* @param string $location Location
* @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 display per page (default: 10)
* @param bool $fullview Whether or not to display the full view (default: true)
* @param bool $listtypetoggle Whether or not to allow gallery view
* @param bool $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
* @deprecated 1.8 Use elgg_list_entities_from_location()
*/
function list_entities_location($location, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true)
{
elgg_deprecated_notice('list_entities_location() was deprecated. Use elgg_list_entities_from_metadata()', 1.8);
return list_entities_from_metadata('location', $location, $type, $subtype, $owner_guid, $limit, $fullview, $listtypetoggle, $navigation);
}
示例3: add_submenu_item
}
global $CONFIG;
add_submenu_item(elgg_echo($label), $CONFIG->wwwroot . "pg/search/?tag=" . urlencode($tag) . "&subtype=" . $object_subtype . "&object=" . urlencode($object_type) . "&tagtype=" . urlencode($md_type) . "&owner_guid=" . urlencode($owner_guid));
}
}
}
add_submenu_item(elgg_echo('all'), $CONFIG->wwwroot . "pg/search/?tag=" . urlencode($tag) . "&owner_guid=" . urlencode($owner_guid));
}
if (empty($objecttype) && empty($subtype)) {
$title = sprintf(elgg_echo('searchtitle'), $tag);
} else {
if (empty($objecttype)) {
$objecttype = 'object';
}
$itemtitle = 'item:' . $objecttype;
if (!empty($subtype)) {
$itemtitle .= ':' . $subtype;
}
$itemtitle = elgg_echo($itemtitle);
$title = sprintf(elgg_echo('advancedsearchtitle'), $itemtitle, $tag);
}
if (!empty($tag)) {
$body = "";
$body .= elgg_view_title($title);
// elgg_view_title(sprintf(elgg_echo('searchtitle'),$tag));
$body .= trigger_plugin_hook('search', '', $tag, "");
$body .= elgg_view('search/startblurb', array('tag' => $tag));
$body .= list_entities_from_metadata($md_type, elgg_strtolower($tag), $objecttype, $subtype, $owner_guid_array, 10, false, false);
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
}
page_draw($title, $body);
示例4: elgg_view_title
} else {
if (page_owner() && page_owner() != $_SESSION['guid']) {
$area2 = elgg_view_title(sprintf(elgg_echo("file:user:type:" . $tag), page_owner_entity()->name));
} else {
$area2 = elgg_view_title(elgg_echo("file:type:" . $tag));
}
}
}
if ($friends) {
$area1 = get_filetype_cloud($friends, true);
} else {
if ($owner_guid) {
$area1 = get_filetype_cloud($owner_guid);
} else {
$area1 = get_filetype_cloud();
}
}
// Set context
set_context('search');
$limit = 10;
if ($search_viewtype == "gallery") {
$limit = 12;
}
if (!empty($tag)) {
$area2 .= list_entities_from_metadata($md_type, $tag, 'object', 'file', $owner_guid, $limit);
} else {
$area2 .= list_entities("object", "file", $owner_guid, $limit);
}
set_context("file");
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
page_draw(sprintf(elgg_echo('searchtitle'), $tag), $body);
示例5: list_entities_by_relationship_count
$filter_content = list_entities_by_relationship_count('friend', true, '', '', 0, 10, false);
break;
case "active":
$filter_content = elgg_view("members/online");
break;
// search based on name
// search based on name
case "search":
set_context('search');
$filter_content = list_user_search($tag);
break;
// search based on tags
// search based on tags
case "search_tags":
$filter_content = trigger_plugin_hook('search', '', $tag, "");
$filter_content .= list_entities_from_metadata("", $tag, "user", "", "", 10, false, false);
break;
case "newest":
case 'default':
$filter_content = elgg_list_entities(array('type' => 'user', 'offset' => $offset, 'full_view' => FALSE));
break;
}
// create the members navigation/filtering
$members = get_number_users();
$members_nav = elgg_view("members/members_sort_menu", array("count" => $members, "filter" => $filter));
$content = $members_nav . $filter_content;
// title
$main_content = elgg_view_title(elgg_echo("members:members"));
$main_content .= elgg_view('page_elements/contentwrapper', array('body' => $content, 'subclass' => 'members'));
$body = elgg_view_layout("sidebar_boxes", $sidebar, $main_content);
page_draw(elgg_echo('members:members'), $body);
示例6: dirname
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.com/
*/
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
$tag = get_input("tag");
$filter = get_input("filter");
if (!$filter) {
$filter = "active";
}
// Get objects
$context = get_context();
set_context('search');
if ($tag != "") {
$objects = list_entities_from_metadata('tags', $tag, 'group', "", "", $limit, false);
} else {
switch ($filter) {
case "newest":
$objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => 0, 'limit' => $limit, 'full_view' => false));
break;
case "pop":
$objects = list_entities_by_relationship_count('member', true, "", "", 0, $limit, false);
break;
case "active":
$objects = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
break;
case 'default':
$objects = elgg_list_entities(array('types' => 'group', 'limit' => $limit, 'full_view' => FALSE));
break;
}
示例7: elgg_echo
<?php
/**
* Group contents view
*
* @package ElggBlogExtended
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Diego Andrés Ramírez Aragón <diego@somosmas.org>
* @copyright Corporación Somos más - 2009
* @link http://www.somosmas.org
*
*/
?>
<div id="group_pages_widget">
<h2><?php
echo elgg_echo("group:contents");
?>
</h2>
<?php
set_context("search");
$objects = list_entities_from_metadata("content_owner", page_owner(), "object", "blog", 0, 5, false, false, false);
if (!empty($objects)) {
echo $objects;
} else {
echo elgg_echo("group:contents:empty");
}
?>
</div>
示例8: list_entities_location
/**
* List entities in a given location
*
* @param string $location Location
* @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 display per page (default: 10)
* @param true|false $fullview Whether or not to display the full view (default: true)
* @param true|false $viewtypetoggle Whether or not to allow gallery view
* @param true|false $pagination Display pagination? Default: true
* @return string A viewable list of entities
*/
function list_entities_location($location, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true)
{
return list_entities_from_metadata('location', $location, $type, $subtype, $owner_guid, $limit, $fullview, $viewtypetoggle, $navigation);
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:17,代码来源:location.php
示例9: dirname
<?php
// Load Elgg engine
include_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
// make sure only logged in users can see this page
// gatekeeper();
// set the title
$title = "Display all Educational Resources";
// start building the main column of the page
$area2 = elgg_view_title($title);
// Add the form to this section
global $CONFIG;
$members = list_entities_from_metadata('issimpleuser', 'no', 'user', '', 0, 10, false, false, true);
$area2 .= $members;
// $area2 .= $members."<br>";
// $area2 .= "<div class='contentWrapper'>";
// foreach ($members as $member)
// $area2 .= $member->name."<br>";
// $area2 .= "</div>";
$body = elgg_view_layout('one_column', $area2);
page_draw($title, $body);
示例10: page_owner_entity
* @Founder Tarun Jangra "<tarun@izap.in>"
* @link http://www.izap.in/
*
*/
$page_owner = page_owner_entity();
if (is_callable('elgg_get_entities_from_metadata')) {
$options = array('type' => 'object', 'subtype' => 'izap_videos', 'metadata_names' => 'favorited_by', 'metadata_values' => $page_owner->guid, 'count' => TRUE);
$count = elgg_get_entities_from_metadata($options);
if ($count) {
unset($options['count']);
$options['offset'] = get_input('offset', 0);
$entities = elgg_get_entities_from_metadata($options);
$entity_list = elgg_view_entity_list($entities, $count, get_input('offset', 0), 10, FALSE, FALSE, TRUE);
}
} else {
$entity_list = list_entities_from_metadata('favorited_by', $page_owner->guid, 'object', 'izap_videos', 0, 10, FALSE, FALSE);
}
if ($page_owner->guid == get_loggedin_userid()) {
$title = elgg_echo('izap_videos:my_favorites');
} else {
$title = sprintf(elgg_echo('izap_videos:user_favorites'), $page_owner->name);
}
$body = elgg_view_title($title);
if (!empty($entity_list)) {
$body .= $entity_list;
} else {
$body .= '<div class="contentWrapper">' . elgg_echo('izap_videos:no_favorites') . '</div>';
}
$body .= elgg_view('izap_videos/izapLink');
$area3 = elgg_view('izap_videos/area3');
$body = elgg_view_layout('two_column_left_sidebar', '', $body, $area3);
示例11: dirname
* Elgg file browser
*
* @package ElggFile
* @author Curverider Ltd
* @copyright Curverider Ltd 2008-2009 - 2009
* @link http://elgg.com/
*/
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
$tag = get_input("tag");
// Get the current page's owner
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
$page_owner = $_SESSION['user'];
set_page_owner($_SESSION['guid']);
}
// Get objects
$area2 = elgg_view_title($title = elgg_echo('file:type:all'));
$area1 = get_filetype_cloud();
// the filter
set_context('search');
if ($tag != "") {
$area2 .= list_entities_from_metadata('tags', $tag, 'object', 'file');
} else {
$area2 .= list_entities('object', 'file');
}
set_context('file');
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
// Finally draw the page
page_draw(sprintf(elgg_echo("file:yours"), $_SESSION['user']->name), $body);
示例12: get_context
// List tasks
$context = get_context();
$title = sprintf(elgg_echo('tasks:read'), $page_owner->name);
$area2 = elgg_view_title($title);
set_context('search');
$limit = 10;
$status = get_input('status');
if ($status == '') {
$area2 .= list_entities('object', 'tasks', page_owner(), $limit, false);
} else {
if ($status == 'open') {
$area2 .= list_entities_from_metadata('status', '0', 'object', 'tasks', page_owner(), $limit);
} elseif ($status == 'closed') {
$area2 .= list_entities_from_metadata('status', '5', 'object', 'tasks', page_owner(), $limit);
} elseif ($status == 'info') {
$area2 .= list_entities_from_metadata('status', '4', 'object', 'tasks', page_owner(), $limit);
} elseif ($status == 'testing') {
$area2 .= list_entities_from_metadata('status', '3', 'object', 'tasks', page_owner(), $limit);
} elseif ($status == 'progress') {
$area2 .= list_entities_from_metadata('status', '2', 'object', 'tasks', page_owner(), $limit);
} elseif ($status == 'assigned') {
$area2 .= list_entities_from_metadata('status', '1', 'object', 'tasks', page_owner(), $limit);
}
}
set_context('tasks');
$area2 .= elgg_view_entity_list($items, count($items), 0, 20, false, false, true);
set_context($context);
// Format page
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
// Draw it
echo page_draw($title, $body);
示例13: get_input
<?php
global $CONFIG;
// get filter
$category = get_input('category');
$category_label = $CONFIG->plugincats[$category];
$title = sprintf(elgg_echo('plugins:category:title'), $category_label);
// Get objects
set_context('search');
if ($category) {
if ($category == 'all') {
$title = sprintf(elgg_echo('plugins:category:title'), elgg_echo('plugins:cat:all'));
$list = list_entities('object', 'plugin_project', 0, 10, true, false, true);
} else {
$list = list_entities_from_metadata("plugincat", $category, "object", "plugin_project", 0, 10, true, false, true);
}
}
set_context('plugins');
$sidebar = elgg_view('plugins/search/sidebar');
$main = elgg_view('plugins/search/main', array('area1' => $list));
$body = elgg_view_layout('plugins_layout', $main, $sidebar);
page_draw($title, $body);
示例14: list_entities
<?php
/**
* Elgg vazco_mainpage plugin
*
* @author Michal Zacher [michal.zacher@gmail.com]
*/
if (is_plugin_enabled('groups')) {
//newest groups
$groups = list_entities('group', '', 0, 4, false, false, false);
$groups = list_entities_from_metadata("featured_group", "yes", "group", "", 0, 10);
?>
<!-- display latest groups -->
<div class="index_box">
<h2><?php
echo elgg_echo("custom:featuredgroups");
?>
</h2>
<?php
if (!empty($groups)) {
echo $groups;
//this will display groups
} else {
echo "<p><?php echo elgg_echo('custom:nogroups'); ?>.</p>";
}
?>
</div>
<?php
}
示例15: elgg_echo
$html = elgg_echo('content:search:no-result');
}
$pagination = display_pager($current_page, $number_of_results, $page_size, '?tag=' . $tag . '&searchType=' . $searchType);
$results_found_message = '';
if ($number_of_results) {
$results_found_message = elgg_echo('content:search:results-found') . $number_of_results;
}
$body = $pagination . $html . $pagination . $results_found_message;
} else {
if ($searchType == 'users') {
$tag = get_input('tag');
$objecttype = 'user';
$title = 'users';
// $pagination = display_pager($current_page, $number_of_results, $page_size, '?tag=' . $tag . '&searchType=' . $searchType);
if (!empty($tag)) {
$body = list_user_search($tag, $page_size);
}
} elseif ($searchType == 'tags') {
if (!empty($tag)) {
$body = "";
//$meta_name, $meta_value = "", $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
$body .= list_entities_from_metadata('tags', $tag, $objecttype, $subtype, $owner_guid_array, $page_size, false, false, true);
}
}
}
} else {
$body = elgg_echo(empty($tag) ? 'content:search:no-result' : 'content:search:too-short');
}
//$body = $body;
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
page_draw(elgg_echo('search'), $body);