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


PHP FeedItem::stripComment方法代码示例

本文整理汇总了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());
 }
开发者ID:Habatchii,项目名称:wikibase-for-mediawiki,代码行数:21,代码来源:HistoryAction.php

示例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 '';
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:23,代码来源:ApiFeedContributions.php

示例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 '';
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:9,代码来源:SpecialNewpages.php

示例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 '';
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:12,代码来源:ApiFeedContributions.php

示例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 '';
 }
开发者ID:rocLv,项目名称:conference,代码行数:7,代码来源:SpecialContributions.php

示例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 '';
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:8,代码来源:SpecialNewpages.php

示例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));
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:14,代码来源:SMW_QP_Feed.php


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