直近 Post WordPress の rss, atom のタイムゾーンの問題解決。WPJ のフォーラムに投げようと思ったけど関数と DB 眺めたら解けそうだったので投げずに済んだ。

wp-rdf.php, wp-rss.php, wp-rss2.php, wp-atom.php を編集する。今日は時間も遅いので diff の出力だけ書いておしまい。需要があるか分からないが後で分かりやすく書き直す予定。とまれ、Planet 設置の前に脱線したので明日以降 Planet のデザインいじることにする。大したデザインにはならんけど。

wp-rdf.php

PHP:
  1. $ diff -u wordpress_org/wp-rdf.php ./wp-rdf.php
  2. --- wordpress_org/wp-rdf.php    2005-09-09 07:02:14.000000000 +0900
  3. +++ ./wp-rdf.php     2006-06-22 04:10:14.000000000 +0900
  4. @@ -24,7 +24,7 @@
  5.         <title><?php bloginfo_rss('name') ?></title>
  6.         <link><?php bloginfo_rss('url') ?></link>
  7.         <description><?php bloginfo_rss('description') ?></description>
  8. -       <dc :date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc>
  9. +       <dc :date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('server'), false); ?></dc>
  10.         <admin :generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
  11.         <sy :updatePeriod>hourly</sy>
  12.         <sy :updateFrequency>1</sy>
  13. @@ -42,7 +42,7 @@
  14.  <item rdf:about="<?php permalink_single_rss() ?>">
  15.         <title><?php the_title_rss() ?></title>
  16.         <link><?php permalink_single_rss() ?></link>
  17. -        <dc :date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc>
  18. +        <dc :date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date, false); ?></dc>
  19.         <dc :creator><?php the_author() ?></dc>
  20.         <?php the_category_rss('rdf') ?>
  21.  <?php if (get_settings('rss_use_excerpt')) : ?>

wp-rss.php

PHP:
  1. $ diff -u wordpress_org/wp-rss.php ./wp-rss.php
  2. --- wordpress_org/wp-rss.php    2005-06-11 08:15:13.000000000 +0900
  3. +++ ./wp-rss.php     2006-06-22 04:08:28.000000000 +0900
  4. @@ -16,7 +16,7 @@
  5.         <title><?php bloginfo_rss('name') ?></title>
  6.         <link><?php bloginfo_rss('url') ?></link>
  7.         <description><?php bloginfo_rss('description') ?></description>
  8. -       <lastbuilddate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastbuilddate>
  9. +       <lastbuilddate><?php echo mysql2date('D, d M Y H:i:s +0900', get_lastpostmodified('server'), false); ?></lastbuilddate>
  10.         <docs>http://backend.userland.com/rss092</docs>
  11.         <language><?php echo get_option('rss_language'); ?></language>
  12.         <?php do_action('rss_head'); ?>

wp-rss2.php

PHP:
  1. $ diff -u wordpress_org/wp-rss2.php ./wp-rss2.php
  2. --- wordpress_org/wp-rss2.php   2005-11-29 09:16:04.000000000 +0900
  3. +++ ./wp-rss2.php    2006-06-22 04:08:05.000000000 +0900
  4. @@ -23,7 +23,7 @@
  5.         <title><?php bloginfo_rss('name'); ?></title>
  6.         <link><?php bloginfo_rss('url') ?></link>
  7.         <description><?php bloginfo_rss("description") ?></description>
  8. -       <pubdate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubdate>
  9. +       <pubdate><?php echo mysql2date('D, d M Y H:i:s +0900', get_lastpostmodified('server'), false); ?></pubdate>
  10.         <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
  11.         <language><?php echo get_option('rss_language'); ?></language>
  12.         <?php do_action('rss2_head'); ?>
  13. @@ -32,7 +32,7 @@
  14.                 <title><?php the_title_rss() ?></title>
  15.                 <link><?php permalink_single_rss() ?></link>
  16.                 <comments><?php comments_link(); ?></comments>
  17. -               <pubdate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubdate>
  18. +               <pubdate><?php echo mysql2date('D, d M Y H:i:s +0900', get_post_time('Y-m-d H:i:s', false), false); ?></pubdate>
  19.                 <dc :creator><?php the_author() ?></dc>
  20.                 <?php the_category_rss() ?>

wp-atom.php

PHP:
  1. $ diff -u wordpress_org/wp-atom.php ./wp-atom.php
  2. --- wordpress_org/wp-atom.php   2005-06-11 08:15:13.000000000 +0900
  3. +++ ./wp-atom.php    2006-06-22 04:13:11.000000000 +0900
  4. @@ -19,7 +19,7 @@
  5.         <title><?php bloginfo_rss('name') ?></title>
  6.         <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
  7.         <tagline><?php bloginfo_rss("description") ?></tagline>
  8. -       <modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></modified>
  9. +       <modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('server'), false); ?></modified>
  10.         <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></copyright>
  11.         <generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
  12.         <?php do_action('atom_head'); ?>
  13. @@ -31,8 +31,8 @@
  14.                 <title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>
  15.                 </link><link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />
  16.                 <id><?php the_guid(); ?></id>
  17. -               <modified><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></modified>
  18. -               <issued><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></issued>
  19. +               <modified><?php echo get_post_time('Y-m-d\TH:i:s\Z', false); ?></modified>
  20. +               <issued><?php echo get_post_time('Y-m-d\TH:i:s\Z', false); ?></issued>
  21.                 <?php the_category_rss('rdf') ?>
  22.                 <summary type="text/plain" mode="escaped"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
  23.  <?php if ( !get_settings('rss_use_excerpt') ) : ?>

rss も atom もまとめて feed と呼びたいところだけど、これ定着してないから切ない。

Popularity: 56%

1 Writeback »

  1. feedの時間修正…

    ……

    Said by blog.wytm.net April 16, 2007 at about 15:25

Leave a comment


RSS feed for comments on this post.
Trackback URI : http://wp.luac.net/items/515/trackback/