Elgg
Version 5.1
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
rss
page
default.php
Go to the documentation of this file.
1
<?php
10
use
Elgg\Exceptions\Http\PageNotFoundException
;
11
12
// Don't show RSS if disabled
13
if
(
elgg
()->config->disable_rss) {
14
throw
new
PageNotFoundException
();
15
}
16
17
// Set title
18
$title
=
elgg_get_site_entity
()->getDisplayName();
19
if
(!empty(
$vars
[
'title'
])) {
20
$title
.=
": {$vars['title']}"
;
21
}
22
23
// Remove RSS from URL
24
$url
=
elgg_http_remove_url_query_element
(
elgg_get_current_url
(),
'view'
);
25
26
$rssurl
= htmlspecialchars(
$url
, ENT_NOQUOTES,
'UTF-8'
);
27
$url
= htmlspecialchars(
$url
, ENT_NOQUOTES,
'UTF-8'
);
28
29
$body
=
elgg_extract
(
'body'
,
$vars
,
''
);
30
$description
=
elgg_extract
(
'description'
,
$vars
,
''
);
31
32
$namespaces
=
elgg_view
(
'extensions/xmlns'
);
33
$extensions
=
elgg_view
(
'extensions/channel'
);
34
35
// allow caching as required by stupid MS products for https feeds.
36
elgg_set_http_header
(
'Pragma: public'
);
37
elgg_set_http_header
(
'Content-Type: text/xml; charset=utf-8'
);
38
39
?>
40
<?xml
version
=
'1.0'
?>
41
<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
; ?>>
42
<channel>
43
<title><![CDATA[<?=
$title
; ?>}]]></title>
44
<link><?=
$url
; ?></link>
45
<atom:link href=
"<?= $rssurl; ?>"
rel=
"self"
type=
"application/rss+xml"
/>
46
<
description
><![CDATA[<?=
$description
; ?>}]]></
description
>
47
<?=
$extensions
; ?>
48
<?=
$body
; ?>
49
</channel>
50
</rss>
$description
$description
Definition:
default.php:20
$rssurl
$rssurl
Definition:
default.php:26
elgg_http_remove_url_query_element
elgg_http_remove_url_query_element(string $url, string $element)
Removes an element from a URL's query string.
Definition:
elgglib.php:167
PageNotFoundException
version
xml version
Definition:
default.php:41
elgg_extract
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition:
elgglib.php:254
elgg_set_http_header
elgg_set_http_header(string $header, bool $replace=true)
Set a response HTTP header.
Definition:
elgglib.php:26
$namespaces
$namespaces
Definition:
default.php:32
elgg_view
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition:
views.php:177
Elgg\Exceptions\Http\PageNotFoundException
Thrown when page is not accessible.
Definition:
PageNotFoundException.php:12
description
$site description
Definition:
settings.php:14
$url
$url
Definition:
default.php:31
elgg_get_current_url
elgg_get_current_url()
Returns the current page's complete URL.
Definition:
pagehandler.php:121
$body
$body
Definition:
default.php:22
$vars
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition:
default.php:25
elgg_get_site_entity
elgg_get_site_entity()
Get the current site entity.
Definition:
entities.php:98
$title
$title
Definition:
default.php:29
elgg
var elgg
Definition:
elgglib.js:4
$extensions
$extensions
Definition:
default.php:33
Generated on Fri Mar 29 2024 00:00:29 for Elgg by
1.8.11