Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-8820

Feeds and last modified / updated times

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 3.0.x
    • Fix Version/s: 3.0.7
    • Component/s: Other
    • Labels:
      None
    • Environment:
      PHP Environment:
      Database:

      Description

      Copied from my A-51 post:

      I've been having a play with 3.0.6-RC, and very glad to see feeds making it into the main distribution.

      I have noticed one particular aspect of it which gives me some cause for thought. At present, the Last-Modified HTTP header and <updated> XML field both use time() which isn't exactly accurate or helpful. Here are the obvious spots which I'm thinking of, but there may be other spots in the code which could do with a tweak to make time/date more accurate:

              'FEED_UPDATED'                  => $user->format_date(time(), $feed_date_format, true),

      and

              header("Last-Modified: " . gmdate('D, d M Y H:i:s', time()) . ' GMT');

      Something like one of the following, depending on context, could be used instead of time(), and would be accurate nearly 100% of the time:

      SELECT MAX(forum_last_post_time) FROM phpbb_forums;

      SELECT MAX(topic_last_post_time) FROM phpbb_topics;

      SELECT forum_last_post_time FROM phpbb_forums WHERE forum_id=$forum_id;

      SELECT topic_last_post_time FROM phpbb_topics WHERE topic_id=$topic_id;

      Also, adding something similar to the following would probably be appropriate with a more accurate Last-Modified:

      header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$config['feed_expires']) . ' GMT');

      Another suggestion I have is to add $sort_days and $cache_time to the ACP page, as neither of those are really one-size fits all (although admittedly shouldn't be a significant issue for the huge sites to pop inside the code to tweak them).

      Other than that, I reckon it looks pretty good.

        Attachments

          Activity

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              paul.j.murphy paul.j.murphy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: