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


PHP RSSFeed::linkToFeed方法代码示例

本文整理汇总了PHP中RSSFeed::linkToFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::linkToFeed方法的具体用法?PHP RSSFeed::linkToFeed怎么用?PHP RSSFeed::linkToFeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSSFeed的用法示例。


在下文中一共展示了RSSFeed::linkToFeed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss");
     Requirements::css('jobs/css/jobs.css');
     Requirements::javascript('jobs/js/jobs.js');
 }
开发者ID:hogepodge,项目名称:openstack-org,代码行数:7,代码来源:JobHolder.php

示例2: init

 function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss");
     Requirements::css('jobs/css/jobs.css');
     Requirements::javascript('jobs/js/jobs.js');
     $this->repository = new SapphireJobRepository();
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:8,代码来源:JobHolder.php

示例3: init

 function init()
 {
     RSSFeed::linkToFeed($this->Link() . "rss");
     if (Director::fileExists(project() . "/css/news.css")) {
         Requirements::css(project() . "/css/news.css");
     } else {
         Requirements::css("basic-news/css/news.css");
     }
     parent::init();
 }
开发者ID:helpfulrobot,项目名称:purplespider-basic-news,代码行数:10,代码来源:NewsHolder.php

示例4: init

 /**
  *
  */
 function init()
 {
     RSSFeed::linkToFeed(Director::baseURL() . $this->URLSegment . "/episodesRSS");
     if (Director::is_ajax()) {
         $this->isAjax = true;
     } else {
         $this->isAjax = false;
     }
     parent::init();
 }
开发者ID:howardgrigg,项目名称:SilverStripe-Podcast-Module,代码行数:13,代码来源:PodcastPage.php

示例5: init

 public function init()
 {
     // Adds the requirements for the Podcast and Episode Page in the correct order
     Requirements::javascript('framework/thirdparty/jquery/jquery.js');
     Requirements::javascript('podcast/thirdparty/mediaelement/mediaelement-and-player.min.js');
     Requirements::javascript('podcast/javascript/podcast-page.js');
     Requirements::css('podcast/thirdparty/mediaelement/mediaelementplayer.min.css');
     Requirements::css('podcast/css/podcast-page.css');
     // Provides a link to the Podcast RSS in the HTML head
     RSSFeed::linkToFeed($this->Link('rss'));
     parent::init();
 }
开发者ID:helpfulrobot,项目名称:lukereative-silverstripe-podcast,代码行数:12,代码来源:PodcastPage.php

示例6: results

 /**
  * Overrides the ContentControllerSearchExtension and adds snippets to results.
  */
 function results($data, $form, $request)
 {
     $this->linkToAllSiteRSSFeed();
     $results = $form->getResults();
     $query = $form->getSearchQuery();
     // Add context summaries based on the queries.
     foreach ($results as $result) {
         $contextualTitle = new Text();
         $contextualTitle->setValue($result->MenuTitle ? $result->MenuTitle : $result->Title);
         $result->ContextualTitle = $contextualTitle->ContextSummary(300, $query);
         if (!$result->Content && $result->ClassName == 'File') {
             // Fake some content for the files.
             $result->ContextualContent = "A file named \"{$result->Name}\" ({$result->Size}).";
         } else {
             $result->ContextualContent = $result->obj('Content')->ContextSummary(300, $query);
         }
     }
     $rssLink = HTTP::setGetVar('rss', '1');
     // Render the result.
     $data = array('Results' => $results, 'Query' => $query, 'Title' => _t('SearchForm.SearchResults', 'Search Results'), 'RSSLink' => $rssLink);
     // Choose the delivery method - rss or html.
     if (!$this->owner->request->getVar('rss')) {
         // Add RSS feed to normal search.
         RSSFeed::linkToFeed($rssLink, "Search results for query \"{$query}\".");
         return $this->owner->customise($data)->renderWith(array('Page_results', 'Page'));
     } else {
         // De-paginate and reorder. Sort-by-relevancy doesn't make sense in RSS context.
         $fullList = $results->getList()->sort('LastEdited', 'DESC');
         // Get some descriptive strings
         $siteName = SiteConfig::current_site_config()->Title;
         $siteTagline = SiteConfig::current_site_config()->Tagline;
         if ($siteName) {
             $title = "{$siteName} search results for query \"{$query}\".";
         } else {
             $title = "Search results for query \"{$query}\".";
         }
         // Generate the feed content.
         $rss = new RSSFeed($fullList, $this->owner->request->getURL(), $title, $siteTagline, "Title", "ContextualContent", null);
         $rss->setTemplate('Page_results_rss');
         return $rss->outputToBrowser();
     }
 }
开发者ID:helpfulrobot,项目名称:gdmedia-silverstripe-gdm-express,代码行数:45,代码来源:ExpressHomePage.php

示例7: init

	function init() {
		parent::init();
		RSSFeed::linkToFeed($this->Link() . 'rss');
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:4,代码来源:JobCategory.php

示例8: search

 /**
  * The search action
  *
  * @return array Returns an array to render the search results.
  */
 function search()
 {
     $keywords = isset($_REQUEST['Search']) ? Convert::raw2xml($_REQUEST['Search']) : null;
     $order = isset($_REQUEST['order']) ? Convert::raw2xml($_REQUEST['order']) : null;
     $start = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
     $abstract = $keywords ? "<p>" . sprintf(_t('ForumHolder.SEARCHEDFOR', "You searched for '%s'."), $keywords) . "</p>" : null;
     // get the results of the query from the current search engine
     $search = ForumSearch::get_search_engine();
     if ($search) {
         $engine = new $search();
         $results = $engine->getResults($this->ID, $keywords, $order, $start);
     } else {
         $results = false;
     }
     // if the user has requested this search as an RSS feed then output the contents as xml
     // rather than passing it to the template
     if (isset($_REQUEST['rss'])) {
         $rss = new RSSFeed($results, $this->Link(), _t('ForumHolder.SEARCHRESULTS', 'Search results'), "", "Title", "RSSContent", "RSSAuthor");
         return $rss->outputToBrowser();
     }
     // attach a link to a RSS feed version of the search results
     $rssLink = $this->Link() . "search/?Search=" . urlencode($keywords) . "&amp;order=" . urlencode($order) . "&amp;rss";
     RSSFeed::linkToFeed($rssLink, _t('ForumHolder.SEARCHRESULTS', 'Search results'));
     return array("Subtitle" => DBField::create('Text', _t('ForumHolder.SEARCHRESULTS', 'Search results')), "Abstract" => DBField::create('HTMLText', $abstract), "Query" => DBField::create('Text', $_REQUEST['Search']), "Order" => DBField::create('Text', $order ? $order : "relevance"), "RSSLink" => DBField::create('HTMLText', $rssLink), "SearchResults" => $results);
 }
开发者ID:nicmart,项目名称:comperio-site,代码行数:30,代码来源:ForumHolder.php

示例9: init

 public function init()
 {
     // Provides a link to the Podcast RSS in the HTML head
     RSSFeed::linkToFeed($this->Link('rss'));
     parent::init();
 }
开发者ID:lukereative,项目名称:silverstripe-podcast,代码行数:6,代码来源:PodcastPage.php

示例10: init

 public function init()
 {
     parent::init();
     Requirements::themedCSS('news');
     RSSFeed::linkToFeed("{$this->data()->RSSHolder()->Link()}rss");
 }
开发者ID:redema,项目名称:silverstripe-news,代码行数:6,代码来源:NewsHolder.php

示例11: show

 /**
  * Show will get the selected thread to the user. Also increments the forums view count.
  * 
  * If the thread does not exist it will pass the user to the 404 error page
  *
  * @return array|SS_HTTPResponse_Exception
  */
 function show()
 {
     $title = Convert::raw2xml($this->Title);
     if ($thread = $this->getForumThread()) {
         $thread->incNumViews();
         $posts = sprintf(_t('Forum.POSTTOTOPIC', "Posts to the %s topic"), $thread->Title);
         RSSFeed::linkToFeed($this->Link("rss") . '/thread/' . (int) $this->urlParams['ID'], $posts);
         $title = Convert::raw2xml($thread->Title) . ' &raquo; ' . $title;
         return array('Thread' => $thread, 'Title' => DBField::create('HTMLText', $title));
     } else {
         // if redirecting post ids to thread id is enabled then we need
         // to check to see if this matches a post and if it does redirect
         if (Forum::$redirect_post_urls_to_thread && isset($this->urlParams['ID'])) {
             if ($post = DataObject::get_by_id('Post', $this->urlParams['ID'])) {
                 return $this->redirect($post->Link(), 301);
             }
         }
     }
     return $this->httpError(404);
 }
开发者ID:nicmart,项目名称:comperio-site,代码行数:27,代码来源:Forum.php

示例12: init

 /**
  * Initialise the controller to include requirements and sort out the rss feed
  */
 public function init()
 {
     parent::init();
     // Include the DateRangeForm JS manually. We use custom form and $DateRangeForm is never invoked directly.
     //Requirements::javascript('framework/javascript/DateField.js');
     //Requirements::css('framework/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
     RSSFeed::linkToFeed($this->Link() . 'rss', $this->getSubscriptionTitle());
 }
开发者ID:silverstripe-scienceninjas,项目名称:datedupdates,代码行数:11,代码来源:DatedUpdateHolder.php

示例13: init

	function init() {
		parent::init();
		
		// This will create a <link> tag point to the RSS feed
		RSSFeed::linkToFeed($this->Link() . "rss", _t('BlogHolder.RSSFEED',"RSS feed of this blog"));
		Requirements::themedCSS("blog");
		Requirements::themedCSS("bbcodehelp");

	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:9,代码来源:BlogHolder.php

示例14: init

 public function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . 'rss', SiteConfig::current_site_config()->Title . ' news');
 }
开发者ID:tractorcow,项目名称:silverstripe-express,代码行数:5,代码来源:NewsHolder.php

示例15: init

 public function init()
 {
     RSSFeed::linkToFeed($this->Parent()->Link() . "rss", _t("CalendarEvent.RSSFEED", "RSS Feed of this calendar"));
     parent::init();
     Requirements::css('event_calendar/css/calendar.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('event_calendar/javascript/calendar_core.js');
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:8,代码来源:CalendarEvent.php


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