File:  [mozdev] / cdn / www / b2rdf.php
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Fri Mar 7 14:47:58 2003 UTC (16 years, 1 month ago) by cdn
Branches: MAIN
CVS tags: HEAD
0O

    1: <?php /* RDF 1.0 generator, original version by garym@teledyn.com */
    2: $blog=1; // enter your blog's ID
    3: header("Content-type: text/xml");
    4: include ("blog.header.php");
    5: add_filter('the_content', 'trim');
    6: if (!isset($rss_language)) { $rss_language = 'en'; }
    7: ?><?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?".">\n"; ?>
    8: <!-- generator="b2/<?php echo $b2_version ?>" -->
    9: <rdf:RDF
   10: 	xmlns="http://purl.org/rss/1.0/"
   11: 	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   12: 	xmlns:dc="http://purl.org/dc/elements/1.1/"
   13: 	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
   14: 	xmlns:admin="http://webns.net/mvcb/"
   15: 	xmlns:content="http://purl.org/rss/1.0/modules/content/"
   16: >
   17: 
   18: <channel rdf:about="<?php bloginfo_rss("url") ?>">
   19: 
   20: 	<title><?php bloginfo_rss('name') ?></title>
   21: 	<link><?php bloginfo_rss('url') ?></link>
   22: 	<description><?php bloginfo_rss('description') ?></description>
   23: 	<dc:language><?php echo $rss_language ?></dc:language>
   24: 	<dc:date><?php echo gmdate('Y-m-d\TH:i:s'); ?></dc:date>
   25: 	<dc:creator><?php echo $admin_email ?></dc:creator>
   26: 	<admin:generatorAgent rdf:resource="http://cafelog.com/?v=<?php echo $b2_version ?>"/>
   27: 	<admin:errorReportsTo rdf:resource="mailto:<?php echo $admin_email ?>"/>
   28: 	<sy:updatePeriod>hourly</sy:updatePeriod>
   29: 	<sy:updateFrequency>1</sy:updateFrequency>
   30: 	<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
   31: 
   32: 	<items>
   33: 		<rdf:Seq>
   34: 		<?php $items_count = 0; while($row = mysql_fetch_object($result)) { start_b2(); ?>
   35: 			<rdf:li rdf:resource="<?php permalink_single_rss() ?>"/>
   36: 		<?php $b2_items[] = $row; $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
   37: 		</rdf:Seq>
   38: 	</items>
   39: </channel>
   40: 
   41: <?php foreach($b2_items as $row) { start_b2(); ?>
   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 the_time('Y-m-d\TH:i:s'); ?></dc:date>
   46: 	<dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
   47: 	<dc:subject><?php the_category_rss() ?></dc:subject>
   48: 	<description><?php the_content_rss('', 0, '', $rss_excerpt_length, 2) ?></description>
   49: 	<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
   50: </item>
   51: <?php } ?>
   52: 
   53: </rdf:RDF>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>