aboutsummaryrefslogtreecommitdiff
path: root/views/opensearch_rss/page/default.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-12-02 22:05:50 -0500
committercash <cash.costello@gmail.com>2011-12-02 22:05:50 -0500
commitc4ed70ad4cf233f6091f6de22a5cfaf81ea88747 (patch)
tree0dcaaf83e169d6d7d906675c64464700545ea884 /views/opensearch_rss/page/default.php
parent98acc22fec2dc7942e5c6e5bcdd2e6a356c6e905 (diff)
downloadelgg-c4ed70ad4cf233f6091f6de22a5cfaf81ea88747.tar.gz
elgg-c4ed70ad4cf233f6091f6de22a5cfaf81ea88747.tar.bz2
Elgg 1.8 version
Diffstat (limited to 'views/opensearch_rss/page/default.php')
-rw-r--r--views/opensearch_rss/page/default.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/views/opensearch_rss/page/default.php b/views/opensearch_rss/page/default.php
new file mode 100644
index 000000000..79cd544c4
--- /dev/null
+++ b/views/opensearch_rss/page/default.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Page shell for OpenSearch RSS feed
+ */
+
+global $OPEN_SEARCH_COUNT;
+
+header("Content-Type: application/rss+xml");
+
+// allow caching as required by stupid MS products for https feeds.
+header('Pragma: public', TRUE);
+
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+
+// Set title
+$search_terms = get_input('q');
+$title = elgg_get_site_entity()->name;
+$title .= ' ' . elgg_echo('opensearch:title', array($search_terms));
+
+$description = elgg_echo('opensearch:description', array($search_terms));
+
+// Remove viewtype from URL
+$search_url = str_replace('&view=opensearch_rss', '', full_url());
+
+$os_url = elgg_normalize_url('opensearch/osd.xml');
+
+?>
+<rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
+<channel>
+ <title><?php echo $title; ?></title>
+ <link><?php echo $search_url; ?></link>
+ <description><?php echo $description; ?></description>
+ <opensearch:totalResults><?php echo $OPEN_SEARCH_COUNT; ?></opensearch:totalResults>
+ <atom:link rel="search" type="application/opensearchdescription+xml" href="<?php echo $os_url; ?>"/>
+ <opensearch:Query role="request" searchTerms="<?php echo addslashes($search_terms); ?>" startPage="1" />
+<?php
+
+ echo $vars['body'];
+
+?>
+</channel>
+</rss>