We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    Don’t know if related, but I tried to eval that JSON data what is shown on yetsun’s site and it didn’t eval at first because i had saved the file in Unicode format to get the kyrillic characters to save. But after saving it in UTF-8 it evaled nicely in javascript eval()..


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 33114
      • 518 Posts
      so...do I have to setup my site on using UTF?
        http://modx.ru - российская поддержка MODx
        http://newscup.ru - экспериментальный проект
        http://yentsun.com - персональный сайт
        • 15987
        • 786 Posts
        I was just looking at the docs for the JSON.php file and it says the following:

        All strings should be in ASCII or UTF-8 format!

        so looks like it will need to be in that format for it to work. I will see if I can find anything that works without this restriction.
          • 17052
          • 41 Posts
          so UTF - all my problem ?
            • 15987
            • 786 Posts
            I think so
              • 33114
              • 518 Posts
              Thanks Kylej! Will try to set up UTF
                http://modx.ru - российская поддержка MODx
                http://newscup.ru - экспериментальный проект
                http://yentsun.com - персональный сайт
                • 4945
                • 3 Posts
                Hi Kylej, first of all, big thank you for your job on this calendar grin .

                As you can imagine, if I post here that’s because of an issue I don’t understand smiley

                So DittoCal is well configured and I can manage items of 1 blog on my website (no flash in documents in this blog)
                But , for the second blog (same site, just a subarea) I have an item ’blocking’ the snippet and generating an error (this document contains a flash animation).

                Here is the JSON output of my DittoCall document (which is call in [!DittoCall? ....!] :


                {
                "title":"DittoCal page",
                "link":"http://IPADRESSE/modx/index.php?id=39",
                "description":"",
                "language":"english",
                "copyright":"Value (modx) 2006",
                "copyright":"Value (modx) 2006",
                "ttl":"120",
                "entries":[

                {
                "title":"Scénario du futur - flash",
                "link":"http://IPADRESSE/modx/index.php?id=37",
                "description":"",
                "content":"<object width="100%" height="600" type="application/x-shockwave-flash" data="assets/flash/video/Maquette Flash.swf">
                <param name="movie" value="assets/flash/video/Maquette Flash.</object>
                ",
                "pubDate":"10-08-2006",
                "guid":"http://IPADRESSE/modx/index.php?id=37",
                "author":"Webmaster"
                },

                {
                "title":"Les Scénarios du futur",
                "link":"http://IPADRESSE/modx/index.php?id=36",
                "description":"",
                "content":"On...............

                when the <object> call is removed (part in red), no more issue .... calender is well rendered.

                Here is the content of the document which contains the flash :


                <object width="100%" height="600" data="assets/flash/video/Maquette Flash.swf" type="application/x-shockwave-flash"> <param value="assets/flash/video/Maquette Flash.swf" name="movie" /> <param value="false" name="menu" /> <param value="high" name="quality" /> <param value="opaque" name="wmode" /> <param value="true" name="play" /> <param value="high" name="quality" /> <param name="bgcolor" value="#000000" /> <p>Flash n’est pas intall&eacute; sad </p> </object>

                If you compare this code to the one in the first JSON (part in red) , there is a difference.

                Is it an error from Ditto ? Did i miss something ?
                  • 19871
                  • 6 Posts
                  Hello All,

                  A few days ago I uploaded my webpages to a host server. The server would not allow me to use the php function file_get_contents . Instead of using this line:

                  $source = file_get_contents($calSource);

                  in Dittocal snippet. I used the following lines:
                  $ch = curl_init();
                  $timeout = 5; // set to zero for no timeout
                  curl_setopt ($ch, CURLOPT_URL, 'http://www.example.com' );
                  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
                  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
                  $source = curl_exec($ch);
                  curl_close($ch);
                  

                  To find out more information about why the file_get_contents was not working goto this url:
                  http://wiki.dreamhost.com/index.php/CURL

                  Moses
                    • 15987
                    • 786 Posts
                    chapi456,

                    ditto is just truncating the content and that is why the output looks different.

                    I think ditto will have a customizable template for json output in the next version and you will be able to remove the content from the json output so it will work for you.
                      • 18397
                      • 3,250 Posts
                      Yes, it will.