tiki-file_galleries_rss.php 1.26 KB
Newer Older
1
<?php
2
// (c) Copyright 2002-2011 by authors of the Tiki Wiki CMS Groupware Project
changi67's avatar
changi67 committed
3
// 
4 5
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
changi67's avatar
changi67 committed
6
// $Id$
7

8 9
require_once ('tiki-setup.php');
require_once ('lib/tikilib.php');
10
require_once ('lib/rss/rsslib.php');
11

12
$access->check_feature('feature_file_galleries');
13

14
if ($prefs['feed_file_galleries'] != 'y') {
15 16
        $errmsg=tra("rss feed disabled");
        require_once ('tiki-rss_error.php');
17 18
}

19 20
$filegallib = TikiLib::lib('filegal');

ohertel's avatar
ohertel committed
21
$feed = "filegals";
mose's avatar
mose committed
22
$uniqueid = $feed;
23 24 25
$output = $rsslib->get_from_cache($uniqueid);

if ($output["data"]=="EMPTY") {
26 27
	$title = $prefs['feed_file_galleries_title'];
	$desc = $prefs['feed_file_galleries_desc'];
28 29
	$id = "fileId";
	$descId = "description";
30
	$dateId = "lastModif";
31
	$authorId = "lastModifUser";
32 33 34
	$titleId = "filename";
	$readrepl = "tiki-download_file.php?$id=%s";

35
	$changes = $filegallib->list_files(0, $prefs['feed_file_galleries_max'], $dateId.'_desc', '');
36 37
	$output = $rsslib->generate_feed($feed, $uniqueid, '', $changes, $readrepl, '', $id, $title, $titleId, $desc, $descId, $dateId, $authorId);
}
38 39
header("Content-type: ".$output["content-type"]);
print $output["data"];