Elgg  Version 4.3
default.php
Go to the documentation of this file.
1 <?php
11 
12 // Don't show RSS if disabled
13 if (elgg()->config->disable_rss) {
14  throw new PageNotFoundException();
15 }
16 
17 // Set title
18 if (empty($vars['title'])) {
19  $title = elgg_get_site_entity()->getDisplayName();
20 } else {
21  $title = elgg_get_site_entity()->getDisplayName() . ": " . $vars['title'];
22 }
23 
24 // Remove RSS from URL
26 
27 $rssurl = htmlspecialchars($url, ENT_NOQUOTES, 'UTF-8');
28 $url = htmlspecialchars($url, ENT_NOQUOTES, 'UTF-8');
29 
30 $body = elgg_extract('body', $vars, '');
31 $description = elgg_extract('description', $vars, '');
32 
33 $namespaces = elgg_view('extensions/xmlns');
34 $extensions = elgg_view('extensions/channel');
35 
36 
37 // allow caching as required by stupid MS products for https feeds.
38 elgg_set_http_header('Pragma: public');
39 elgg_set_http_header("Content-Type: text/xml;charset=utf-8");
40 
41 echo "<?xml version='1.0'?>";
42 echo <<<END
43 <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" $namespaces>
44 <channel>
45  <title><![CDATA[$title]]></title>
46  <link>$url</link>
47  <atom:link href="$rssurl" rel="self" type="application/rss+xml" />
48  <description><![CDATA[$description]]></description>
50  $body
51 </channel>
52 </rss>
53 END;
$description
Definition: default.php:20
elgg_set_http_header($header, $replace=true)
Set a response HTTP header.
Definition: elgglib.php:26
$rssurl
Definition: default.php:27
if(!$site) if(!($site instanceof ElggSite)) $site description
Definition: settings.php:20
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Program is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Program under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the General Public License from time to time Such new versions will be similar in spirit to the present version
Definition: LICENSE.txt:283
$namespaces
Definition: default.php:33
Thrown when page is not accessible.
elgg_http_remove_url_query_element($url, $element)
Removes an element from a URL&#39;s query string.
Definition: elgglib.php:467
$url
Definition: default.php:30
elgg_get_current_url()
Returns the current page&#39;s complete URL.
$body
Definition: default.php:22
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:24
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:99
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:547
$title
Definition: default.php:28
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
var elgg
Definition: elgglib.js:4
$extensions
Definition: default.php:34