We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    I’ve been racking my brain for several hours trying to figure out what I changed or what changed to make my dates show up this way. They were working fine, but now they’re not. I’m just using ditto to aggregate some articles associated with a specific page. When I first set up the snippet and all was good, but today they stopped working. I’ve looked all over the forums, but nothing that I’ve found has helped.

    I’m using the latest non-SVN version of ditto, ModX 0.9.6.1p2, PHP 5.2.6, MySQL 5.0.45 and here is my call:
     [!Ditto? &parents=`8,12,44,180,181,182,183,184,185` &tpl=`Coverage` &tagData=`tvpageKeywords,tvthemes,tvstuff,tvbigTags,tvlittleTags,tvetfExchangeTags` &tagDelimiter=`,` &tagMode=`onlyTags` &tags=`[*longtitle*],[*menutitle*],[*description*],[*pageKeywords*],[*pagetitle*]` &display=`2` &extenders=`summary,dateFilter` &dateSource=`pub_date` &dateFormat=`%B %e, %Y` &orderBy=`pub_date DESC` !]


    Remember, they were showing correctly, but now they’re not. I’m going to check with my host to see if there were recently any changes made. Thanks.

      The MODx has you...
      Utah Web Design
      • 26435
      • 1,193 Posts
      Most (if not all) of the dates in MODx are stored as a unix time stamp which, of course is the amount of time in seconds since the Unix epoch (January 1st 1970 00:00:00 GMT). A date before January 1st 1970 can be calculated using a negative digit, and depending on your server’s time zone and php configuration, the value of 0 may reflect a date of Dec 31 1969.

      PHP will treat a null or false value as 0. If it cannot find the value of the date because the variable does not exist, it will return 0. If something happened to your database and the date field is blank, it will return 0 and subsequently show a date of Dec 31 1969.

      The most likely errors are a typo, an error saving to the DB, or a corrupt table.

      If you did not change any text in the Ditto snippet call, log into your server and run a check on your DB tables, or at least check in with phpMyAdmin and check the value of the published on field for the document. You can convert it to a human readable date here: http://www.unixtimestamp.com/

      -sD-
      Dr. Scotty Delicious, DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 4749
        • 623 Posts
        The doctor is back! Thanks for the reply and thorough explanation. The only thing I can think of is that there’s something wrong in the snippet call. I’ve checked the db tables and all is well - at least as far as I can tell. So, I’m at a loss. I’ve done a lot of searching and haven’t found anything of value yet or anything that’s fixed the problem. I’ll keep looking for a solution, but if you have any other ideas to try I would be happy to oblige. Thanks again.

        I’ve found this topic: http://modxcms.com/forums/index.php/topic,5704.msg99915.html#msg99915
        I don’t think it’s the same problem, but the idea may be a solution to my problem. Let me know what you think.
          The MODx has you...
          Utah Web Design
          • 26435
          • 1,193 Posts
          What gets displayed if you put
          <p>[*pub_date*]</p>
          

          somewhere in the {{Coverage}} chunk

          -sD-
          Dr. Scotty Delicious, DFPA.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
            • 4749
            • 623 Posts
            1212552000 - it’s showing the unix time stamp! And in doing that I just realized that all of my dates sitewide are bad, not just in that ditto call.  :’(

            Oops! it was 0 not the unixtimestamp. When I put [+pub_date+] it showed up with the timestamp, but when I put in [*pub_date*] it showed up 0.
              The MODx has you...
              Utah Web Design
              • 26435
              • 1,193 Posts
              my bad.
              From the Chunk [*pub_date*] in the chunk will grab the published on date for the page that Ditto is being called on where [+pub_date+] is a placeholder set by ditto to hold the actual output of the [*pub_date*] variable from the page it is parsing.

              So, for clarfication, when you put [+pub_date+] in a paragraph block in the tpl chunk, it shows a timestamp or 0?

              -sD-
              Dr. Scotty Delicious, DFPA.
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 4749
                • 623 Posts
                When I put in [+pub_date+] it outputs the timestamp - 1212033600
                When I put in [*pub_date*] it outputs - 0
                  The MODx has you...
                  Utah Web Design
                  • 26435
                  • 1,193 Posts
                  You say when you first set it up it was working fine. Do you remember some of the things that changed when it stopped working?
                  Did you change the Ditto call?

                  My first suggestion would be to copy your Ditto call and paste it in a text editor for safe keeping, then start from scratch with the call.
                  [!Ditto? &parents=`8,12,44,180,181,182,183,184,185`!]

                  If that works, and you see a date on the entry with the default template provided by Ditto, then start adding parameters back one at a time.

                  -sD-
                  Dr. Scotty Delicious, DFPA.
                    Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                    All of the above... in no specific order.


                    I send pointless little messages
                    • 4749
                    • 623 Posts
                    Well, that *probably* isn’t it, because it’s now site wide - not just that Ditto call. I noticed it on that ditto call, but now I checked the blog and it’s all screwed up too. huh
                      The MODx has you...
                      Utah Web Design
                      • 4749
                      • 623 Posts
                      Anybody willing to take this on? :’(
                      I noticed a couple other postings about it, but nothing that has helped me solve the problem. Thanks.
                        The MODx has you...
                        Utah Web Design