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


PHP Notice::getRendered方法代码示例

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


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

示例1: showEntry

 /**
  * Build an Atom entry similar to search.twitter.com's based on
  * a given notice
  *
  * @param Notice $notice the notice to use
  *
  * @return void
  */
 function showEntry($notice)
 {
     $server = common_config('site', 'server');
     $profile = $notice->getProfile();
     $nurl = common_local_url('shownotice', array('notice' => $notice->id));
     $this->elementStart('entry');
     $taguribase = TagURI::base();
     $this->element('id', null, "tag:{$taguribase}:{$notice->id}");
     $this->element('published', null, common_date_w3dtf($notice->created));
     $this->element('link', array('type' => 'text/html', 'rel' => 'alternate', 'href' => $nurl));
     $this->element('title', null, common_xml_safe_str(trim($notice->content)));
     $this->element('content', array('type' => 'html'), $notice->getRendered());
     $this->element('updated', null, common_date_w3dtf($notice->created));
     $this->element('link', array('type' => 'image/png', 'rel' => 'related', 'href' => $profile->avatarUrl()));
     // @todo: Here is where we'd put in a link to an atom feed for threads
     $source = null;
     $ns = $notice->getSource();
     if ($ns instanceof Notice_source) {
         if (!empty($ns->name) && !empty($ns->url)) {
             $source = '<a href="' . htmlspecialchars($ns->url) . '" rel="nofollow">' . htmlspecialchars($ns->name) . '</a>';
         } else {
             $source = $ns->code;
         }
     }
     $this->element("twitter:source", null, $source);
     $this->elementStart('author');
     $name = $profile->nickname;
     if ($profile->fullname) {
         // @todo Needs proper i18n?
         $name .= ' (' . $profile->fullname . ')';
     }
     $this->element('name', null, $name);
     $this->element('uri', null, common_profile_uri($profile));
     $this->elementEnd('author');
     $this->elementEnd('entry');
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:44,代码来源:apisearchatom.php

示例2: showNoticeContent

 /**
  * Layout stuff
  */
 protected function showNoticeContent(Notice $stored, HTMLOutputter $out, Profile $scoped = null)
 {
     $out->raw($stored->getRendered());
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:7,代码来源:ActivityVerbPostPlugin.php

示例3: copyNotice

 /**
  * Mirror a notice by emitting a new notice with the same contents.
  * Kind of dirty, but if pulling an external data feed into an account
  * that may be what you want.
  *
  * @param Notice $notice
  * @return mixed Notice on successful repeat, true if already repeated, false on failure
  */
 protected function copyNotice($profile, $notice)
 {
     $options = array('is_local' => Notice::LOCAL_PUBLIC, 'url' => $notice->getUrl(), 'rendered' => $notice->getRendered());
     $saved = Notice::saveNew($profile->id, $notice->content, 'feed', $options);
     return $saved;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:14,代码来源:SubMirror.php

示例4: format_entry

 /**
  * extra information for XMPP messages, as defined by Twitter
  *
  * @param Profile $profile Profile of the sending user
  * @param Notice  $notice  Notice being sent
  *
  * @return string Extra information (Atom, HTML, addresses) in string format
  */
 protected function format_entry(Notice $notice)
 {
     $profile = $notice->getProfile();
     $entry = $notice->asAtomEntry(true, true);
     $xs = new XMLStringer();
     $xs->elementStart('html', array('xmlns' => 'http://jabber.org/protocol/xhtml-im'));
     $xs->elementStart('body', array('xmlns' => 'http://www.w3.org/1999/xhtml'));
     $xs->element('a', array('href' => $profile->profileurl), $profile->nickname);
     try {
         $parent = $notice->getParent();
         $orig_profile = $parent->getProfile();
         $orig_profurl = $orig_profile->getUrl();
         $xs->text(" => ");
         $xs->element('a', array('href' => $orig_profurl), $orig_profile->nickname);
         $xs->text(": ");
     } catch (InvalidUrlException $e) {
         $xs->text(sprintf(' => %s', $orig_profile->nickname));
     } catch (NoParentNoticeException $e) {
         $xs->text(": ");
     } catch (NoResultException $e) {
         // Parent notice was probably deleted.
         $xs->text(": ");
     }
     // FIXME: Why do we replace \t with ''? is it just to make it pretty? shouldn't whitespace be handled well...?
     $xs->raw(str_replace("\t", "", $notice->getRendered()));
     $xs->text(" ");
     $xs->element('a', array('href' => common_local_url('conversation', array('id' => $notice->conversation)) . '#notice-' . $notice->id), sprintf(_m('[%u]'), $notice->id));
     $xs->elementEnd('body');
     $xs->elementEnd('html');
     $html = $xs->getString();
     return $html . ' ' . $entry;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:40,代码来源:XmppPlugin.php

示例5: activityObjectFromNotice

 public function activityObjectFromNotice(Notice $stored)
 {
     // Repeat is a little bit special. As it's an activity, our
     // ActivityObject is instead turned into an Activity
     $object = new Activity();
     $object->actor = $stored->getProfile()->asActivityObject();
     $object->verb = ActivityVerb::SHARE;
     $object->content = $stored->getRendered();
     $this->extendActivity($stored, $object);
     return $object;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:11,代码来源:SharePlugin.php


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