Rev 410 | Go to most recent revision | Details | 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 | |||
7 | write('''<?xml version="1.0" encoding="UTF-8" ?> |
||
8 | <rss version="2.0"> |
||
9 | <channel> |
||
10 | <title>Tim32 Blog RSS</title> |
||
11 | <description>This is the RSS feed for the Tim32 Blog.</description> |
||
12 | <link>http://tim32.org/blog/</link> |
||
13 | '''); |
||
14 | |||
15 | $ids = $page->findIDs('BlogPosts', 'ORDER BY DatePosted DESC'); |
||
16 | for ($i = 0; $i < count($ids); $i++) |
||
17 | { |
||
18 | $id = $ids[$i]; |
||
19 | $post = $page->getBlogPost($id); |
||
20 | |||
21 | write('<item>'); |
||
22 | write('<title>' . $post->title . '</title>'); |
||
23 | write('<link>http://tim32.org/blog/post.php?id=' . $id . '</link>'); |
||
24 | write('<guid>' . $id . '</guid>'); |
||
25 | write('<pubDate>' . date('D, d M Y H:i:s O', $post->datePosted). '</pubDate>'); |
||
26 | write('</item>'); |
||
27 | |||
28 | write('<a href="post.php?id=' . $id . '"><h3>' . $post->title. '</h3></a>'); |
||
29 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
||
30 | write('<p>' . $page->replaceBBCode($post->content) . '</p>'); |
||
31 | write('<br />'); |
||
32 | } |
||
33 | |||
34 | write('''</channel> |
||
35 | </rss>'''); |
||
36 | |||
37 | ?> |