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


PHP ElggUser::annotate方法代码示例

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


在下文中一共展示了ElggUser::annotate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
        notify_user($owner->guid, $poster->guid, $subject, $body);
    }
    return $result_id;
}
开发者ID:elgg,项目名称:messageboard,代码行数:24,代码来源:start.php

示例2: 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


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