Rev 410 | Rev 412 | 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 | |
14 | $ids = $page->findIDs('BlogPosts', 'ORDER BY DatePosted DESC'); |
||
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>'); |
||
25 | write('</item>'); |
||
26 | |||
27 | write('<a href="post.php?id=' . $id . '"><h3>' . $post->title. '</h3></a>'); |
||
28 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
||
29 | write('<p>' . $page->replaceBBCode($post->content) . '</p>'); |
||
30 | write('<br />'); |
||
31 | } |
||
32 | |||
411 | tom | 33 | write('</channel>'); |
34 | write('</rss>'); |
||
409 | tom | 35 | |
36 | ?> |