本文整理汇总了PHP中Ostatus_profile::localProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP Ostatus_profile::localProfile方法的具体用法?PHP Ostatus_profile::localProfile怎么用?PHP Ostatus_profile::localProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ostatus_profile
的用法示例。
在下文中一共展示了Ostatus_profile::localProfile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showProfileInfo
function showProfileInfo(Ostatus_profile $oprofile)
{
if ($oprofile->isGroup()) {
echo "group\n";
} else {
$profile = $oprofile->localProfile();
try {
foreach (array('nickname', 'fullname', 'bio', 'homepage', 'location') as $field) {
print " {$field}: {$profile->{$field}}\n";
}
} catch (NoProfileException $e) {
print "local profile not found";
}
}
echo "\n";
}
示例2: SubMirror
/**
* Let the OStatus subscription garbage collection know if we're
* making use of a remote feed, so it doesn't get dropped out
* from under us.
*
* @param Ostatus_profile $oprofile
* @param int $count in/out
* @return mixed hook return value
*/
function onOstatus_profileSubscriberCount(Ostatus_profile $oprofile, &$count)
{
try {
$profile = $oprofile->localProfile();
$mirror = new SubMirror();
$mirror->subscribed = $profile->id;
if ($mirror->find()) {
while ($mirror->fetch()) {
$count++;
}
}
} catch (NoProfileException $e) {
// We can't handle this kind of Ostatus_profile since it has no
// local profile
}
return true;
}
示例3: pingReply
function pingReply(Ostatus_profile $oprofile)
{
if ($this->user) {
common_debug("OSTATUS [{$this->notice->getID()}]: pinging reply to {$oprofile->localProfile()->getNickname()} for local user '{$this->user->getID()}'");
// For local posts, send a Salmon ping to the mentioned
// remote user or group.
// @fixme as an optimization we can skip this if the
// remote profile is subscribed to the author.
$oprofile->notifyDeferred($this->notice, $this->user);
}
}
示例4: _postRemoteBookmark
/**
* Save a remote bookmark (from Salmon or PuSH)
*
* @param Ostatus_profile $author Author of the bookmark
* @param Activity $activity Activity to save
*
* @return Notice resulting notice.
*/
private static function _postRemoteBookmark(Ostatus_profile $author, Activity $activity)
{
$bookmark = $activity->objects[0];
$options = array('uri' => $bookmark->id, 'url' => $bookmark->link, 'is_local' => Notice::REMOTE, 'source' => 'ostatus');
return self::_postBookmark($author->localProfile(), $activity, $options);
}