Make WordPress Core

source: trunk/wp-rss.php @ 724

Last change on this file since 724 was 724, checked in by alex_t_king, 21 years ago

disabling the not-modified header code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
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
4$doing_rss = 1;
5header('Content-type: text/xml', true);
6require('wp-blog-header.php');
7
8/* This doesn't take into account edits
9// Get the time of the most recent article
10$maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts");
11$unixtime = strtotime($maxdate);
12
13// format timestamp for Last-Modified header
14$clast = gmdate("D, d M Y H:i:s \G\M\T", $unixtime);
15$cetag = (isset($clast)) ? md5($clast) : '';
16
17// send it in a Last-Modified header
18header("Last-Modified: " . $clast, true);
19header("Etag: " . $cetag, true);
20*/
21
22if (!isset($rss_language)) { $rss_language = 'en'; }
23if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; }
24if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_length = 0; }
25?>
26<?php echo "<?xml version=\"1.0\"?".">"; ?>
27<!-- generator="wordpress/<?php echo $wp_version ?>" -->
28<rss version="0.92">
29    <channel>
30        <title><?php bloginfo_rss("name") ?></title>
31        <link><?php bloginfo_rss("url") ?></link>
32        <description><?php bloginfo_rss("description") ?></description>
33        <lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
34        <docs>http://backend.userland.com/rss092</docs>
35        <managingEditor><?php echo antispambot($admin_email) ?></managingEditor>
36        <webMaster><?php echo antispambot($admin_email) ?></webMaster>
37        <language><?php echo $rss_language ?></language>
38
39<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
40        <item>
41            <title><?php the_title_rss() ?></title>
42<?php
43// we might use this in the future, but not now, that's why it's commented in PHP
44// so that it doesn't appear at all in the RSS
45//          echo "<category>"; the_category_unicode(); echo "</category>";
46$more = 1; 
47if ($rss_use_excerpt) {
48?>
49            <description><?php the_excerpt_rss($rss_excerpt_length, $rss_encoded_html) ?></description>
50<?php
51} else { // use content
52?>
53            <description><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></description>
54<?php
55} // end else use content
56?>
57            <link><?php permalink_single_rss() ?></link>
58        </item>
59<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } } ?>
60    </channel>
61</rss>
Note: See TracBrowser for help on using the repository browser.