本文整理汇总了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');
}
示例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();
}
示例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();
}
示例4: init
/**
*
*/
function init()
{
RSSFeed::linkToFeed(Director::baseURL() . $this->URLSegment . "/episodesRSS");
if (Director::is_ajax()) {
$this->isAjax = true;
} else {
$this->isAjax = false;
}
parent::init();
}
示例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();
}
示例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();
}
}
示例7: init
function init() {
parent::init();
RSSFeed::linkToFeed($this->Link() . 'rss');
}
示例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) . "&order=" . urlencode($order) . "&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);
}
示例9: init
public function init()
{
// Provides a link to the Podcast RSS in the HTML head
RSSFeed::linkToFeed($this->Link('rss'));
parent::init();
}
示例10: init
public function init()
{
parent::init();
Requirements::themedCSS('news');
RSSFeed::linkToFeed("{$this->data()->RSSHolder()->Link()}rss");
}
示例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) . ' » ' . $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);
}
示例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());
}
示例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");
}
示例14: init
public function init()
{
parent::init();
RSSFeed::linkToFeed($this->Link() . 'rss', SiteConfig::current_site_config()->Title . ' news');
}
示例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');
}