From d0915e2322006ec13585c802e6033bba9b481a23 Mon Sep 17 00:00:00 2001 From: mikelittle Date: Mon, 10 Nov 2003 23:32:02 +0000 Subject: [PATCH] b2rss/rdf -> wp-rss/rdf Plus old files do permanent redirect to the new ones. git-svn-id: http://svn.automattic.com/wordpress/trunk@535 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- b2rdf.php | 100 ++++------------------------------------------------- b2rss.php | 86 ++++----------------------------------------- b2rss2.php | 97 ++++----------------------------------------------- wp-rdf.php | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ wp-rss.php | 80 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 195 insertions(+), 262 deletions(-) create mode 100644 wp-rdf.php create mode 100644 wp-rss.php diff --git a/b2rdf.php b/b2rdf.php index 964b6f9265..d10b52fd0a 100644 --- a/b2rdf.php +++ b/b2rdf.php @@ -1,94 +1,8 @@ -get_var($sql); - -$unixtime = strtotime($maxdate); - -// format timestamp for Last-Modified header -$clast = gmdate("D, d M Y H:i:s \G\M\T",$unixtime); -$cetag = md5($last); - -$slast = $_SERVER['HTTP_IF_MODIFIED_SINCE']; -$setag = $_SERVER['HTTP_IF_NONE_MATCH']; - -// send it in a Last-Modified header -header("Last-Modified: " . $clast, true); -header("Etag: " . $cetag, true); - -// compare it to aggregator's If-Modified-Since and If-None-Match headers -// if they match, send a 304 and die - -// This logic says that if only one header is provided, just use that one, -// but if both headers exist, they *both* must match up with the locally -// generated values. -//if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){ -if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) { - header("HTTP/1.1 304 Not Modified"); - echo "\r\n\r\n"; - exit; -} - -add_filter('the_content', 'trim'); -if (!isset($rss_language)) { $rss_language = 'en'; } -?> -"; ?> - - -"> - <?php bloginfo_rss('name') ?> - - - - - - - - hourly - 1 - 2000-01-01T12:00+00:00 - - - - - - - - - - - <?php the_title_rss() ?> - - - (mailto:) - - - - - - ]]> - - - \ No newline at end of file +$curpath = dirname(__FILE__).'/'; +require_once ($curpath.'wp-config.php'); +require_once ($curpath.$b2inc.'/b2template.functions.php'); +header('HTTP/1.0 301 Moved Permanently'); +header('Location: ' . get_bloginfo('rdf_url') . "\n"); +exit; +?> \ No newline at end of file diff --git a/b2rss.php b/b2rss.php index 3f884c3303..6baee181dd 100644 --- a/b2rss.php +++ b/b2rss.php @@ -1,80 +1,8 @@ -get_var($sql); - -$unixtime = strtotime($maxdate); - -// format timestamp for Last-Modified header -$clast = gmdate("D, d M Y H:i:s \G\M\T",$unixtime); -$cetag = md5($last); - -$slast = $_SERVER['HTTP_IF_MODIFIED_SINCE']; -$setag = $_SERVER['HTTP_IF_NONE_MATCH']; - -// send it in a Last-Modified header -header("Last-Modified: " . $clast, true); -header("Etag: " . $cetag, true); - -// compare it to aggregator's If-Modified-Since and If-None-Match headers -// if they match, send a 304 and die - -// This logic says that if only one header is provided, just use that one, -// but if both headers exist, they *both* must match up with the locally -// generated values. -//if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){ -if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) { - header("HTTP/1.1 304 Not Modified"); - echo "\r\n\r\n"; - exit; -} - -if (!isset($rss_language)) { $rss_language = 'en'; } -if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; } -if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_length = 0; } -?> -"; ?> - - - - <?php bloginfo_rss("name") ?> - - - GMT - http://backend.userland.com/rss092 - - - - - - - <?php the_title_rss() ?> "; the_category_unicode(); echo ""; -$more = 1; -if ($rss_use_excerpt) { -?> - - - - - - - - - \ No newline at end of file +$curpath = dirname(__FILE__).'/'; +require_once ($curpath.'wp-config.php'); +require_once ($curpath.$b2inc.'/b2template.functions.php'); +header('HTTP/1.0 301 Moved Permanently'); +header('Location: ' . get_bloginfo('rss_url') . "\n"); +exit; +?> \ No newline at end of file diff --git a/b2rss2.php b/b2rss2.php index f4b0a5155c..b10f1f0de3 100644 --- a/b2rss2.php +++ b/b2rss2.php @@ -1,91 +1,8 @@ -get_var($sql); - -$unixtime = strtotime($maxdate); - -// format timestamp for Last-Modified header -$clast = gmdate("D, d M Y H:i:s \G\M\T",$unixtime); -$cetag = md5($last); - -$slast = $_SERVER['HTTP_IF_MODIFIED_SINCE']; -$setag = $_SERVER['HTTP_IF_NONE_MATCH']; - -// send it in a Last-Modified header -header("Last-Modified: " . $clast, true); -header("Etag: " . $cetag, true); - -// compare it to aggregator's If-Modified-Since and If-None-Match headers -// if they match, send a 304 and die - -// This logic says that if only one header is provided, just use that one, -// but if both headers exist, they *both* must match up with the locally -// generated values. -//if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){ -if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) { - header("HTTP/1.1 304 Not Modified"); - echo "\r\n\r\n"; - exit; -} - -if (!isset($rss_language)) { $rss_language = 'en'; } -if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; } -if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_length = 0; } -?> -"; ?> - - - - - <?php bloginfo_rss("name") ?> - - - - - Copyright - - - - hourly - 1 - 2000-01-01T12:00+00:00 - - - - <?php the_title_rss() ?> - - - (mailto:) - - @ - - - - - ]]> - - - - \ No newline at end of file +$curpath = dirname(__FILE__).'/'; +require_once ($curpath.'wp-config.php'); +require_once ($curpath.$b2inc.'/b2template.functions.php'); +header('HTTP/1.0 301 Moved Permanently'); +header('Location: ' . get_bloginfo('rss2_url') . "\n"); +exit; +?> \ No newline at end of file diff --git a/wp-rdf.php b/wp-rdf.php new file mode 100644 index 0000000000..964b6f9265 --- /dev/null +++ b/wp-rdf.php @@ -0,0 +1,94 @@ +get_var($sql); + +$unixtime = strtotime($maxdate); + +// format timestamp for Last-Modified header +$clast = gmdate("D, d M Y H:i:s \G\M\T",$unixtime); +$cetag = md5($last); + +$slast = $_SERVER['HTTP_IF_MODIFIED_SINCE']; +$setag = $_SERVER['HTTP_IF_NONE_MATCH']; + +// send it in a Last-Modified header +header("Last-Modified: " . $clast, true); +header("Etag: " . $cetag, true); + +// compare it to aggregator's If-Modified-Since and If-None-Match headers +// if they match, send a 304 and die + +// This logic says that if only one header is provided, just use that one, +// but if both headers exist, they *both* must match up with the locally +// generated values. +//if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){ +if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) { + header("HTTP/1.1 304 Not Modified"); + echo "\r\n\r\n"; + exit; +} + +add_filter('the_content', 'trim'); +if (!isset($rss_language)) { $rss_language = 'en'; } +?> +"; ?> + + +"> + <?php bloginfo_rss('name') ?> + + + + + + + + hourly + 1 + 2000-01-01T12:00+00:00 + + + + + + + + + + + <?php the_title_rss() ?> + + + (mailto:) + + + + + + + ]]> + + + \ No newline at end of file diff --git a/wp-rss.php b/wp-rss.php new file mode 100644 index 0000000000..7e87e46aa2 --- /dev/null +++ b/wp-rss.php @@ -0,0 +1,80 @@ +get_var($sql); + +$unixtime = strtotime($maxdate); + +// format timestamp for Last-Modified header +$clast = gmdate("D, d M Y H:i:s \G\M\T",$unixtime); +$cetag = md5($last); + +$slast = $_SERVER['HTTP_IF_MODIFIED_SINCE']; +$setag = $_SERVER['HTTP_IF_NONE_MATCH']; + +// send it in a Last-Modified header +header("Last-Modified: " . $clast, true); +header("Etag: " . $cetag, true); + +// compare it to aggregator's If-Modified-Since and If-None-Match headers +// if they match, send a 304 and die + +// This logic says that if only one header is provided, just use that one, +// but if both headers exist, they *both* must match up with the locally +// generated values. +//if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){ +if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) { + header("HTTP/1.1 304 Not Modified"); + echo "\r\n\r\n"; + exit; +} + +if (!isset($rss_language)) { $rss_language = 'en'; } +if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; } +if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_length = 0; } +?> +"; ?> + + + + <?php bloginfo_rss("name") ?> + + + GMT + http://backend.userland.com/rss092 + + + + + + + <?php the_title_rss() ?> +"; the_category_unicode(); echo ""; +$more = 1; +if ($rss_use_excerpt) { +?> + + + + + + + + + \ No newline at end of file