We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4873
    • 11 Posts
    Going through similar problems as Pixelchutes, but unable to make it work! Here’s the debug data

    DittoCal Debug Output
    Initial Data from Json

    Data after JSON decoding

    Filter Settings

    Filter Month: 1
    Filter Year: 1970
    Processing Error

    There was an error processing the json data. Set the debug param equal to 1 for more info.

    I had to the curl_init(); hack since the hosting service hasn’t set up file_get_contents . My JSON output file seems OK:

    {
     "title":"Blog json output",
     "link":"http://mysite.com/index.php?id=3",
     "description":"",
     "language":"en",
     "copyright":"Proyeccion Tango 2007",
     "ttl":"120",
     "entries":[
    	{
    	 "title":"FESTIVAL INTERNACIONAL DE TANGO DE SITGES",
    	 "link":"http://mysite.com/index.php?id=16",
    	 "date":"1180117461",
    	 "guid":"http://mysite.com/index.php?id=16",
    	 "author":"Default admin account",
    	 "description":"Del 18 al 22 de Julio",
    	 "introtext":"Texto explicativo y breve del intensivo. Cras in nulla sit amet tellus interdum egestas. Curabitur iaculis diam quis neque. Donec urna quam, laoreet eget, rutrum id, faucibus viverra, neque. ",
    	},
    	{
    	 "title":"EL LABORATORIO DE JUNIO",
    	 "link":"http://mysite.com/index.php?id=15",
    	 "date":"1180722209",
    	 "guid":"http://mysite.com/index.php?id=15",
    	 "author":"Default admin account",
    	 "description":"Domingos 3, 10 y 24",
    	 "introtext":"Te esperamos.... en febrero del año siguiente. Desde entonces han participado en los espectáculos.",
    	},
    	{
    	 "title":"INTENSIVO DE MILONGA",
    	 "link":"http://mysite.com/index.php?id=14",
    	 "date":"1181759109",
    	 "guid":"http://mysite.com/index.php?id=14",
    	 "author":"Default admin account",
    	 "description":"Del 9 al 13 de Julio",
    	 "introtext":"Texto explicativo y breve del intensivo... Buenos Aires en septiembre de 2001, y comienzan a trabajar juntos en Madrid en febrero del año siguiente.",
    	}
     ]
    }


    I’m using Modx 0.9.6, Ditto 2.0.2 and DittoCal 1.2.

    Anyone can help?

    Thanks,

    Cevic
      • 34162
      • 1 Posts
      Hi everybody, I’m a french coder (sorry for my english) and I need help about Modx and DittoCal.

      For one week, i try to use DittoCal without any results... The JSON output seems to be right but Dittocal can’t generate the calendar. Thus, I have some questions (I’m on Modx 0.9.5) :

      - Which versions of Ditto and DittoCal may I use ? Currently, I use Ditto 2.0.2 and DittoCal 1.2. Is there any incompatibility between versions ?

      - What is the correct format for the date in Ditto. (I use %d-%m-%Y).

      - What are the corrects calls of Ditto and DittoCal. Maybe I’m wrong ?? I use
      [!Ditto?startID=`23` &summarize=`100` &format=`json` &dateFormat=`%d-%m-%Y` &sortDir=`desc`!]  
      and
      [!DittoCal? &calSource=`http://www.mywebsite.com/blog_json_output` &dayNameLength=`1`!]


      - Is friendly Url important with DittoCal ?

      - When I set the debug parameter to 1, I show the filter year to 1970 !! Is it normal ?


      Thank you for your help....


        • 17717
        • 433 Posts
        Hi all,

        I’m loving DittoCal, I have another site that I would like to use it on, however, I don’t seem to be able to use it for a particular purpose. I basically need to try and have entries on the calendar that are published from a future date, rather than the date I publish the document. For instance, I have an event in January 2008, I would like to publish an article about it today, but have it displayed on the calendar in the January 2008 display, if that makes sense.... not sure how this could be done to be honest with the default publishing controls of MODx.

        Can it be done?

        Thanks
        Lee
          http://www.blend.uk.com | Web Design by Blend
          • 17673
          • 194 Posts

          The original (current) version of DittoCal does not perform as I would expect (at least on my install), with regards to synchronization between displayed article(s) and calendar month.
          -for example:


          • clicking on ’previous month’ would display that month for the calendar, but the articles list does not realign with it
          • clicking a day link (in any month) would load the articles posted on that day, but displays the calendar month of the current date

          DittoCal defines 2 separate classes of url-parameters to control calendar generation and articles’ selection; the problems described above derived from the way these parameters where attached to the various links. By attaching all such parameters to all links, I have achieved a synchronized behaviour (see http://wwwtest.bo.ingv.it/contents/News.html and click around...).

          Take a look at the patched version below; just a few quick&dirty hacks (look for the ’//LUKWE:’ comments ) but hopefully you’ll find the approach useful enough to be cleaned up and included in a future version.


          Since I was at it I also modified the HTML output to make the TABLE fully accessible, this actually pertains more to the included PHP-Calendar DittoCal imports, I’ll forward this thread to the developer too:


          • added summary, caption, scope, abbr, headers attributes in order to have a semantically-sound structure fully navigable with a screen reader.

          • added an extra ’&language’ parameter in the snippet call to perform set_locale for month_names & day_names, and get localized strings for captions etc from a language file (see atached sample for it).


          CIAO!


            ----------------------------------------------------------
            http://www.linkedin.com/in/lucapost/
            http://www.twitter.com/lukwe/
            ----------------------------------------------------------
            • 13428 ☆ A M B ☆
            • 1,031 Posts
            Some corrections to DittoCal 1.2
            Bugfixing parameter &id is not used in previous/next month links
            Adding a two CSS-Classes.


            Modified lines 150-152: parameter &id was not used
            if (isset($_GET[$prefix.'_month']) && isset($_GET[$prefix.'_year'])) {
            $filterMonth = $_GET[$prefix.'_month'];
            $filterYear = $_GET[$prefix.'_year'];
            


            Modified lines 234-235: parameter &id was not used
            $prevArgs = $prefix . '_month=' . $prevMonth . '&' . $prefix . '_year=' . $prevYear;
            $nextArgs = $prefix . '_month=' . $nextMonth . '&' . $prefix . '_year=' . $nextYear;
            


            Inserted lines 290-292: CSS-class for ’today’
            $checkCurDay = date('j',time());
            $checkCurMonth = date('n',time());
            $checkCurYear = date('Y',time());
            


            Modified line 307: CSS-class for ’last days of previous month’
            if($weekday > 0) $calendar .= '<td class="prevDays" colspan="'.$weekday.'"> </td>'; #initial 'empty' days
            


            Inserted line 313: CSS-class for ’today’
            $isToday = (($checkCurDay == $day) && ($checkCurMonth == $month) && ($checkCurYear == $year));
            


            Modified line 318: CSS-class for ’today’
            $calendar .= '<td'.($classes ? ' class="'.htmlspecialchars($classes).($isToday ? ' today' : '').'">' : '>').
            


            Modified line 321: CSS-class for ’today’
            else $calendar .= '<td'.($isToday ? 'class=" today"' : '').'>'.$day.'</td>';
            


            Modified line 323: CSS-class for ’first days of next month’
            if($weekday != 7) $calendar .= '<td class="nextDays" colspan="'.(7-$weekday).'"> </td>'; #remaining "empty" days
            


            Regards
            Jako
              • 19545
              • 22 Posts
              Hi everybody,

              First of all, thanks for that great snippet that is DittoCal. After a few problems (for newbies...I’m one of then, sorry) to get it work properly, now it’s more or less ok.... but..

              1) How can I change the current locale lang setting. I would like my calendar to display days name in french

              2) Is there a way when using this calendar for multiple posts that will occure in the future that the calendar displays at first the current month with workin previous and next. Actualy I have posts for october, november 2007 and january 2008. But I would like this calendar to start at the current month (october), not at the month of my last post (January 2008). I’ve tried the &sortDir in ditto’s call. It works with ASC but I get problem 3). With DESC I get the last post.

              3) Pretty much the same problem as above but with a nuance : when the current month is shown correctly (meaning I’ve resolve point 2), the "next" link doesnt appear, so that I can’t get what will occure in the future.

              Any solutions ?
              thx for your answer
                • 19545
                • 22 Posts
                OK I solved most of my problems using Ditto 2.3

                but still the same problem with the first month shown. I would like to display the actual monthn at first, not the first or the last month were I putted the post.

                Can anybody help me ?

                  • 17673
                  • 194 Posts
                  OK I solved most of my problems using Ditto 2.3

                  where did you get that??!? you probably meant 2.0.3; since the latest Development version is Ditto2.1.BETA2 (BTW had Mark flew away for ever after this late-august release? )

                  but still the same problem with the first month shown. I would like to display the actual monthn at first, not the first or the last month were I putted the post.

                  play around with url parameters attached to your url i.e.:

                  http://www.yourdomain.com/News.html?newspage_month=09&newspage_year=2007&newspage_day=21&cal_month=09&cal_year=2007

                  see my patch in an earlier post above, it took me some time but I got it to work exactly as I needed; sorry I don’t remember all the details right now and neither I have time to go over it line by line to give you a definitve solution...
                    ----------------------------------------------------------
                    http://www.linkedin.com/in/lucapost/
                    http://www.twitter.com/lukwe/
                    ----------------------------------------------------------
                    • 19545
                    • 22 Posts
                    Thanks for your answer! but sorry for being a newbie..... it doesn’t work any better :

                    - I dont use friendly urls, seems your patch only goes with friendly urls. The pn links doesn’t work correctly by me (returning homepage).
                    - Language pack ok, but the days name and month still in english.. ; (

                    Otherwise the problem of the begining month is still the same. I still get or the month of my first post or the last (depending on &sortBy in Ditto). I would it to be the current month, without regards to the posts. Ex: I have posts for September, October and December. I want my calendar to display the october month if we’re in october, november if we re in november, aso. And not the month of the first/last post only

                    I use MODx 0.96, Ditto 2.1 BETA2 (and not the non-existing 2.3 as said above..) and DittoCall 1.2

                      • 3875
                      • 29 Posts
                      hi;
                      just one question about the use of dittoCal:
                      after the dittocal call, do i have to make another ditto call to display the results?
                      I mean i can see the calendar (without any links), but i can’t see the content of my documents, even if i call the [+content+] placeholder?
                      thanks