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

CVS リポジトリの参照

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

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


Revision 1.2 - (hide annotations) (download) (as text)
Thu Feb 20 12:21:13 2003 UTC (21 years, 3 months ago) by panda
Branch: MAIN
CVS Tags: r1_4_pre5
Changes since 1.1: +22 -21 lines
File MIME type: application/x-httpd-php
use 'CACHE_DIR/recent.dat'.

1 panda 1.1 <?php
2     /////////////////////////////////////////////////
3     // PukiWiki - Yet another WikiWikiWeb clone.
4     //
5 panda 1.2 // $Id: rss10.inc.php,v 1.1 2003/01/27 05:38:46 panda Exp $
6 panda 1.1 //
7     // RecentChanges の RSS を出力
8     function plugin_rss10_action()
9     {
10 panda 1.2 global $script,$rss_max,$page_title,$whatsnew;
11 panda 1.1
12     $self = 'http://'.SERVER_NAME.PHP_SELF.'?';
13    
14     $page_title_utf8 = $page_title;
15 panda 1.2 if (function_exists('mb_convert_encoding')) {
16     $page_title_utf8 = mb_convert_encoding($page_title_utf8,'UTF-8',SOURCE_ENCODING);
17     }
18 panda 1.1
19     $items = $rdf_li = '';
20 panda 1.2
21     if (!file_exists(CACHE_DIR.'recent.dat')) {
22     return '';
23     }
24     $recent = file(CACHE_DIR.'recent.dat');
25     $lines = array_splice($recent,0,$rss_max);
26     foreach ($lines as $line) {
27     list($time,$page) = explode("\t",rtrim($line));
28     $r_page = rawurlencode($page);
29     $title = $page;
30     if (function_exists('mb_convert_encoding')) {
31     $title = mb_convert_encoding($title,'UTF-8',SOURCE_ENCODING);
32     }
33 panda 1.1
34     $dcdate = get_date('Y-m-d\TH:i:sO');
35 panda 1.2 $desc = get_date('D, d M Y H:i:s T',$time);
36 panda 1.1 $items .= <<<EOD
37 panda 1.2 <item rdf:about="$self$r_page">
38 panda 1.1 <title>$title</title>
39 panda 1.2 <link>$self$r_page</link>
40 panda 1.1 <dc:date>$dcdate</dc:date>
41     <description>$desc</description>
42     </item>
43    
44     EOD;
45 panda 1.2 $rdf_li .= " <rdf:li rdf:resource=\"$self$r_page\" />\n";
46 panda 1.1 }
47    
48     header('Content-type: application/xml');
49    
50     print <<<EOD
51     <?xml version="1.0" encoding="utf-8"?>
52    
53     <rdf:RDF
54     xmlns:dc="http://purl.org/dc/elements/1.1/"
55     xmlns="http://purl.org/rss/1.0/"
56     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
57     xml:lang="ja">
58    
59     <channel rdf:about="{$self}rss">
60     <title>$page_title_utf8</title>
61     <link>$self$whatsnew</link>
62     <description>PukiWiki RecentChanges</description>
63     <items>
64     <rdf:Seq>
65     $rdf_li
66     </rdf:Seq>
67     </items>
68     </channel>
69    
70     $items
71     </rdf:RDF>
72     EOD;
73     exit;
74     }
75     ?>

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