rss feed not in chronological order.

Help
Max Steel
2008-02-13
2013-03-06
  • Max Steel
    Max Steel
    2008-02-13

    I just realized that when someone uses a rss reader to view my wiki, the entries are not in chronological order (sorted by date, with the newest entry at the top of the list).

    How can I fix this?
    Thanks!

     
    • Can you give your URL? And which entries? I want to look at it.

      Thanks,

      S. B. Lisesivdin

       
    • Max Steel
      Max Steel
      2008-02-18

      The Wiki is here:
      http://www.cnpensioners.ca/wiki/

      The RSS feed (that's our of order) is here:
      http://www.cnpensioners.ca/wiki/index.php?rss=blog

      It's a non-profit organization that I created a site for.

      Thanks for any help, in advance!

       
      • Hi again,

        I think the problem is caused by the creation dates of those pages. Wikepage is use the real unix dates to order the entries. So if your file creation dates are somehow mixed, the problem  arises.

        Now,.. you can copy the files with ftp again, mostly it will upload the files in name order (name order is also consistent with the chronological order) so automaticly, your file's creation dates will be in order. Or try to copy them to another folder one by one in name order (oldest first).

        I wish these will work.

        Good luck.

         
    • Max Steel
      Max Steel
      2008-02-20

      The filenames match the correct system date:

      example
      Entry-2008-02-08_12-48-27 has a system file date of 08/02/2008 12:48  --  They match!

      It is weird that the blog is in order, but the rss feed is not.

      It is the rss feed that I would like to fix.

      Any other ideas?

       
    • Max Steel
      Max Steel
      2008-02-20

      see new wiki entry here:
      http://www.cnpensioners.ca/wiki/index.php?blog=10

      The first one is titled: "CN Pensioners Golf - June 10th, 2008"

      but on the RSS feed:
      http://www.cnpensioners.ca/wiki/index.php?rss=blog

      The first one is titled: "January 2008 General Meeting Rescheduled"

      They wiki and the rss feed have different orders.  The wiki is correct.  The rss feed is wrong (out of order).

       
    • Max Steel
      Max Steel
      2008-02-20

      oops typo for the previous post here is the correct link:

      see new wiki entry here:
      http://www.cnpensioners.ca/wiki/

      (not http://www.cnpensioners.ca/wiki/index.php?blog=10 )

       
    • Max Steel
      Max Steel
      2008-02-20

      I figured it out!!

      Here's the fix:

      In index.php find this section:

      ---code---
      <rss version="0.91">
      <channel>
      <title><?php echo $pagevars["sitename"]; ?></title>
      <link><?php echo $pagevars["url"]; ?></link>
      <description><?php echo $pagevars["siteheader"]; ?></description>
      <language><?php echo $langu; ?></language>
      <?php
      if ($rssname=="blog" or $rssname=="Blog"){
      $content="";
      $handle=opendir($data_dir);
      $allpages=array();
      while( $newfile=readdir($handle) )
          if(preg_match("/(Entry-[\w]+)/",$newfile) )
              $allpages[]=$newfile;
      //add this sort function right here:
      sort($allpages);           
      ---end code---

      This is the section that creates the RSS feed, what is missing is the "sort" function..  So after the last line add "sort($allpages);" (see the comment // above in the code and the line directly after) and it fixes the out of order rss feed!