Rev 424 | 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 | |||
5 | $page = new Taios_Page('Blog RSS Feed', '../'); |
||
6 | |||
411 | tom | 7 | write('<?xml version="1.0" encoding="UTF-8" ?>'); |
8 | write('<rss version="2.0">'); |
||
9 | write('<channel>'); |
||
10 | write('<title>Tim32 Blog RSS</title>'); |
||
11 | write('<description>This is the RSS feed for the Tim32 Blog.</description>'); |
||
12 | write('<link>http://tim32.org/blog/</link>'); |
||
409 | tom | 13 | |
412 | tom | 14 | $ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 ORDER BY DatePosted DESC'); |
409 | tom | 15 | for ($i = 0; $i < count($ids); $i++) |
16 | { |
||
17 | $id = $ids[$i]; |
||
18 | $post = $page->getBlogPost($id); |
||
19 | |||
20 | write('<item>'); |
||
21 | write('<title>' . $post->title . '</title>'); |
||
22 | write('<link>http://tim32.org/blog/post.php?id=' . $id . '</link>'); |
||
23 | write('<guid>' . $id . '</guid>'); |
||
24 | write('<pubDate>' . date('D, d M Y H:i:s O', $post->datePosted). '</pubDate>'); |
||
425 | tom | 25 | write('<description>' . str_replace(">", ">", str_replace("<", "<", $page->replaceBBCode($post->content))) . '</description>'); |
409 | tom | 26 | write('</item>'); |
27 | } |
||
28 | |||
411 | tom | 29 | write('</channel>'); |
30 | write('</rss>'); |
||
409 | tom | 31 | |
32 | ?> |