]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-rdf.php
Wordpress 2.0.4
[autoinstalls/wordpress.git] / wp-rdf.php
1 <?php /* RDF 1.0 generator, original version by garym@teledyn.com */
2
3 if (empty($wp)) {
4         require_once('wp-config.php');
5         wp('feed=rdf');
6 }
7
8 header('Content-type: application/rdf+xml; charset=' . get_settings('blog_charset'), true);
9 $more = 1;
10
11 ?>
12 <?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
13 <!-- generator="wordpress/<?php echo $wp_version ?>" -->
14 <rdf:RDF
15         xmlns="http://purl.org/rss/1.0/"
16         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
17         xmlns:dc="http://purl.org/dc/elements/1.1/"
18         xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
19         xmlns:admin="http://webns.net/mvcb/"
20         xmlns:content="http://purl.org/rss/1.0/modules/content/"
21         <?php do_action('rdf_ns'); ?>
22 >
23 <channel rdf:about="<?php bloginfo_rss("url") ?>">
24         <title><?php bloginfo_rss('name') ?></title>
25         <link><?php bloginfo_rss('url') ?></link>
26         <description><?php bloginfo_rss('description') ?></description>
27         <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date>
28         <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
29         <sy:updatePeriod>hourly</sy:updatePeriod>
30         <sy:updateFrequency>1</sy:updateFrequency>
31         <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
32         <?php do_action('rdf_header'); ?>
33         <items>
34                 <rdf:Seq>
35                 <?php while (have_posts()): the_post(); ?>
36                         <rdf:li rdf:resource="<?php permalink_single_rss() ?>"/>
37                 <?php endwhile; ?>
38                 </rdf:Seq>
39         </items>
40 </channel>
41 <?php rewind_posts(); while (have_posts()): the_post(); ?>
42 <item rdf:about="<?php permalink_single_rss() ?>">
43         <title><?php the_title_rss() ?></title>
44         <link><?php permalink_single_rss() ?></link>
45          <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date>
46         <dc:creator><?php the_author() ?></dc:creator>
47         <?php the_category_rss('rdf') ?>
48 <?php if (get_settings('rss_use_excerpt')) : ?>
49         <description><?php the_excerpt_rss() ?></description>
50 <?php else : ?>
51         <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description>
52         <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
53 <?php endif; ?>
54         <?php do_action('rdf_item'); ?>
55 </item>
56 <?php endwhile;  ?>
57 </rdf:RDF>