本文整理汇总了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');
}
示例2: showNoticeContent
/**
* Layout stuff
*/
protected function showNoticeContent(Notice $stored, HTMLOutputter $out, Profile $scoped = null)
{
$out->raw($stored->getRendered());
}
示例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;
}
示例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;
}
示例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;
}