2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
5 // $Id: rss.inc.php,v 1.7 2004/07/31 03:09:20 henoheno Exp $
7 // RecentChanges ¤Î RSS ¤ò½ÐÎÏ
8 function plugin_rss_action()
10 global $script,$rss_max,$page_title,$whatsnew;
12 $self = (preg_match('#^https?://#',$script) ? $script : get_script_uri());
15 die_message("please set '\$script' in ".INI_FILE);
18 $page_title_utf8 = mb_convert_encoding($page_title,'UTF-8',SOURCE_ENCODING);
22 if (!file_exists(CACHE_DIR.'recent.dat'))
26 $recent = file(CACHE_DIR.'recent.dat');
27 $lines = array_splice($recent,0,$rss_max);
28 foreach ($lines as $line)
30 list($time,$page) = explode("\t",rtrim($line));
31 $r_page = rawurlencode($page);
32 $title = mb_convert_encoding($page,'UTF-8',SOURCE_ENCODING);
33 $desc = get_date('D, d M Y H:i:s T',$time);
37 <link>$self?$r_page</link>
38 <description>$desc</description>
44 header('Content-type: application/xml');
46 $r_whatsnew = rawurlencode($whatsnew);
49 <?xml version="1.0" encoding="UTF-8"?>
51 <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
52 "http://my.netscape.com/publish/formats/rss-0.91.dtd">
57 <title>$page_title_utf8</title>
58 <link>$self?$r_whatsnew</link>
59 <description>PukiWiki RecentChanges</description>
60 <language>ja</language>