本文整理汇总了PHP中listEntities函数的典型用法代码示例。如果您正苦于以下问题:PHP listEntities函数的具体用法?PHP listEntities怎么用?PHP listEntities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了listEntities函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$limit = getInput("limit", 10);
$offset = getInput("offset", 0);
$count = getEntities(array("type" => "File", "count" => true, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "NULL", "operand" => "!="))));
$files = listEntities(array("type" => "File", "limit" => $limit, "offset" => $offset, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "NULL", "operand" => "!="))));
$pagination = display("page_elements/pagination", array("count" => $count, "offset" => $offset, "limit" => $limit, "url" => getSiteURL() . "files"));
$page = drawPage(array("header" => "Files", "body" => $files, "footer" => $pagination, "button" => "<a href='" . getSiteURL() . "file/upload' class='btn btn-success'>Upload a File</a>"));
$this->html = $page;
}
示例2: __construct
/**
* Creates notification page html
*/
public function __construct()
{
$user_guid = getLoggedInUserGuid();
$access = getIgnoreAccess();
setIgnoreAccess();
$notifications = listEntities(array("type" => "Notification", "metadata_name" => "owner_guid", "metadata_value" => $user_guid));
setIgnoreAccess($access);
$buttons = getSiteURL() . "action/deleteAllNotifications/{$user_guid}";
$buttons = addTokenToURL($buttons);
$buttons = "<a href='{$buttons}' class='btn btn-danger'>Dismiss All</a>";
$page = drawPage(array("header" => "Notifications", "body" => $notifications, "button" => $buttons));
$this->html = $page;
}
示例3: __construct
/**
* Creates html for activity page
*/
public function __construct()
{
switch (pageArray(1)) {
default:
case "all":
$this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0));
break;
case "mine":
$this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => getLoggedInUserGuid());
break;
case "friends":
$this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => "('" . FriendsPlugin::getFriendGuidCSString(getLoggedInUser()) . "')", "operand" => "IN");
break;
}
$this->params['count'] = true;
$this->count = getEntities($this->params);
unset($this->params['count']);
$this->params['limit'] = 10;
$entities = listEntities($this->params);
$pagination = display("page_elements/pagination", array("count" => $this->count, "offset" => getInput("offset"), "limit" => $this->limit, "url" => "activity"));
$this->tabs = display("page_elements/tabs", array("tabs" => array("All" => getSiteURL() . "activity", "Mine" => getSiteURL() . "activity/mine", "Friends" => getSiteURL() . "activity/friends")));
$this->html = drawPage(array("header" => "Activity", "body" => $this->tabs . $entities . $pagination));
}
示例4: denyDirect
<?php
/* * ***********************************************************************
*
* SocialApparatus CONFIDENTIAL
* __________________
*
* [2002] - [2017] SocialApparatus (http://SocialApparatus.co)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$limit = 10;
$offset = getInput("offset", 0);
$count = getEntities(array("type" => "Activity", "count" => true));
$activity = listEntities(array("type" => "Activity", "limit" => $limit, "offset" => $offset, "order_by" => "time_created"));
$pagination = display("page_elements/pagination", array("count" => $count, "limit" => $limit, "offset" => $offset, "url" => getSiteURL() . "activity/all"));
echo $activity . $pagination;
示例5: denyDirect
denyDirect();
$filter = getInput('filter');
$offset = getInput("offset", 0);
$params = array("type" => "User", "order_by" => "time_created", "order_reverse" => true, "limit" => 5, "offset" => $offset);
if ($filter) {
$metadata_name_value_pairs = array();
foreach ($filter as $key => $value) {
$metadata_name_value_pairs[] = array("name" => $key, "value" => $value);
}
$params['metadata_name_value_pairs'] = $metadata_name_value_pairs;
}
$first_member = getEntity($params);
if ($first_member) {
$guid = $first_member->guid;
}
$members = listEntities($params);
unset($params['limit']);
unset($params['offset']);
$params['count'] = true;
$count = getEntities($params);
echo display("members:before");
?>
<div class="row">
<div class="col-md-3 col-sm-12 col-xs-12">
<?php
echo $members;
?>
</div>
<div class="col-md-9 hidden-xs hidden-sm" id="member_wrapper">
<?php
if ($members) {
示例6: denyDirect
<?php
/* * ***********************************************************************
*
* SocialApparatus CONFIDENTIAL
* __________________
*
* [2002] - [2017] SocialApparatus (http://SocialApparatus.co)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$blogs = listEntities(array("type" => "Blog", "limit" => 5, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => getLoggedInUserGuid()));
$count = getEntities(array("type" => "Blog", "count" => true, "metadata_name" => "owner_guid", "metadata_value" => getLoggedInUserGuid()));
echo $blogs;
echo display("page_elements/pagination", array("url" => getSiteURL() . "blogs/my_blogs", "offset" => getInput("offset", 0), "limit" => 5, "count" => $count));
示例7: Vars
$wrapper_class = Vars("wrapper_class");
$title = Vars("title");
$panel = Vars("panel");
$wrapper_id = "entity_list_{$id}";
if (!$wrapper) {
$wrapper = "div";
}
$wrapper_header = "<{$wrapper} class='{$wrapper_class}' id='{$wrapper_id}'>";
$wrapper_footer = "</{$wrapper}>";
if (!isset($params['limit'])) {
$params['limit'] = 10;
}
if (!isset($params['offset'])) {
$params['offset'] = 0;
}
$body = listEntities($params);
$count_shown = ($params['offset'] + 1) * $params['limit'];
$params2 = $params;
unset($params2['limit']);
unset($params2['offset']);
$params2['count'] = true;
$count = getEntities($params2);
if ($count >= $count_shown) {
$params['offset'] = $params['offset'] + $params['limit'];
$params = json_encode($params);
$button = "<button class='show_more_entities btn btn-danger btn-xs pull-right' data-count='{$count}' data-count_shown='{$count_shown}' data-params='{$params}' data-id='{$wrapper_id}'>More</button>";
} else {
$button = NULL;
}
if ($title) {
$title = <<<HTML
示例8: denyDirect
<?php
/* * ***********************************************************************
*
* SocialApparatus CONFIDENTIAL
* __________________
*
* [2002] - [2017] SocialApparatus (http://SocialApparatus.co)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$groups = listEntities(array("type" => "Group"));
echo $groups;
示例9: denyDirect
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
adminGateKeeper();
$limit = getInput("limit", 5);
$offset = getInput("offset", 0);
$access = getIgnoreAccess();
setIgnoreAccess();
$count = getEntities(array("type" => "User", "offset" => 0, "count" => true));
$users = listEntities(array("type" => "User", "limit" => $limit, "offset" => $offset));
setIgnoreAccess($access);
$pagination = display("page_elements/pagination", array("limit" => $limit, "offset" => $offset, "count" => $count, "url" => "admin/users"));
$body = <<<HTML
{$pagination}
{$users}
{$pagination}
HTML;
$header = "Users";
echo display("page_elements/page_header", array("text" => $header));
echo $body;
示例10: denyDirect
<?php
/* * ***********************************************************************
*
* SocialApparatus CONFIDENTIAL
* __________________
*
* [2002] - [2017] SocialApparatus (http://SocialApparatus.co)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$activity = listEntities(array("type" => "Activity", "limit" => 10, "order_by" => "time_created", "order_reverse" => true));
echo $activity;
示例11: denyDirect
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$session = getInput("session");
if ($session) {
$user = getUserFromSession($session);
$guid = Vars("guid");
$chat = getEntity($guid);
$user_guid = $user->guid == $chat->user_one ? $chat->user_two : $chat->user_one;
$user = getEntity($user_guid);
$url = $user->getURL();
$icon = $user->icon(SMALL, "media-object");
$sitename = getSiteName();
$messages = listEntities(array("type" => "Chatmessage", "metadata_name" => "container_guid", "metadata_value" => $guid));
if (!$messages) {
$messages = <<<HTML
<div class="well well-sm" style="margin-top:10px;">
<div class="media">
<div class="media-left">
<a href="{$url}">
{$icon}
</a>
</div>
<div class="media-body">
<div class="media-heading"><a href='{$url}'>{$user->full_name}</a></div>
<small>You're friends on {$sitename}.</small>
</div>
</div>
</div>
示例12: denyDirect
<?php
/* * ***********************************************************************
*
* SocialApparatus CONFIDENTIAL
* __________________
*
* [2002] - [2017] SocialApparatus (http://SocialApparatus.co)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$blogs = listEntities(array("type" => "Blog", "limit" => 5, "offset" => getInput("offset", 0)));
$count = getEntities(array("type" => "Blog", "count" => true));
echo $blogs;
echo display("page_elements/pagination", array("url" => getSiteURL() . "blogs/all_blogs", "offset" => getInput("offset", 0), "limit" => 5, "count" => $count));
示例13: denyDirect
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$latest_members = listEntities(array("type" => "User", "view_type" => "gallery", "limit" => 9, "order_by" => "time_created", "order_reverse" => true));
?>
<div class="panel-group" id="accordion">
<div class="panel panel-default" id="panel1">
<div class="panel-heading">
<h4 class="panel-title">
Latest Members
</h4>
</div>
<div class="panel-body">
<?php
echo $latest_members;
?>
</div>
</div>
示例14: listEntities
$reverse = false;
}
$count = Vars::get("count");
$offset = Vars::get("offset");
if (!$offset) {
$offset = 0;
}
if (!$count) {
$count = 4;
}
if ($reverse) {
$data_reverse = "true";
} else {
$data_reverse = "false";
}
$comments = listEntities(array("type" => "Comment", "metadata_name" => "container_guid", "metadata_value" => $guid, "limit" => $count, "offset" => $offset, "order_reverse" => $reverse, "order_by" => "time_created"));
$comment_count = getEntities(array("type" => "Comment", "metadata_name" => "container_guid", "metadata_value" => $guid, "count" => true));
$next_offset = $offset + $count;
$comments_left = $comment_count - ($offset + $count);
echo <<<HTML
{$comments}
HTML;
if ($comments_left > 0) {
$view_more = $comments_left < $count ? $comments_left : 10;
echo <<<HTML
<div class='text-center'>
<div class='bar-loader'></div>
<a class='btn btn-danger btn-xs more_comments' data-reverse='{$data_reverse}' data-guid='{$guid}' data-offset='{$next_offset}'>Show More</a>
</center>
HTML;
}
示例15: denyDirect
<?php
/* * ***********************************************************************
*
* SocialApparatus CONFIDENTIAL
* __________________
*
* [2002] - [2017] SocialApparatus (http://SocialApparatus.co)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$chat_boxes = listEntities(array("type" => "Chat", "metadata_name_value_pairs" => array(array("name" => "user_one", "value" => getLoggedInUserGuid()), array("name" => "user_two", "value" => getLoggedInUserGuid())), "metadata_name_value_pairs_operand" => "OR"));
echo "<div class='container' style='position:relative;'>";
echo $chat_boxes;
echo "</div>";