當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Ostatus_profile::checkAuthorship方法代碼示例

本文整理匯總了PHP中Ostatus_profile::checkAuthorship方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ostatus_profile::checkAuthorship方法的具體用法?PHP Ostatus_profile::checkAuthorship怎麽用?PHP Ostatus_profile::checkAuthorship使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ostatus_profile的用法示例。


在下文中一共展示了Ostatus_profile::checkAuthorship方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onStartHandleFeedEntryWithProfile

 /**
  * Handle a posted object from PuSH
  *
  * @param Activity        $activity activity to handle
  * @param Ostatus_profile $oprofile Profile for the feed
  *
  * @return boolean hook value
  */
 function onStartHandleFeedEntryWithProfile($activity, $oprofile, &$notice)
 {
     if ($this->isMyActivity($activity)) {
         $actor = $oprofile->checkAuthorship($activity);
         if (empty($actor)) {
             // TRANS: Client exception thrown when no author for an activity was found.
             throw new ClientException(_('Cannot get author for activity.'));
         }
         $object = $activity->objects[0];
         $options = array('uri' => $object->id, 'url' => $object->link, 'is_local' => Notice::REMOTE, 'source' => 'ostatus');
         // $actor is an ostatus_profile
         $notice = $this->saveNoticeFromActivity($activity, $actor->localProfile(), $options);
         return false;
     }
     return true;
 }
開發者ID:Grasia,項目名稱:bolotweet,代碼行數:24,代碼來源:microappplugin.php

示例2: onStartHandleFeedEntryWithProfile

 /**
  * Handle a posted bookmark from PuSH
  *
  * @param Activity        $activity activity to handle
  * @param Ostatus_profile $oprofile Profile for the feed
  *
  * @return boolean hook value
  */
 function onStartHandleFeedEntryWithProfile($activity, $oprofile)
 {
     common_log(LOG_INFO, "BookmarkPlugin called for new feed entry.");
     if (self::_isPostBookmark($activity)) {
         common_log(LOG_INFO, "Importing activity {$activity->id} as a bookmark.");
         $author = $oprofile->checkAuthorship($activity);
         if (empty($author)) {
             throw new ClientException(_('Can\'t get author for activity.'));
         }
         self::_postRemoteBookmark($author, $activity);
         return false;
     }
     return true;
 }
開發者ID:microcosmx,項目名稱:experiments,代碼行數:22,代碼來源:BookmarkPlugin.php


注:本文中的Ostatus_profile::checkAuthorship方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。