當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。