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

CVS リポジトリの参照

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

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


Revision 1.12 - (hide annotations) (download) (as text)
Sat Jul 31 03:09:20 2004 UTC (19 years, 9 months ago) by henoheno
Branch: MAIN
CVS Tags: r1_4_4_php5, branch_r1_4_4_php5_end, r1_4_4_rc2, r1_4_4_rc1, r1_4_4
Branch point for: branch_r1_4_4_php5
Changes since 1.11: +15 -15 lines
File MIME type: application/x-httpd-php
Cleankup. Remove redundant tabs and spaces with sed 's/[      ][      ]*$//'

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

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