本文整理汇总了PHP中FeedItem::stripComment方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::stripComment方法的具体用法?PHP FeedItem::stripComment怎么用?PHP FeedItem::stripComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeedItem
的用法示例。
在下文中一共展示了FeedItem::stripComment方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feedItem
/**
* Generate a FeedItem object from a given revision table row
* Borrows Recent Changes' feed generation functions for formatting;
* includes a diff to the previous revision (if any).
*
* @param stdClass|array $row Database row
* @return FeedItem
*/
function feedItem($row)
{
$rev = new Revision($row);
$rev->setTitle($this->getTitle());
$text = FeedUtils::formatDiffRow($this->getTitle(), $this->getTitle()->getPreviousRevisionID($rev->getId()), $rev->getId(), $rev->getTimestamp(), $rev->getComment());
if ($rev->getComment() == '') {
global $wgContLang;
$title = $this->msg('history-feed-item-nocomment', $rev->getUserText(), $wgContLang->timeanddate($rev->getTimestamp()), $wgContLang->date($rev->getTimestamp()), $wgContLang->time($rev->getTimestamp()))->inContentLanguage()->text();
} else {
$title = $rev->getUserText() . $this->msg('colon-separator')->inContentLanguage()->text() . FeedItem::stripComment($rev->getComment());
}
return new FeedItem($title, $text, $this->getTitle()->getFullURL('diff=' . $rev->getId() . '&oldid=prev'), $rev->getTimestamp(), $rev->getUserText(), $this->getTitle()->getTalkPage()->getFullURL());
}
示例2: feedItemDesc
/**
* @param Revision $revision
* @return string
*/
protected function feedItemDesc($revision)
{
if ($revision) {
$msg = wfMessage('colon-separator')->inContentLanguage()->text();
$content = $revision->getContent();
if ($content instanceof TextContent) {
// only textual content has a "source view".
$html = nl2br(htmlspecialchars($content->getNativeData()));
} else {
//XXX: we could get an HTML representation of the content via getParserOutput, but that may
// contain JS magic and generally may not be suitable for inclusion in a feed.
// Perhaps Content should have a getDescriptiveHtml method and/or a getSourceText method.
//Compare also FeedUtils::formatDiffRow.
$html = '';
}
return '<p>' . htmlspecialchars($revision->getUserText()) . $msg . htmlspecialchars(FeedItem::stripComment($revision->getComment())) . "</p>\n<hr />\n<div>" . $html . "</div>";
}
return '';
}
示例3: feedItemDesc
protected function feedItemDesc($row)
{
$revision = Revision::newFromId($row->rev_id);
if ($revision) {
//XXX: include content model/type in feed item?
return '<p>' . htmlspecialchars($revision->getUserText()) . $this->msg('colon-separator')->inContentLanguage()->escaped() . htmlspecialchars(FeedItem::stripComment($revision->getComment())) . "</p>\n<hr />\n<div>" . nl2br(htmlspecialchars($revision->getContent()->serialize())) . "</div>";
}
return '';
}
示例4: feedItemDesc
/**
* @param $revision Revision
* @return string
*/
protected function feedItemDesc($revision)
{
if ($revision) {
$msg = wfMessage('colon-separator')->inContentLanguage()->text();
return '<p>' . htmlspecialchars($revision->getUserText()) . $msg . htmlspecialchars(FeedItem::stripComment($revision->getComment())) . "</p>\n<hr />\n<div>" . nl2br(htmlspecialchars($revision->getText())) . "</div>";
}
return '';
}
示例5: feedItemDesc
protected function feedItemDesc($revision)
{
if ($revision) {
return '<p>' . htmlspecialchars($revision->getUserText()) . wfMsgForContent('colon-separator') . htmlspecialchars(FeedItem::stripComment($revision->getComment())) . "</p>\n<hr />\n<div>" . nl2br(htmlspecialchars($revision->getText())) . "</div>";
}
return '';
}
示例6: feedItemDesc
protected function feedItemDesc($row)
{
$revision = Revision::newFromId($row->rev_id);
if ($revision) {
return '<p>' . htmlspecialchars($revision->getUserText()) . ': ' . htmlspecialchars(FeedItem::stripComment($revision->getComment())) . "</p>\n<hr />\n<div>" . nl2br(htmlspecialchars($revision->getText())) . "</div>";
}
return '';
}
示例7: feedItemDescription
/**
* Feed item description and property value output manipulation
*
* @since 1.8
*
* @param array $items
* @param string $pageContent
*
* @return string
*/
protected function feedItemDescription($items, $pageContent)
{
return htmlspecialchars(FeedItem::stripComment(implode(',', $items)) . FeedItem::stripComment($pageContent));
}