本文整理汇总了PHP中getLoggedInUserGuid函数的典型用法代码示例。如果您正苦于以下问题:PHP getLoggedInUserGuid函数的具体用法?PHP getLoggedInUserGuid怎么用?PHP getLoggedInUserGuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLoggedInUserGuid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$editor = getInput("editor_id");
if (file_exists($_FILES['avatar']['tmp_name'])) {
// Check if General album exists
$album = getEntity(array("type" => "Photoalbum", "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "General"))));
$photo = new Photo();
$photo->owner_guid = getLoggedInUserGuid();
$photo->save();
$photo->createAvatar();
if (!$album) {
$album = new Photoalbum();
$album->title = "General";
$album->owner_guid = getLoggedInUserGuid();
$album->access_id = "public";
Image::copyAvatar($photo, $album);
$album->save();
}
$photo->container_guid = $album->guid;
if (!$album->title != "Profile Avatars" && $album->title != "General") {
new Activity(getLoggedInUserGuid(), "activity:add:photo", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $album->getURL(), $album->title, "<a href='" . $album->getURL() . "'>" . $photo->icon(EXTRALARGE, "img-responsive") . "</a>"), $album->access_id);
}
$photo->save();
forward(false, array("insertphoto" => $photo->guid, "editor" => $editor));
} else {
forward();
}
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:28,代码来源:UploadPhotoActionHandler.php
示例2: __construct
public function __construct()
{
gateKeeper();
$title = getInput("title");
$description = getInput("description");
$access_id = getInput("access_id");
$membership = getInput("membership");
$group = new Group();
$group->title = $title;
$group->description = $description;
$group->access_id = $access_id;
$group->membership = $membership;
$group->owner_guid = getLoggedInUserGuid();
$group->save();
$group->createAvatar();
$test = getEntity(array("type" => "Groupmembership", "metadata_name_value_pairs" => array(array("name" => "group", "value" => $group->guid), array("name" => "member_guid", "value" => getLoggedInUserGuid()))));
if (!$test) {
$group_membership = new Groupmembership();
$group_membership->group = $group->guid;
$group_membership->member_guid = getLoggedInUserGuid();
$group_membership->access_id = "system";
$group_membership->save();
}
new Activity(getLoggedInUserGuid(), "group:created", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $group->getURL(), $group->title), $group->guid);
new SystemMessage("Your group has been created.");
forward("groups");
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:27,代码来源:CreateGroupActionHandler.php
示例3: __construct
function __construct()
{
$guid = getInput("guid");
$reply = getInput("reply");
if (!$reply) {
new SystemMessage("Message body cannot be left empty.");
forward();
}
$message = getEntity($guid);
$to = getLoggedInUserGuid() == $message->to ? $message->from : $message->to;
$from = getLoggedInUserGuid();
$to_user = getEntity($to);
$from_user = getEntity($from);
$message_element = new Messageelement();
$message_element->message = $reply;
$message_element->to = $to;
$message_element->from = $from;
$message_element->container_guid = $guid;
$message_element->save();
$link = getSiteURL() . "messages";
notifyUser("message", $to, getLoggedInUserGuid(), $to);
sendEmail(array("to" => array("name" => $to_user->full_name, "email" => $to_user->email), "from" => array("name" => getSiteName(), "email" => getSiteEmail()), "subject" => "You have a new message from " . getLoggedInUser()->full_name, "body" => "You have received a new message from " . getLoggedInUser()->full_name . "<br/><a href='{$link}'>Click here to view it.</a>", "html" => true));
new SystemMessage("Your message has been sent.");
forward("messages/" . $message->guid);
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:MessageReplyActionHandler.php
示例4: loggedInUserCanJoin
static function loggedInUserCanJoin($group)
{
if (!is_object($group)) {
$group = getEntity($group);
}
$membership = $group->membership;
// check to see if already a member
$is_member = getEntity(array("type" => "Groupmembership", "metadata_name_value_pairs" => array(array("name" => "group", "value" => $group->guid), array("name" => "member_guid", "value" => getLoggedInuserGuid()))));
if ($is_member) {
return false;
}
switch ($membership) {
case "public":
return true;
break;
case "friends":
if (isEnabledPlugin("Friends")) {
if (FriendsPlugin::friends(getLoggedInUserGuid(), $group->owner_guid)) {
return true;
}
} else {
return true;
}
break;
}
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:26,代码来源:GroupsPlugin.php
示例5: init
public function init($entity)
{
if ($entity->owner_guid == getLoggedInUserGuid()) {
return true;
}
return false;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:7,代码来源:PrivateAccessHandler.php
示例6: __construct
public function __construct()
{
gateKeeper();
$user = getLoggedInUser();
$user->createAvatar();
if (isEnabledPlugin("photos")) {
$album = getEntity(array("type" => "Photoalbum", "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "Profile Avatars"))));
$photo = new Photo();
$photo->owner_guid = getLoggedInUserGuid();
$photo_guid = $photo->save();
Image::copyAvatar($user, $photo);
$photo = getEntity($photo_guid);
if (!$album) {
$album = new Photoalbum();
$album->owner_guid = getLoggedInUserGuid();
$album->title = "Profile Avatars";
$album_guid = $album->save();
$album = getEntity($album_guid);
Image::copyAvatar($photo, $album);
}
$photo->container_guid = $album->guid;
$photo->save();
}
runHook("action:edit_avatar:after", array("user" => $user));
new Activity(getLoggedInUserGuid(), "activity:avatar:updated", array($user->getURL(), $user->full_name));
new SystemMessage("Your avatar has been uploaded.");
forward("profile/" . $user->guid);
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:28,代码来源:EditAvatarActionHandler.php
示例7: __construct
public function __construct()
{
gateKeeper();
$guid = getInput("guid");
$title = getInput("blog_title");
$description = getInput("description");
$access_id = getInput("access_id");
$container_guid = getInput("container_guid");
$owner_guid = getLoggedInUserGuid();
if ($guid) {
$blog = getEntity($guid);
} else {
$blog = new Blog();
}
$blog->title = $title;
$blog->description = $description;
$blog->access_id = $access_id;
$blog->owner_guid = $owner_guid;
$blog->status = "published";
$blog->container_guid = $container_guid;
$blog->save();
new Activity(getLoggedInUserGuid(), "blog:add", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $blog->getURL(), $blog->title, truncate($blog->description)), "", $access_id);
new SystemMessage("Your blog has been published");
forward("blogs/all_blogs");
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:AddBlogActionHandler.php
示例8: __construct
function __construct($data)
{
$guid = $data['guid'];
$text = $data['text'];
$chat_message = new Chatmessage();
$chat_message->text = $text;
$chat_message->owner_guid = getLoggedInUserGuid();
$chat_message->container_guid = $guid;
$chat_message->save();
// If recipient is offline, send them an email
$chat = getEntity($guid);
if (getLoggedInUserGuid() == $chat->user_one) {
$recipient_guid = $chat->user_two;
} else {
$recipient_guid = $chat->user_one;
}
$recipient = getEntity($recipient_guid);
if ($recipient->online == "false") {
$offline_chats = $recipient->offline_chats;
if (!is_array($offline_chats)) {
$offline_chats = array(getLoggedInUserGuid());
$recipient->offline_chats = $offline_chats;
$recipient->save();
}
if (!in_array(getLoggedInUserGuid(), $recipient->offline_chats)) {
$recipient->offline_chats[] = getLoggedInUserGuid();
$recipient->save();
}
$setting = $recipient->notify_offline_chat;
if ($setting == "yes") {
new Email(array("to" => array("name" => "", "email" => ""), "from" => array("name" => "", "email" => ""), "subject" => translate("offline_message_email_subject"), "body" => translate("offline_message_email_body"), "html" => true));
}
}
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:34,代码来源:AddChatMessageActionHandler.php
示例9: init
public function init($entity)
{
if (FriendsPlugin::friends($entity->owner_guid, getLoggedInUserGuid())) {
return true;
}
return false;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:7,代码来源:FriendsAccessHandler.php
示例10: __construct
public function __construct()
{
$title = getInput("title");
$description = getInput("description");
// Create filestore object to store file information
$file = new File();
$file->title = $title;
$file->description = $description;
$file->owner_guid = getLoggedInUserGuid();
$file->access_id = "public";
$file->container_guid = getInput("container_guid");
$guid = $file->save();
uploadFile("file", $guid, getLoggedInUserGuid());
$file = getEntity($guid);
Image::createThumbnail($file->guid, TINY);
Image::createThumbnail($file->guid, SMALL);
Image::createThumbnail($file->guid, MEDIUM);
Image::createThumbnail($file->guid, LARGE);
Image::createThumbnail($file->guid, EXTRALARGE);
Image::createThumbnail($file->guid, HUGE);
new Activity(getLoggedInUserGuid(), "action:upload:file", $guid);
runHook("upload_file:redirect");
new SystemMessage("Your file has been uploaded.");
forward();
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:FileUploadActionHandler.php
示例11: getNotificationCount
static function getNotificationCount($guid)
{
$access = getIgnoreAccess();
setIgnoreAccess();
$count = getEntities(array("type" => "Notification", "count" => true, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()))));
setIgnoreAccess($access);
return $count;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:8,代码来源:Notification.php
示例12: loggedInUserHasLiked
static function loggedInUserHasLiked($guid)
{
$likes = getEntities(array("type" => "Like", "limit" => 1, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "container_guid", "value" => $guid))));
if ($likes) {
return true;
}
return false;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:8,代码来源:LikesPlugin.php
示例13: __construct
public function __construct()
{
$title = $body = $button = NULL;
switch (pageArray(1)) {
case "all":
default:
if (loggedIn()) {
$admin_groups = Setting::get("admin_groups");
if (!$admin_groups) {
$admin_groups = "users";
}
if ($admin_groups == "admin" && adminLoggedIn() || $admin_groups == "user") {
$button = "<a href='" . getSiteURL() . "groups/create' class='btn btn-success'>Create a Group</a>";
}
}
$title = "Groups";
$body = display("pages/groups");
break;
case "create":
$admin_groups = Setting::get("admin_groups");
if (!$admin_groups) {
$admin_groups = "user";
}
if ($admin_groups == "admin" && adminLoggedIn() || $admin_groups == "user") {
$title = "Create a Group";
$body = drawForm(array("name" => "create_group", "action" => "createGroup", "method" => "post", "files" => true));
}
break;
case "view":
$guid = pageArray(2);
$group = getEntity($guid);
$edit_url = getSiteURL() . "groups/edit/{$guid}";
$delete_url = addTokenToURL(getSiteURL() . "action/deleteGroup/{$guid}");
if ($group->ownerIsLoggedIn()) {
$button = "<a href='{$edit_url}' class='btn btn-warning'>Edit Group</a>";
$button .= "<a href='{$delete_url}' class='btn btn-danger confirm'>Delete Group</a>";
}
if (GroupsPlugin::loggedInUserCanJoin($group)) {
$join_group_url = addTokenToURL(getSiteURL() . "action/JoinGroup/" . $group->guid);
$button .= "<a href='{$join_group_url}' class='btn btn-success confirm'>Join Group</a>";
}
if ($group->loggedInUserIsMember() && $group->owner_guid != getLoggedInUserGuid()) {
$leave_group_url = addTokenToURL(getSiteURL() . "action/LeaveGroup/" . $group->guid);
$button .= "<a href='{$leave_group_url}' class='btn btn-danger confirm'>Leave Group</a>";
}
$title = $group->title;
$body = display("pages/group");
break;
case "edit":
$guid = pageArray(2);
$group = getEntity($guid);
$title = "Edit " . $group->title;
$body = drawForm(array("name" => "edit_group", "action" => "editGroup", "method" => "post", "files" => true));
break;
}
$this->html = drawPage(array("header" => $title, "body" => $body, "button" => $button));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:57,代码来源:GroupsPageHandler.php
示例14: createComment
static function createComment($container_guid, $comment_body)
{
$owner_guid = getLoggedInUserGuid();
$comment = new Comment();
$comment->container_guid = $container_guid;
$comment->body = $comment_body;
$comment->owner_guid = $owner_guid;
$comment->save();
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:9,代码来源:CommentsPlugin.php
示例15: unblock
static function unblock($guid)
{
$blocked = getEntity(array("type" => "Blockeduser", "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "container_guid", "value" => $guid))));
if ($blocked) {
$blocked->delete();
return true;
}
return false;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:9,代码来源:BlockUserPlugin.php
示例16: __construct
function __construct()
{
$guid = pageArray(2);
$membership = getEntity(array("type" => "Groupmembership", "metadata_name_value_pairs" => array(array("name" => "group", "value" => $guid), array("name" => "member_guid", "value" => getLoggedInUserGuid()))));
if ($membership) {
$membership->delete();
new SystemMessage("You have successfully left the group");
}
forward();
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:10,代码来源:LeaveGroupActionHandler.php
示例17: __construct
public function __construct($data)
{
$guid = $data['guid'];
if (!LikesPlugin::loggedInUserHasLiked($guid)) {
die;
}
$like = getEntity(array("type" => "Like", "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "container_guid", "value" => $guid))));
$like->delete();
die;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:10,代码来源:RemoveLikeActionHandler.php
示例18: __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;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:10,代码来源:FilesPageHandler.php
示例19: __construct
public function __construct()
{
$guid = pageArray(1);
if (!$guid) {
forward("profile/" . getLoggedInUserGuid());
}
$user = getEntity($guid);
classGateKeeper($user, "User");
$body = display("pages/profile", array("guid" => $guid));
$this->html = drawPage(NULL, $body);
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:11,代码来源:ProfilePageHandler.php
示例20: __construct
public function __construct($data)
{
$guid = $data['guid'];
$chat = getEntity($guid);
if (getLoggedInUserGuid() == $chat->user_one) {
$chat->user_one_maximized = true;
} else {
$chat->user_two_maximized = true;
}
$chat->save();
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:11,代码来源:MaximizeChatActionHandler.php
注:本文中的getLoggedInUserGuid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论