summaryrefslogtreecommitdiff
path: root/feed.php
diff options
context:
space:
mode:
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php32
1 files changed, 27 insertions, 5 deletions
diff --git a/feed.php b/feed.php
index 66d694f53..19d6729c2 100644
--- a/feed.php
+++ b/feed.php
@@ -1,4 +1,11 @@
<?php
+/**
+ * XML feed export
+ *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+
ini_set('short_open_tag',"1");
require_once("inc/common.php");
require_once("inc/parser.php");
@@ -54,12 +61,14 @@
header('Content-Type: application/xml; charset='.$lang['encoding']);
print $rss->createFeed($type,$lang['encoding']);
+// ---------------------------------------------------------------- //
-
-/* some functions */
-
+/**
+ * Add recent changed to a feed object
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
function rssRecentChanges(&$rss,$num){
-
$recents = getRecents($num);
foreach(array_keys($recents) as $id){
$desc = cleanDesc(parsedWiki($id));
@@ -84,7 +93,12 @@ function rssRecentChanges(&$rss,$num){
$rss->addItem($item);
}
}
-
+
+/**
+ * Add all pages of a namespace to a feedobject
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
function rssListNamespace(&$rss,$ns){
require_once("inc/search.php");
global $conf;
@@ -108,6 +122,14 @@ function rssListNamespace(&$rss,$ns){
}
}
+/**
+ * Clean description for feed inclusion
+ *
+ * Removes HTML tags and line breaks and trims the text to
+ * 250 chars
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
function cleanDesc($desc){
//remove TOC
$desc = strip_tags($desc);