本文整理匯總了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));
}