We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15987
    • 786 Posts
    Looks like something may be wrong with the data coming in from the json page. Try viewing the json page to make sure the dates are showing correctly for each post.
      • 19645
      • 23 Posts
      Below is a part of the json output. Date format is taken from the modx configuration, I guess?
      {
       "title":"blog json output",
       "link":"http://www.digera.nl/blog_json_output.html",
       "description":"",
       "language":"english",
       "copyright":"Digera.nl 2006",
       "ttl":"120",
       "entries":[
      	{
      	 "title":"Libema Actie",
      	 "link":"http://www.digera.nl/article-1163767496.html"
      	 "date":"17-11-2006",
      	 "guid":"http://www.digera.nl/article-1163767496.html",
      	 "author":"Site Admin",
      	 "description":"",
      	 "summary":"Leuke Actie, doe MEE!",
      	},
      	{
      	 "title":"Landal Greenparks",
      	 "link":"http://www.digera.nl/article-1163452432.html"
      	 "date":"13-11-2006",
      	 "guid":"http://www.digera.nl/article-1163452432.html",
      	 "author":"Site Admin",
      	 "description":"",
      	 "summary":"De sint komt op bezoek bij Landal Greenparks",
      	},
      
        • 15987
        • 786 Posts
        try this and see if it works, looks like the date field is now date: instead of pubdate:

        //Use the month & year passed-in if set else use first post as month & year
        if (isset($_GET['calmonth']) && isset($_GET['calyear'])) {
            $filterMonth = $_GET['calmonth'];
            $filterYear = $_GET['calyear'];
        } else {
            $filterMonth = substr($postData->entries[0]->date,3,2);
            $filterYear = substr($postData->entries[0]->date,6,4);
          • 19645
          • 23 Posts
          Hi Kyle,

          Below is the Debug output. It seems, that there is missing a comma after "link":"http://www.digera.nl/article-1164237832.html".
          This gives [link] => http://www.digera.nl/article-1164237832.html" "date":"23-11-2006 in the array output with [date] remaining empty. the json with the missing comma output is from Ditto 1.1Beta2. Do I have to move this to the Ditto 1.1 thread?

          DittoCal Debug Output
          Initial Data from Json
          
          {
           "title":"blog json output",
           "link":"http://www.digera.nl/blog_json_output.html",
           "description":"",
           "language":"english",
           "copyright":"Digera.nl 2006",
           "ttl":"120",
           "entries":[
          	{
          	 "title":"Landal Parken op de Veluwe/Gelderland",
          	 "link":"http://www.digera.nl/article-1164237832.html"
          	 "date":"23-11-2006",
          	 "guid":"http://www.digera.nl/article-1164237832.html",
          	 "author":"Site Admin",
          	 "description":"",
          	 "summary":"Om u nog beter van dienst te kunnen zijn bij het uit zoeken van uw vakantiepark, zijn er omschrijvingen toe gevoegd van alle Landal GreenParks die gelegen zijn op de Veluwe en Gelderland. ",
          	}
           ]
          }
          
          Data after JSON decoding
          
          stdClass Object
          (
              [title] => blog json output
              [link] => http://www.digera.nl/blog_json_output.html
              [description] => 
              [language] => english
              [copyright] => Digera.nl 2006
              [ttl] => 120
              [entries] => Array
                  (
                      [0] => stdClass Object
                          (
                              [title] => Landal Parken op de Veluwe/Gelderland
                              [link] => http://www.digera.nl/article-1164237832.html" "date":"23-11-2006
                              [guid] => http://www.digera.nl/article-1164237832.html
                              [author] => Site Admin
                              [description] => 
                              [summary] => Om u nog beter van dienst te kunnen zijn bij het uit zoeken van uw vakantiepark, zijn er omschrijvingen toe gevoegd van alle Landal GreenParks die gelegen zijn op de Veluwe en Gelderland. 
                          )
          
                  )
          
          )
          
          Filter Settings
          
          Filter Month: 11
          Filter Year: 6
          Day Array for output
          
          Array
          (
          )
          
            • 15987
            • 786 Posts
            yep, looks like a ditto problem. look at the template being used for the json output and add in the comma.
              • 21056
              • 327 Posts
              In case it helps anyone trying to get this working with Ditto 1.1 (Beta), the name of the date value has been changed in the JSON output, which stops DittoCal working.

              To make it work, replace (in the DittoCal snippet) every occurance of

              pubDate

              with

              date
                Author: ManagerManager plugin - customise your ModX manager interface

                Rckt - web development, Sheffield, UK
                • 23050
                • 1,842 Posts
                Hi there,

                I’ve installed DittoCal yesterday and when I tried to run the page where I want to display DittoCal, mysql server stopped to work... I got the message "too many connections" and CPU charge and RAM charge increased to 99%.

                After a restart of the server, I tried again to access the page : same.

                So, I deleted DittoCal from my install and the site worked.

                But now, if I check the content of database, I see modx_event_log is 1Go ! mysql is slow... I try to get some error logs to show you but it’s long long...

                I’m not sure it comes from DittoCal, unless it’s the only snippet I installed yesterday night... I would like to get some logs to be sure that it comes from DittoCal. I try to tell you when I know.

                Edit : I trunc the modx_event_log table. So I can’t see error logs.

                I forgot to tell you the snippet call : [!DittoCal? &calSource=`[(site_url)]/blog_json_output` &dayNameLength=`1`!]. Is that wrong ?
                  • 15987
                  • 786 Posts
                  Perrine,
                  Try loading the page blog_json_output and make sure it loads correctly. You should see the json output. I’ve never heard of this snippet adding anything to the error log, so I’m not sure if this snippet is causing your problem or not.
                    • 23050
                    • 1,842 Posts
                    Hello Kylej,

                    I guess that maybe I made a mistake using [(site_url)]/blog_json_output as the &calsource

                    I’ve reinstalled the snippet and change DittoCal into the real adresse with http://www.domain.tld/blog_json_output and it works fine now ! smiley
                    I can get also the blog json output loads correctly.

                    But (sorry, there’a "but"), Calendar doesn’t show links on days I’ve written a document. On first load, the calendar shows December 1999... I have to navigate to January 2007 and even there, I don’t see links on days it should.

                    Do I have to do something more ?
                    Thx for your help smiley
                      • 15987
                      • 786 Posts
                      Perrine,
                      What version of ditto are you using? If you are using version 1.1 or newer you need to replace pubDate with date in the dittocal code. I have not had a chance to update this.