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


PHP Notice::asAtomEntry方法代码示例

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


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

示例1: addEntryFromNotice

 /**
  * Add a single Notice to the feed
  *
  * @param Notice $notice a Notice to add
  */
 function addEntryFromNotice($notice)
 {
     $source = $this->showSource();
     $author = $this->showAuthor();
     $this->addEntryRaw($notice->asAtomEntry(false, $source, $author));
 }
开发者ID:himmelex,项目名称:NTW,代码行数:11,代码来源:atomnoticefeed.php

示例2: 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(": ");
     }
     if (!empty($notice->rendered)) {
         $notice->rendered = str_replace("\t", "", $notice->rendered);
         $xs->raw($notice->rendered);
     } else {
         $xs->raw(common_render_content($notice->content, $notice));
     }
     $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:phpsource,项目名称:gnu-social,代码行数:41,代码来源:XmppPlugin.php

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

示例4: addEntryFromNotice

 /**
  * Add a single Notice to the feed
  *
  * @param Notice $notice a Notice to add
  */
 function addEntryFromNotice($notice)
 {
     try {
         $source = $this->showSource();
         $author = $this->showAuthor();
         $this->addEntryRaw($notice->asAtomEntry(false, $source, $author, $this->scoped));
     } catch (Exception $e) {
         common_log(LOG_ERR, $e->getMessage());
         // we continue on exceptions
     }
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:16,代码来源:atomnoticefeed.php

示例5: jabber_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
 */
function jabber_format_entry($profile, $notice)
{
    $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);
    $xs->text(": ");
    if (!empty($notice->rendered)) {
        $xs->raw($notice->rendered);
    } else {
        $xs->raw(common_render_content($notice->content, $notice));
    }
    $xs->text(" ");
    $xs->element('a', array('href' => common_local_url('conversation', array('id' => $notice->conversation)) . '#notice-' . $notice->id), sprintf(_('[%s]'), $notice->id));
    $xs->elementEnd('body');
    $xs->elementEnd('html');
    $html = $xs->getString();
    return $html . ' ' . $entry;
}
开发者ID:microcosmx,项目名称:experiments,代码行数:28,代码来源:jabber.php

示例6: addEntryFromNotice

 /**
  * Add a single Notice to the feed
  *
  * @param Notice $notice a Notice to add
  */
 function addEntryFromNotice($notice)
 {
     try {
         $source = $this->showSource();
         $author = $this->showAuthor();
         $cur = empty($this->cur) ? common_current_user() : $this->cur;
         $this->addEntryRaw($notice->asAtomEntry(false, $source, $author, $cur));
     } catch (Exception $e) {
         common_log(LOG_ERR, $e->getMessage());
         // we continue on exceptions
     }
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:17,代码来源:atomnoticefeed.php


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