当前位置: 首页>>代码示例>>PHP>>正文


PHP ElggUser::getURL方法代码示例

本文整理汇总了PHP中ElggUser::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggUser::getURL方法的具体用法?PHP ElggUser::getURL怎么用?PHP ElggUser::getURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ElggUser的用法示例。


在下文中一共展示了ElggUser::getURL方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: messageboard_add

/**
 * Add messageboard post
 *
 * @param ElggUser $poster User posting the message
 * @param ElggUser $owner User who owns the message board
 * @param string $message The posted message
 * @param int $access_id Access level (see defines in elgglib.php)
 * @return bool
 */
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
{
    $result_id = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
    if (!$result_id) {
        return false;
    }
    elgg_create_river_item(array('view' => 'river/object/messageboard/create', 'action_type' => 'messageboard', 'subject_guid' => $poster->guid, 'object_guid' => $owner->guid, 'access_id' => $access_id, 'annotation_id' => $result_id));
    // Send notification only if poster isn't the owner
    if ($poster->guid != $owner->guid) {
        $subject = elgg_echo('messageboard:email:subject', array(), $owner->language);
        $body = elgg_echo('messageboard:email:body', array($poster->name, $message, elgg_get_site_url() . "messageboard/owner/" . $owner->username, $poster->name, $poster->getURL()), $owner->language);
        $params = ['action' => 'create', 'object' => elgg_get_annotation_from_id($result_id)];
        notify_user($owner->guid, $poster->guid, $subject, $body, $params);
    }
    return $result_id;
}
开发者ID:elgg,项目名称:elgg,代码行数:25,代码来源:start.php

示例2: share_notify_user

/**
 * Notify $user that $sharer shared his $entity.
 *
 * @param type $user
 * @param type $sharer
 * @param type $entity 
 */
function share_notify_user(ElggUser $user, ElggUser $sharer, ElggEntity $entity)
{
    if (!$user instanceof ElggUser) {
        return false;
    }
    if (!$sharer instanceof ElggUser) {
        return false;
    }
    if (!$entity instanceof ElggEntity) {
        return false;
    }
    $title_str = $entity->title;
    if (!$title_str) {
        $title_str = elgg_get_excerpt($entity->description);
    }
    $site = get_config('site');
    $subject = elgg_echo('share:notifications:subject', array($sharer->name, $title_str));
    $body = elgg_echo('share:notifications:body', array($user->name, $sharer->name, $title_str, $site->name, $entity->getURL(), $sharer->getURL()));
    notify_user($user->guid, $sharer->guid, $subject, $body);
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:27,代码来源:start.php

示例3: owner_gatekeeper_apply_rules

/**
 * Apply the protection rules
 *
 * @param ElggUser $page_owner
 * @param ElggUser $user
 *
 * @access private
 * @return bool true you have access, false you don't
 */
function owner_gatekeeper_apply_rules(ElggUser $page_owner, ElggUser $user = null)
{
    if (!$page_owner instanceof ElggUser) {
        return false;
    }
    if (current_page_url() === elgg_normalize_url($page_owner->getURL())) {
        // profile page
        if (!owner_gatekeeper_protect_profile()) {
            return true;
        }
    } else {
        // content pages
        if (!owner_gatekeeper_protect_page_owner()) {
            return true;
        }
    }
    if (!$user instanceof ElggUser) {
        return false;
    }
    if (!owner_gatekeeper_match_group($page_owner, $user)) {
        return false;
    }
    return true;
}
开发者ID:coldtrick,项目名称:owner_gatekeeper,代码行数:33,代码来源:functions.php

示例4: messageboard_add

/**
 * Add messageboard post
 *
 * @param ElggUser $poster User posting the message
 * @param ElggUser $owner User who owns the message board
 * @param string $message The posted message
 * @param int $access_id Access level (see defines in elgglib.php)
 * @return bool
 */
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
{
    $result = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
    if (!$result) {
        return false;
    }
    add_to_river('river/object/messageboard/create', 'messageboard', $poster->guid, $owner->guid, $access_id, 0, $result);
    // only send notification if not self
    if ($poster->guid != $owner->guid) {
        $subject = elgg_echo('messageboard:email:subject');
        $body = elgg_echo('messageboard:email:body', array($poster->name, $message, elgg_get_site_url() . "messageboard/" . $owner->username, $poster->name, $poster->getURL()));
        notify_user($owner->guid, $poster->guid, $subject, $body);
    }
    return $result;
}
开发者ID:rasul,项目名称:Elgg,代码行数:24,代码来源:start.php

示例5: messageboard_add

/**
 * Add messageboard post
 *
 * @param ElggUser $poster User posting the message
 * @param ElggUser $owner User who owns the message board
 * @param string $message The posted message
 * @param int $access_id Access level (see defines in elgglib.php)
 * @return bool
 */
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
{
    $result_id = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
    if (!$result_id) {
        return false;
    }
    elgg_create_river_item(array('view' => 'river/object/messageboard/create', 'action_type' => 'messageboard', 'subject_guid' => $poster->guid, 'object_guid' => $owner->guid, 'access_id' => $access_id, 'annotation_id' => $result_id));
    // only send notification if not self
    if ($poster->guid != $owner->guid) {
        $subject = elgg_echo('messageboard:email:subject');
        $body = elgg_echo('messageboard:email:body', array($poster->name, $message, elgg_get_site_url() . "messageboard/" . $owner->username, $poster->name, $poster->getURL()));
        notify_user($owner->guid, $poster->guid, $subject, $body);
    }
    return $result_id;
}
开发者ID:tjcaverly,项目名称:Elgg,代码行数:24,代码来源:start.php

示例6: parseUser

 /**
  * @SWG\Definition(
  *  definition="User",
  *  required={"guid","name"},
  *  @SWG\Property(property="guid", type="integer"),
  *  @SWG\Property(property="name", type="string"),
  *  @SWG\Property(property="icon_url", type="string"),
  *  @SWG\Property(property="url", type="string")
  * )
  */
 private function parseUser(\ElggUser $user)
 {
     return array('guid' => $user->guid, 'name' => html_entity_decode($user->name, ENT_QUOTES), 'icon_url' => $user->getIconURL(), 'url' => $user->getURL());
 }
开发者ID:Pleio,项目名称:pleio_rest,代码行数:14,代码来源:Members.php


注:本文中的ElggUser::getURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。