Subversion Repositories taios

Rev

Rev 483 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
409 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
433 tom 5
header("Content-type: application/rss+xml");
6
 
409 tom 7
$page = new Taios_Page('Blog RSS Feed', '../');
8
 
411 tom 9
write('<?xml version="1.0" encoding="UTF-8" ?>');
10
write('<rss version="2.0">');
11
write('<channel>');
12
write('<title>Tim32 Blog RSS</title>');
13
write('<description>This is the RSS feed for the Tim32 Blog.</description>');
14
write('<link>http://tim32.org/blog/</link>');
409 tom 15
 
483 muzer 16
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 AND CATEGORY != "Drafts" ORDER BY DatePosted DESC');
409 tom 17
for ($i = 0; $i < count($ids); $i++)
18
{
19
    $id = $ids[$i];
20
    $post = $page->getBlogPost($id);
21
 
22
    write('<item>');
522 muzer 23
    write('<title>' . htmlentities($post->title, ENT_QUOTES) . '</title>');
409 tom 24
    write('<link>http://tim32.org/blog/post.php?id=' . $id . '</link>');
25
    write('<guid>' . $id . '</guid>');
26
    write('<pubDate>' . date('D, d M Y H:i:s O', $post->datePosted). '</pubDate>');
443 tom 27
    write('<description><![CDATA[' . $page->replaceBBCode($post->content) . ']]></description>');
409 tom 28
    write('</item>');
29
}
30
 
411 tom 31
write('</channel>');
32
write('</rss>');
409 tom 33
 
34
?>