Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
448 ddelon 1
<?php
2
/*
3
recentchangesrss.php
4
 
5
Copyright 2003  David DELON
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
GNU General Public License for more details.
15
 
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
*/
20
 
21
if ($user = $this->GetUser())
22
{
23
	$max = $user["changescount"];
24
}
25
else
26
{
27
	$max = 50;
28
}
29
 
30
if ($pages = $this->LoadRecentlyChanged($max))
31
{
32
	if (!($link = $this->GetParameter("link"))) $link=$this->config["root_page"];
33
	$output = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
34
	$output .= "<!-- RSS v0.91 generated by Wikini -->\n";
35
	$output .= "<rdf:RDF\n";
36
	$output .= "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
37
	$output .= "xmlns=\"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n";
38
 
39
	$output .= "<channel>\n";
40
	$output .= "<title> Derniers changements sur ". $this->config["wakka_name"]  . "</title>\n";
41
	$output .= "<link>".str_replace('&', '&amp;', $this->config["base_url"].$link)."</link>\n";
42
	$output .= "<description> Derniers changements sur " . $this->config["wakka_name"] . " </description>\n";
43
	$output .= "<language>fr</language>\n";
44
	$output .= "</channel>\n";
45
 
46
	foreach ($pages as $i => $page)
47
	{
48
		list($day, $time) = explode(" ", $page["time"]);
49
		$day= preg_replace("/-/", " ", $day);
50
		list($hh,$mm,$ss) = explode(":", $time);
51
		$output .= "<item>\n";
52
		$output .= "<title>" . $page["tag"] . " --- par " .$page["user"] . " le " . $day ." - ". $hh .":". $mm . "</title>\n";
53
		$output .= "<description> Modification de " . $page["tag"] . " --- par " .$page["user"] . " le " . $day ." - ". $hh .":". $mm . "</description>\n";
54
		$output .= "<link>".str_replace('&', '&amp;', $this->config["base_url"].$page["tag"])."&amp;time=" . rawurlencode($page["time"]) . "</link>\n";
55
		$output .= "</item>\n";
56
	}
57
	$output .= "</rdf:RDF>\n";
58
	echo $output ;
59
}
60
?>