We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14050
    • 788 Posts
    This is an auto-generated support/comment thread for Google Events.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Grab the events from your Google Calendar and display them as a list and or in a Calendar.

    Features:
    *Template the First, Last, Even, and Odd events.
    *Populate a calendar with clickable links.
    *Skip X amount of events.
    *List a maximum number of events.
    *Chronological and Reverse Chronological list support.
    *CURL support and FOPEN support
    *SimplePie integration
    *Mash Multiple Calendars into one
    *Internationalized
      Jesse R.
      Consider trying something new and extraordinary.
      Illinois Wine

      Have you considered donating to MODx lately?
      Donate now. Every contribution helps.
      • 8806
      • 5 Posts
      Google seems to serve an xml file tailored to the browser, i.e any google calendar xml I touch will be served in swedish. Hence this script will only work for people whom google categorize as english. This makes parsing very tricky since any localized parsing adaptation will only serve thats single locale leaving all other visitors in the dark.

      Old version works fine though.

      I guess one way would be to use the Google Calendar API instead. Any ideas?
        • 14050
        • 788 Posts
        Using the Google Calendar API would be a great avenue to go. Unfortunately I am not familiar with it. The old versions used the xml tags to determine what information it wanted, but the structure of the xml wasn’t always consistent and caused [+where+] tag to hardly every work. The new version just parses the description tag into the relevant parts, using some hard coded English words, which I could probably pull out into a language file that could be translated.

        If you would like to work with me on this, I would be more than happy to attempt it.
          Jesse R.
          Consider trying something new and extraordinary.
          Illinois Wine

          Have you considered donating to MODx lately?
          Donate now. Every contribution helps.
          • 8806
          • 5 Posts
          The problem is that we would have to detect the language of the served feed and have a set of rules for every locale google provides since it isnt the language in the google settings that is used but rather the supposed language of the visitor to your site, if I am not mistaken.

          I’ve not taken a look at the calendar api yet but I suspect its the way to go for a robust solution.

          Another way would be to see if simplepie can force a locale. Shrug.
            • 14050
            • 788 Posts
            I believe Simplepie handles this on its on. I didn’t see a function in their documentation for forcing the locale. But if it is able to pull the description out of each feed item, then my snippet can handle the rest if it knows the keywords to look at in other languages. As such we could just setup language files that could be translated. For instance, to determine teh [+where+] information, I look at the text after the word "Where:" and before an html entity that Google seems to always output.

            I would imagine if you wanted to use this with teh Swedish language, we could just translate what "Where:" is in Swedish, and then parse the infromation based off that translated text.

            Maybe I am misunderstanding exactly what the problem is too grin Do you have any files of the xml that Google is sending if your locale is Swedish?

            How does the demo here work for you:

            http://simplepie.org/demo/

            Are you getting any output on with the GoogleEvents snippet on this Swedish feed, and if so what output are you getting?
            Can you add the &debug=`1` parameter if you are getting output and let me see that?
              Jesse R.
              Consider trying something new and extraordinary.
              Illinois Wine

              Have you considered donating to MODx lately?
              Donate now. Every contribution helps.
              • 8806
              • 5 Posts
              The problem isn’t as hard to sort out as I originally thought. All I have to do is adapt the script to the locale of the web server. For some reason I thought it depend on the visitors locale but that should of course not be the case. The trickiest part is handling the different date format and language. I’ll send you the additions when I’m done.
                • 14050
                • 788 Posts
                The date shouldn’t be that tricky either, or at least I think. I used the date function, but you could go ahead and replace that with strftime located here: http://us3.php.net/manual/en/function.strftime.php

                That uses the locale settings.
                  Jesse R.
                  Consider trying something new and extraordinary.
                  Illinois Wine

                  Have you considered donating to MODx lately?
                  Donate now. Every contribution helps.
                  • 8619
                  • 229 Posts
                  First, thanks for this great snippet!

                  I have it working, but have noticed a problem that I’m not sure if it’s something that I am doing, or a bug.

                  When I add an event to my Google calender, it shows up fine. When I go into the Google Calender, and delete an event, then add another new one on another day, it shows the old events that I have deleted still, and does not show any of the new ones.

                  It is almost like it is not refreshing the cache from the Calender.

                  My snippet call is this:

                  [!GoogleEvents? &email=`[email protected]`&tplFirstRow=`GEfirstrow`&tplEvenRow=`GEevenrow`&tplOddRow=`GEoddrow`&tplLastRow=`GElastrow`!]

                  This is running v.1.3.3 of the snippet.

                  Any ideas? I have tried clearing the site cache, shutting down my browser and reopening it, and a couple of other things.

                  The one thing that seems to work is deleting the ’cache’ directory and reuploading it.

                  THanks!
                    • 14050
                    • 788 Posts
                    Make sure to give the XML feed sometime to update. This is just a limitation with Google usually. After you delete an event and add a new one, give it around 10-20 minutes and see if it is updating on your site.

                    If that doesn’t seem to be the problem, what is your snippet call look like? Add the parameter &debug=`1` and paste the output here. You should see a link that you can click, that will take you to the XML feed. If it doesn’t show the updated information, then the snippet won’t be able to either, again because Google isn’t feeding the feed yet smiley
                      Jesse R.
                      Consider trying something new and extraordinary.
                      Illinois Wine

                      Have you considered donating to MODx lately?
                      Donate now. Every contribution helps.
                      • 8619
                      • 229 Posts
                      Thanks for the quick reply!

                      I believe it to be the update problem between the google calender and the xml feed. It does take a long time for it to update, and it appears as though it is working fine now.

                      Do you know of a way to have Google calender repeat an event every third day? Just curious.

                      Thanks again!