Subversion Repositories taios

Rev

Rev 425 | Rev 443 | 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
 
412 tom 16
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 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>');
23
    write('<title>' . $post->title . '</title>');
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>');
425 tom 27
    write('<description>' . str_replace(">", "&gt;", str_replace("<", "&lt;", $page->replaceBBCode($post->content))) . '</description>');
409 tom 28
    write('</item>');
29
}
30
 
411 tom 31
write('</channel>');
32
write('</rss>');
409 tom 33
 
34
?>