オープンソース・ソフトウェアの開発とダウンロード

CVS リポジトリの参照

Contents of /pukiwiki/pukiwiki/plugin/rss10.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download) (as text)
Sun Feb 29 07:43:21 2004 UTC (20 years, 2 months ago) by arino
Branch: MAIN
Changes since 1.9: +2 -2 lines
File MIME type: application/x-httpd-php
BugTrack/526 typo identifer -> identif'i'er

1 <?php
2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
4 //
5 // $Id: rss10.inc.php,v 1.9 2003/09/12 00:38:06 arino Exp $
6 //
7 // RecentChanges の RSS を出力
8 function plugin_rss10_action()
9 {
10 global $script,$rss_max,$page_title,$whatsnew;
11 global $trackback;
12
13 $self = (preg_match('#^https?://#',$script) ? $script : get_script_uri());
14 if ($self === FALSE)
15 {
16 die_message("please set '\$script' in ".INI_FILE);
17 }
18
19 $page_title_utf8 = mb_convert_encoding($page_title,'UTF-8',SOURCE_ENCODING);
20
21 $items = $rdf_li = '';
22
23 if (!file_exists(CACHE_DIR.'recent.dat'))
24 {
25 return '';
26 }
27 $recent = file(CACHE_DIR.'recent.dat');
28 $lines = array_splice($recent,0,$rss_max);
29 foreach ($lines as $line)
30 {
31 list($time,$page) = explode("\t",rtrim($line));
32 $r_page = rawurlencode($page);
33 $title = mb_convert_encoding($page,'UTF-8',SOURCE_ENCODING);
34 // 'O'が出力する時刻を'+09:00'の形に整形
35 $dc_date = substr_replace(get_date('Y-m-d\TH:i:sO',$time),':',-2,0);
36
37 // $desc = get_date('D, d M Y H:i:s T',$time);
38 // <description>$desc</description>
39
40 $dc_identifier = $trackback_ping = '';
41 if ($trackback)
42 {
43 $tb_id = md5($r_page);
44 $dc_identifier = " <dc:identifier>$self?$r_page</dc:identifier>";
45 $trackback_ping = " <trackback:ping>$self?plugin=tb&amp;tb_id=$tb_id</trackback:ping>";
46 }
47 $items .= <<<EOD
48 <item rdf:about="$self?$r_page">
49 <title>$title</title>
50 <link>$self?$r_page</link>
51 <dc:date>$dc_date</dc:date>
52 $dc_identifier
53 $trackback_ping
54 </item>
55
56 EOD;
57 $rdf_li .= " <rdf:li rdf:resource=\"$self?$r_page\" />\n";
58 }
59
60 $xmlns_trackback = $trackback ?
61 ' xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"' : '';
62
63 header('Content-type: application/xml');
64
65 print <<<EOD
66 <?xml version="1.0" encoding="utf-8"?>
67
68 <rdf:RDF
69 xmlns:dc="http://purl.org/dc/elements/1.1/"
70 $xmlns_trackback
71 xmlns="http://purl.org/rss/1.0/"
72 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
73 xml:lang="ja">
74
75 <channel rdf:about="$self?$whatsnew">
76 <title>$page_title_utf8</title>
77 <link>$self?$whatsnew</link>
78 <description>PukiWiki RecentChanges</description>
79 <items>
80 <rdf:Seq>
81 $rdf_li
82 </rdf:Seq>
83 </items>
84 </channel>
85
86 $items
87 </rdf:RDF>
88 EOD;
89 exit;
90 }
91 ?>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26