We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4192
    • 43 Posts
    Dear friends,
    I use ListIndexer on my website - and I thought it could be an easy way to list the most recent modified documents. However, it seems this snippet simply list the most recently added documents, without taking into account any modification to the pages already present.
    Does anybody know if there is a method to put into a list also the modified pages?

    Any help would be greatly appreciated!
      • 12332
      • 8 Posts
      Bryn,

      I think you can modify the ListIndexer snippet to sort by edit date and not creation date.

      Edit the snippet and just replace createdon ( the db field for creation date) with editedon

      the snippet sql query should look like this

      $recentSql = "";
      $recentSql .= "SELECT id, pagetitle, description";
      // Include pub_date or createdon date if date is desired
      $recentSql .= ($showCreationDate)? ", IF(pub_date > 0, pub_date, editedon) AS pubDate ": " " ;
      $recentSql .= "FROM $tbl ";
      $recentSql .= "WHERE ";
      // Look everywhere, or just under valid parents
      $recentSql .= (($rootFolder == 0) && $seeThruUnpub && ($descendentDepth == 0))? "" : "parent IN ($validParents) AND " ;
      // Published
      $recentSql .= "$tbl.published = 1 ";
      // Show In Menu
      $recentSql .= ($seeShowInMenu)? " " : " AND $tbl.hidemenu=0 " ;
      // Not deleted
      $recentSql .= "AND $tbl.deleted=0 ";
      // Choose sort method
      switch ($sortBy){
        case 'alpha':
          $recentSql .= "ORDER BY pagetitle ";
          break;
        case 'menuindex':
          $recentSql .= "ORDER BY menuindex ";
          break;
        default:
          $recentSql .= "ORDER BY IF(pub_date>0, pub_date, editedon) ";
          break;
      }


      It allows you to display recently edited items only.

      Hope that helps
        • 33175
        • 711 Posts
        Hello !!

        ListIndexer is an old snippet from Etomite. NewsListing can replace it with more features. It can sort document by all dates of documents. Filteres are supported....

        No hack is needed for more the share of the needs.


          Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
          • 4192
          • 43 Posts
          Quote from: Guillaume at Mar 21, 2006, 04:08 PM

          NewsListing can replace it with more features. It can sort document by all dates of documents. Filteres are supported....
          Thanks, but when I tried to use it on my "news" page, where I’d like to list the 10/15 pages more recently updated, I discovered that NewsListing list the same page as many times as it’s been updated. So, for instance, if one of the pages has been updated 10 times over the last two days, NewsListing list the same page 10 times in a row... Or is there something else I missed?
            • 33175
            • 711 Posts
            It is strange. Could you give us your call to the snippet with parameters ? Thanks
              Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
              • 4192
              • 43 Posts
              OK, I managed to get that snipped to behave correctly  smiley
              Anyway, this are the parameters I use:

              [[NewsListing? &startID=`0` &tpl=`NewsList` &sortby=`editedon` &total=`22` &summarize=`22` &dateformat=`%d %B %Y alle %H:%M`]]
                • 33175
                • 711 Posts
                I can’t reproduce your problem. But to make it work, I have modified call of the snippet like this :
                [!NewsListing? &startID=`0` &tpl=`NewsList` &sortby=`editedon` &total=`22` &summarize=`22` &dateformat=`%d %B %Y alle %H:%M`!]

                Else, you can ask help on the NewsListing topic
                  Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !