[535] | 1 | <?php /* These first lines are the first part of a CafeLog template. |
---|
| 2 | In every template you do, you got to copy them before the CafeLog 'loop' */ |
---|
| 3 | $blog = 1; // enter your blog's ID |
---|
[559] | 4 | $doing_rss = 1; |
---|
[568] | 5 | header('Content-type: text/xml', true); |
---|
[601] | 6 | require('wp-blog-header.php'); |
---|
[535] | 7 | |
---|
| 8 | // Get the time of the most recent article |
---|
[559] | 9 | $maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts"); |
---|
[535] | 10 | $unixtime = strtotime($maxdate); |
---|
| 11 | |
---|
| 12 | // format timestamp for Last-Modified header |
---|
[559] | 13 | $clast = gmdate("D, d M Y H:i:s \G\M\T", $unixtime); |
---|
[568] | 14 | $cetag = (isset($clast)) ? md5($clast) : ''; |
---|
[535] | 15 | |
---|
| 16 | // send it in a Last-Modified header |
---|
| 17 | header("Last-Modified: " . $clast, true); |
---|
| 18 | header("Etag: " . $cetag, true); |
---|
| 19 | |
---|
| 20 | if (!isset($rss_language)) { $rss_language = 'en'; } |
---|
| 21 | if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; } |
---|
| 22 | if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_length = 0; } |
---|
| 23 | ?> |
---|
| 24 | <?php echo "<?xml version=\"1.0\"?".">"; ?> |
---|
[628] | 25 | <!-- generator="wordpress/<?php echo $wp_version ?>" --> |
---|
[535] | 26 | <rss version="0.92"> |
---|
| 27 | <channel> |
---|
| 28 | <title><?php bloginfo_rss("name") ?></title> |
---|
| 29 | <link><?php bloginfo_rss("url") ?></link> |
---|
| 30 | <description><?php bloginfo_rss("description") ?></description> |
---|
| 31 | <lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate> |
---|
| 32 | <docs>http://backend.userland.com/rss092</docs> |
---|
| 33 | <managingEditor><?php echo antispambot($admin_email) ?></managingEditor> |
---|
| 34 | <webMaster><?php echo antispambot($admin_email) ?></webMaster> |
---|
| 35 | <language><?php echo $rss_language ?></language> |
---|
| 36 | |
---|
[628] | 37 | <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?> |
---|
[535] | 38 | <item> |
---|
| 39 | <title><?php the_title_rss() ?></title> |
---|
| 40 | <?php |
---|
| 41 | // we might use this in the future, but not now, that's why it's commented in PHP |
---|
| 42 | // so that it doesn't appear at all in the RSS |
---|
| 43 | // echo "<category>"; the_category_unicode(); echo "</category>"; |
---|
| 44 | $more = 1; |
---|
| 45 | if ($rss_use_excerpt) { |
---|
| 46 | ?> |
---|
| 47 | <description><?php the_excerpt_rss($rss_excerpt_length, $rss_encoded_html) ?></description> |
---|
| 48 | <?php |
---|
| 49 | } else { // use content |
---|
| 50 | ?> |
---|
| 51 | <description><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></description> |
---|
| 52 | <?php |
---|
| 53 | } // end else use content |
---|
| 54 | ?> |
---|
| 55 | <link><?php permalink_single_rss() ?></link> |
---|
| 56 | </item> |
---|
| 57 | <?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } } ?> |
---|
| 58 | </channel> |
---|
| 59 | </rss> |
---|