本文整理汇总了PHP中get_entities函数的典型用法代码示例。如果您正苦于以下问题:PHP get_entities函数的具体用法?PHP get_entities怎么用?PHP get_entities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_entities函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: openid_server_delete_entities
function openid_server_delete_entities($type = "", $subtype = "", $owner_guid = 0)
{
$entities = get_entities($type, $subtype, $owner_guid, "time_created desc", 0);
foreach ($entities as $entity) {
openid_server_delete_entity($entity);
}
return true;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:8,代码来源:openid_server_include.php
示例2: form_set_group_profile_categories
function form_set_group_profile_categories($group_profile_categories)
{
$form_config = get_entities('object', 'form:config');
if (!$form_config) {
$form_config = new ElggObject();
$form_config->subtype = 'form:config';
$form_config->owner_guid = $_SESSION['user']->getGUID();
$form_config->access_id = ACCESS_PUBLIC;
} else {
$form_config = $form_config[0];
}
$form_config->group_profile_categories = $group_profile_categories;
$form_config->save();
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:14,代码来源:profile.php
示例3: get_entities
<?php
/**
* Elgg thewire view page
*
* @package ElggTheWire
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider <[email protected]>
* @copyright Curverider Ltd 2008-2009
* @link http://elgg.com/
*
*/
//grab the current site message
$site_message = get_entities("object", "sitemessage", 0, "", 1);
foreach ($site_message as $mes) {
$message = $mes->description;
$dateStamp = friendly_time($mes->time_created);
$delete = elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/riverdashboard/delete?message=" . $mes->guid, 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm')));
}
?>
<div class="sidebarBox">
<?php
//if there is a site message
if ($site_message) {
?>
<?php
echo "<h3>" . elgg_echo("sitemessages:announcements") . "</h3>";
echo "<p><small>" . elgg_echo("sitemessages:posted") . ": " . $dateStamp;
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:sitemessage.php
示例4: setSWTimestampForUser
/**
* Set the last-checked value for this context to npw.
*
* @param unknown_type $guid
* @param unknown_type $context
* @return unknown
*/
function setSWTimestampForUser($guid, $context)
{
$timestamps = get_entities("object", "sw_timestamp", $guid);
$timestamp = "";
if (!empty($timestamps)) {
foreach ($timestamps as $t) {
if ($t->description == $context) {
$timestamp = $t;
break;
}
}
}
if (empty($timestamp)) {
$timestamp = new ElggObject();
$timestamp->owner_guid = $guid;
$timestamp->container_guid = $guid;
$timestamp->subtype = 'sw_timestamp';
$timestamp->access_id = 2;
$timestamp->title = "SW Timestamp";
$timestamp->description = $context;
}
$ctx = get_context();
set_context('add_sticky_widgets');
$timestamp->save();
set_context($ctx);
// $timestamp->description = time();
return $timestamp->time_updated;
}
开发者ID:ssuppe,项目名称:sticky_widgets,代码行数:35,代码来源:functions.php
示例5: count_user_friends_objects
/**
* Counts the number of objects owned by a user's friends
*
* @param int $user_guid The GUID of the user to get the friends of
* @param string $subtype Optionally, the subtype of objects
* @return int The number of objects
*/
function count_user_friends_objects($user_guid, $subtype = "")
{
if ($friends = get_user_friends($user_guid, $subtype, 999999, 0)) {
$friendguids = array();
foreach ($friends as $friend) {
$friendguids[] = $friend->getGUID();
}
return get_entities('object', $subtype, $friendguids, "time_created desc", $limit, $offset, true, 0, $friendguids);
}
return 0;
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:18,代码来源:users.php
示例6: unset
if (!empty($object)) {
$object->metadata_name = $name;
if (!empty($label)) {
$object->metadata_label = $label;
} else {
unset($object->metadata_label);
}
// add relationship
remove_entity_relationships($object->guid, CUSTOM_PROFILE_FIELDS_PROFILE_TYPE_CATEGORY_RELATIONSHIP);
if (!empty($profile_types) && is_array($profile_types)) {
foreach ($profile_types as $type) {
add_entity_relationship($type, CUSTOM_PROFILE_FIELDS_PROFILE_TYPE_CATEGORY_RELATIONSHIP, $object->guid);
}
}
// add correct order
$count = get_entities("object", CUSTOM_PROFILE_FIELDS_CATEGORY_SUBTYPE, null, null, null, null, true);
if ($add) {
$object->order = $count;
}
if ($object->save()) {
system_message(elgg_echo("profile_manager:action:category:add:succes"));
} else {
register_error(elgg_echo("profile_manager:action:category:add:error:save"));
}
} else {
register_error(elgg_echo("profile_manager:action:category:add:error:object"));
}
} else {
register_error(elgg_echo("profile_manager:action:category:add:error:name"));
}
forward($_SERVER["HTTP_REFERER"]);
开发者ID:eokyere,项目名称:elgg,代码行数:31,代码来源:add.php
示例7: dirname
<?php
require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/thickboxlibraries.php";
//set owner to site admin.
$owner = VAZCO_AVATAR_ADMIN;
$limit = 100;
$avatars = get_entities("object", "avatar", $owner, "", $limit, 0, false);
?>
<div class="contentWrapper">
<div id="profile_picture_croppingtool">
<label><?php
echo elgg_echo('vazco_avatar:select:description');
?>
</label>
<br/>
<?php
echo elgg_echo('vazco_avatar:select:clicktochose');
?>
<div id="tidypics_album_widget_container">
<div class="avatar_container">
<?php
$counter = -1;
echo '<div class="avatar_wrapper">';
foreach ($avatars as $avatar) {
$counter++;
if ($counter == 5) {
echo '</div><div class="avatar_wrapper">';
$counter = 0;
}
echo '<div class="avatar_box">';
echo '<div class="avatar_icon_container"><a class="thickbox" href="' . $vars['url'] . 'mod/vazco_avatar/avatar.php?file_guid=' . $avatar->guid . '&size=large"><img class="avatar_icon" src="' . $vars['url'] . 'mod/vazco_avatar/avatar.php?file_guid=' . $avatar->guid . '" border="0" class="tidypics_album_cover" alt="avatar' . $avatar->guid . '"/></a></div>';
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:select.php
示例8: get_input
<?php
// This page can only be run from within the Elgg framework
if (!is_callable('elgg_view')) {
exit;
}
// Get the name of the form field we need to inject into
$internalname = get_input('internalname');
if (!isloggedin()) {
exit;
}
global $SESSION;
$offset = (int) get_input('offset', 0);
$simpletype = get_input('simpletype');
$entity_types = array('object' => array('file'));
if (empty($simpletype)) {
$count = get_entities('object', 'file', $SESSION['user']->guid, '', null, null, true);
$entities = get_entities('object', 'file', $SESSION['user']->guid, '', 6, $offset);
} else {
$count = get_entities_from_metadata('simpletype', $simpletype, 'object', 'file', $SESSION['user']->guid, 6, $offset, '', 0, true);
$entities = get_entities_from_metadata('simpletype', $simpletype, 'object', 'file', $SESSION['user']->guid, 6, $offset, '', 0, false);
}
$types = get_tags(0, 10, 'simpletype', 'object', 'file', $SESSION['user']->guid);
// Echo the embed view
echo elgg_view('embed/media', array('entities' => $entities, 'internalname' => $internalname, 'offset' => $offset, 'count' => $count, 'simpletype' => $simpletype, 'limit' => 6, 'simpletypes' => $types));
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:25,代码来源:embed.php
示例9: get_entities
<?php
/**
* Profile Manager
*
* Group Fields list view
*
* @package profile_manager
* @author ColdTrick IT Solutions
* @copyright Coldtrick IT Solutions 2009
* @link http://www.coldtrick.com/
*/
$count = get_entities("object", CUSTOM_PROFILE_FIELDS_GROUP_SUBTYPE, 0, "", null, null, true);
$fields = get_entities("object", CUSTOM_PROFILE_FIELDS_GROUP_SUBTYPE, 0, "", $count, 0);
$ordered = array();
if ($count > 0) {
foreach ($fields as $field) {
$ordered[$field->order] = $field;
}
ksort($ordered);
}
$list = elgg_view_entity_list($ordered, $count, 0, $count, false, false, false);
?>
<div id="custom_fields_ordering" class="custom_fields_ordering_group">
<?php
echo $list;
?>
</div>
开发者ID:eokyere,项目名称:elgg,代码行数:28,代码来源:list.php
示例10: page_owner_entity
*
* @package Elgg videotizer, by iZAP Web Solutions.
* @license GNU Public License version 3
* @Contact iZAP Team "<[email protected]>"
* @Founder Tarun Jangra "<[email protected]>"
* @link http://www.izap.in/
*
*/
global $CONFIG;
$page_owner = page_owner_entity();
if ($vars['entity']->izap_videos_enable != 'no') {
echo '<div id="izap_widget_layout">';
echo '<h2>' . elgg_echo('izap_videos:groupvideos') . '</h2>';
$options['type'] = 'object';
$options['subtype'] = 'izap_videos';
$options['container_guid'] = $page_owner->guid;
if (is_old_elgg()) {
$videos = get_entities('object', 'izap_videos', $page_owner->guid);
} else {
$videos = elgg_get_entities($options);
}
if ($videos) {
echo '<div class="group_video_wrap">';
echo elgg_view('izap_videos/videos_bunch', array('videos' => $videos, 'title_length' => 30, 'wrap' => FALSE));
echo '<div class="view_all"><a href="' . $CONFIG->wwwroot . 'pg/videos/list/' . $page_owner->username . '">' . elgg_echo('izap_videos:view_all') . '</a></div>';
echo '</div>';
} else {
echo '<div class="forum_latest">' . elgg_echo('izap_videos:notfound') . '</div>';
}
echo '<div class="clearfloat"></div></div>';
}
开发者ID:rimpy,项目名称:izap_videos,代码行数:31,代码来源:gruopVideos.php
示例11: find_plugin_settings
/**
* Shorthand function for finding the plugin settings.
*
* @param string $plugin_name Optional plugin name, if not specified then it is detected from where you
* are calling from.
*/
function find_plugin_settings($plugin_name = "")
{
$plugins = get_entities('object', 'plugin');
$plugin_name = sanitise_string($plugin_name);
if (!$plugin_name) {
$plugin_name = get_plugin_name();
}
if ($plugins) {
foreach ($plugins as $plugin) {
if (strcmp($plugin->title, $plugin_name) == 0) {
return $plugin;
}
}
}
return false;
}
开发者ID:eokyere,项目名称:elgg,代码行数:22,代码来源:plugins.php
示例12: list_registered_entities
/**
* Returns a viewable list of entities based on the registered types
*
* @see elgg_view_entity_list
*
* @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
* @return string A viewable list of entities
*/
function list_registered_entities($owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $allowedtypes = true)
{
$typearray = array();
if ($object_types = get_registered_entity_types()) {
foreach ($object_types as $object_type => $subtype_array) {
if (is_array($subtype_array) && sizeof($subtype_array) && (in_array($object_type, $allowedtypes) || $allowedtypes === true)) {
foreach ($subtype_array as $object_subtype) {
$typearray[$object_type][] = $object_subtype;
}
}
}
}
$offset = (int) get_input('offset');
$count = get_entities('', $typearray, $owner_guid, "", $limit, $offset, true);
$entities = get_entities('', $typearray, $owner_guid, "", $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle);
}
开发者ID:jricher,项目名称:Elgg,代码行数:30,代码来源:entities.php
示例13: foreach
if ($fieldtype == CUSTOM_PROFILE_FIELDS_PROFILE_SUBTYPE || $fieldtype == CUSTOM_PROFILE_FIELDS_GROUP_SUBTYPE) {
$headers = "";
foreach ($fields as $field) {
if (!empty($headers)) {
$headers .= $fielddelimiter . " ";
}
$headers .= $field;
}
echo $headers . PHP_EOL;
if ($fieldtype == CUSTOM_PROFILE_FIELDS_PROFILE_SUBTYPE) {
$type = "user";
} else {
$type = "group";
}
$entities_count = get_entities($type, "", null, null, null, null, true);
$entities = get_entities($type, "", null, null, $entities_count);
foreach ($entities as $entity) {
$row = "";
foreach ($fields as $field) {
if (!empty($row)) {
$row .= $fielddelimiter . " ";
}
$field_data = $entity->{$field};
if (is_array($field_data)) {
$field_data = implode(",", $field_data);
}
$row .= utf8_decode($field_data);
}
echo $row . PHP_EOL;
}
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:export.php
示例14: action_gatekeeper
*
* Action to import from default
*
* @package profile_manager
* @author ColdTrick IT Solutions
* @copyright Coldtrick IT Solutions 2009
* @link http://www.coldtrick.com/
*/
global $CONFIG;
action_gatekeeper();
admin_gatekeeper();
$type = get_input("type", "profile");
if ($type == "profile" || $type == "group") {
$added = 0;
$defaults = array();
$max_fields = get_entities("object", "custom_" . $type . "_field", $CONFIG->site_guid, null, null, null, true) + 1;
if ($type == "profile") {
// Profile defaults
$defaults = array('description' => 'longtext', 'briefdescription' => 'text', 'location' => 'tags', 'interests' => 'tags', 'skills' => 'tags', 'contactemail' => 'email', 'phone' => 'text', 'mobile' => 'text', 'website' => 'url');
} elseif ($type == "group") {
// Group defaults
$defaults = array('description' => 'longtext', 'briefdescription' => 'text', 'interests' => 'tags', 'website' => 'url');
}
foreach ($defaults as $metadata_name => $metadata_type) {
$count = get_entities_from_metadata("metadata_name", $metadata_name, "object", "custom_" . $type . "_field", $CONFIG->site_guid, "", null, null, null, true);
if ($count == 0) {
$field = new ElggObject();
$field->owner_guid = $CONFIG->site_guid;
$field->container_guid = $CONFIG->site_guid;
$field->access_id = ACCESS_PUBLIC;
$field->subtype = "custom_" . $type . "_field";
开发者ID:eokyere,项目名称:elgg,代码行数:31,代码来源:importFromDefault.php
示例15: defaultwidgets_reset_access
function defaultwidgets_reset_access($event, $object_type, $object)
{
global $defaultwidget_access;
// turn on permissions override
$defaultwidget_access = true;
// the widgets are disabled, so turn on the ability to see disabled entities
$access_status = access_get_show_hidden_status();
access_show_hidden_entities(true);
$widgets = get_entities('object', 'widget', $object->getGUID());
if ($widgets) {
foreach ($widgets as $widget) {
$widget->access_id = get_default_access();
$widget->save();
}
}
access_show_hidden_entities($access_status);
// turn off permissions override
$defaultwidget_access = false;
return true;
}
开发者ID:eokyere,项目名称:elgg,代码行数:20,代码来源:start.php
示例16: elgg_view_title
<?php
/**
* iZAP izap_videos
*
* @package Elgg videotizer, by iZAP Web Solutions.
* @license GNU Public License version 3
* @Contact iZAP Team "<[email protected]>"
* @Founder Tarun Jangra "<[email protected]>"
* @link http://www.izap.in/
*
*/
global $CONFIG;
$video = $vars['video'];
$videos = $video->getRelatedVideos();
if ($videos) {
echo elgg_view_title(elgg_echo('izap_videos:related_videos'));
echo elgg_view('izap_videos/videos_bunch', array('videos' => $videos));
}
$options['type'] = 'object';
$options['subtype'] = 'izap_videos';
$options['limit'] = 10;
if (is_old_elgg()) {
$videos = get_entities($options['type'], $options['subtype'], 0, '', $options['subtype']);
} else {
$videos = elgg_get_entities($options);
}
if ($videos) {
echo elgg_view_title(elgg_echo('izap_videos:latest'));
echo elgg_view('izap_videos/videos_bunch', array('videos' => $videos));
}
开发者ID:rimpy,项目名称:izap_videos,代码行数:31,代码来源:related.php
示例17: add_submenu_item
add_submenu_item(elgg_echo('pages:all'), $CONFIG->wwwroot . "mod/pages/world.php", 'pageslinksgeneral');
}
if ($owner instanceof ElggEntity && can_write_to_container(0, $owner->guid)) {
add_submenu_item(elgg_echo('pages:new'), $CONFIG->url . "pg/pages/new/?container_guid=" . page_owner(), 'pagesactions');
if ($owner instanceof ElggUser) {
add_submenu_item(elgg_echo('pages:welcome'), $CONFIG->url . "pg/pages/welcome/", 'pagesactions');
}
}
if (is_callable('group_gatekeeper')) {
group_gatekeeper();
}
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
if ($owner instanceof ElggGroup) {
$title = sprintf(elgg_echo("pages:group"), $owner->name);
} else {
$title = sprintf(elgg_echo("pages:user"), $owner->name);
}
// Get objects
$context = get_context();
set_context('search');
$objects = list_entities("object", "page_top", page_owner(), $limit, false);
set_context($context);
//get the owners latest welcome message
$welcome_message = get_entities("object", "pages_welcome", $owner->guid, '', 1);
$body = elgg_view_title($title);
$body .= elgg_view("pages/welcome", array('entity' => $welcome_message));
$body .= $objects;
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
// Finally draw the page
page_draw($title, $body);
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:index.php
示例18: get_entities
<?php
/**
* Elgg vazco_mainpage plugin
*
* @author Michal Zacher [[email protected]]
*/
//get the newest members who have an avatar
$profs = get_entities($type = "user", $subtype = "", $owner_guid = 0, $order_by = "", $limit = 0, $offset = 0, $count = false, $site_guid = 0, $container_guid = null, $timelower = 0, $timeupper = 0);
?>
<?php
$res_count = 0;
$total_count = 0;
$query1 = "SELECT guid FROM {$CONFIG->dbprefix}_content_item_discrimination WHERE is_content_item = \"1\"";
$result1 = mysql_query($query1);
while ($row = mysql_fetch_array($result1, MYSQL_ASSOC)) {
$nikolas1 = $row['guid'];
if (get_entity($nikolas1)) {
$res_count++;
}
}
$query3 = "SELECT distinct e.* from elggentities e join elggusers_entity u on e.guid = u.guid JOIN (SELECT subm1.*, s1.string FROM elggmetadata subm1 JOIN elggmetastrings s1 ON subm1.value_id = s1.id) AS m1 ON e.guid = m1.entity_guid where ((m1.name_id='925' AND m1.string like '%.%')) and ( (1 = 1) and e.enabled='yes') and ( (1 = 1) and m1.enabled='yes') order by e.time_created desc limit 0,100000000";
$result3 = mysql_query($query3);
while ($row = mysql_fetch_array($result3, MYSQL_ASSOC)) {
$repc1++;
}
$query4 = "SELECT elgg_content_item_discrimination.guid FROM elgg_content_item_discrimination INNER JOIN elggentity_relationships ON elgg_content_item_discrimination.guid=elggentity_relationships.guid_two";
$result4 = mysql_query($query4);
while ($row = mysql_fetch_array($result4, MYSQL_ASSOC)) {
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:members_ajax.php
示例19: page_owner_entity
* @author Milan Magudia & Curverider
* @copyright HedgeHogs.net & Curverider Ltd
*
**/
// set some defaults
$owner = page_owner_entity();
$context = $vars['context'];
$area1widgets = false;
$area2widgets = false;
$area3widgets = false;
// get available widget types
set_context($context);
$widgettypes = get_widget_types();
set_context('admin');
// get the entities for the module
$entities = get_entities("object", "moddefaultwidgets", 0, "", 9999);
// check if the entity exists
if (isset($entities[0])) {
// get the widgets for the context
$entity = $entities[0];
$current_widgets = $entity->{$context};
list($left, $middle, $right) = split('%%', $current_widgets);
// split columns into seperate widgets
$area1widgets = split('::', $left);
$area2widgets = split('::', $middle);
$area3widgets = split('::', $right);
// clear out variables if no widgets are available
if ($area1widgets[0] == "") {
$area1widgets = false;
}
if ($area2widgets[0] == "") {
开发者ID:eokyere,项目名称:elgg,代码行数:31,代码来源:editor.php
示例20: elgg_echo
*
* @package profile_manager
* @author ColdTrick IT Solutions
* @copyright Coldtrick IT Solutions 2009
* @link http://www.coldtrick.com/
*/
$formbody = "<table class='custom_fields_add_form_table'>\n";
$formbody .= "<tr>\n";
$formbody .= "<td class='custom_fields_add_form_table_left'>\n";
$formbody .= elgg_echo('profile_manager:admin:metadata_name') . ":";
$formbody .= elgg_view('input/text', array('internalname' => 'metadata_name'));
$formbody .= "</td>\n";
$formbody .= "<td rowspan='2' class='custom_fields_add_form_table_right'>\n";
$type_count = get_entities("object", CUSTOM_PROFILE_FIELDS_PROFILE_TYPE_SUBTYPE, null, null, null, null, true);
if ($type_count > 0) {
$types = get_entities("object", CUSTOM_PROFILE_FIELDS_PROFILE_TYPE_SUBTYPE, null, null, $type_count);
$options = array();
foreach ($types as $type) {
$title = $type->getTitle();
$options[$title] = $type->guid;
}
$formbody .= elgg_view("input/checkboxes", array("internalname" => "profile_types", "options" => $options));
} else {
$formbody .= " ";
}
$formbody .= "</td>\n";
$formbody .= "</tr>\n";
$formbody .= "<tr>\n";
$formbody .= "<td>\n";
$formbody .= elgg_echo('profile_manager:admin:metadata_label') . "*:";
$formbody .= elgg_view('input/text', array('internalname' => 'metadata_label'));
开发者ID:eokyere,项目名称:elgg,代码行数:31,代码来源:add.php
注:本文中的get_entities函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论