Plugin: display public Google Calendar
Posted: 11 May 2008 07:33 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  86
Joined  12-26-2006

Hi all,

I had trouble finding a plugin for displaying Google Calendar events on a page, so I wrote a plugin based on the Twitter timeline plugin and SimplePie.  There were a few Magpie-based attempts, but none of them suited my needs (in particular, being able to parse out start / end times, the location, and description fields, which Magpie was skipping because they’re unique to the Google feed).

At any rate, here’s what sample code may look like:

{exp:gcal gcal_id="bn44qj4p2l2usv6avn45v7lb28@group.calendar.google.com" from="February 10, 2007" show_future="true" sort_order="a" limit="5" refresh="120"}
<ul>
    <
li>
        
{if description}<a href="{description}">{title}</a>{if:else}{title}{/if}<br />
        
from {start_time format="%Y-%m-%d %H:%i"} to {end_time format="%Y-%m-%d %H:%i"} <br/>
        
location: {location} <br/>
        <
a href="{link}">add to your calendar</a>
    </
li>
</
ul>
{/exp:gcal}

In addition to the plugin file (pi.gcal.php), you’ll also need to place the simplepie.inc file in the same location (included in the attached zip).

This is my first plugin, so I’m calling it 0.5 for now.  There are a few outlier parameters Google accepts which I didn’t get around to implementing for now.

Hope this is of use to some.

File Attachments
pi.gcal.zip  (File Size: 64KB - Downloads: 165)
 Signature 

Majides, Inc.
Fuelling CodeIgniter and ExpressionEngine from Japan

Profile
 
 
Posted: 03 June 2008 03:33 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  5
Joined  04-08-2008

Hi,
I’ve been looking for a way to do this!  I have output of all of my page elements except for what should be generated by the plugin.  No errors in the debug.  Does this work with the current version of EE?

Profile
 
 
Posted: 03 June 2008 06:41 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  86
Joined  12-26-2006

Yep, this was built for version 1.6.3.

Have you tried loading the gcal link in something else - either directly in the browser or subscribed via iCal?  also make sure it’s a public calendar - currently this doesn’t support private ones.

lemme know if that does anything.

 Signature 

Majides, Inc.
Fuelling CodeIgniter and ExpressionEngine from Japan

Profile
 
 
Posted: 13 July 2008 01:32 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  402
Joined  03-17-2006

Wow perfect timing! This is exactly what I need. I’ll give it a shot and let you know how it goes. :D Thanks!

Profile
 
 
Posted: 14 July 2008 09:12 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  5
Joined  04-08-2008

Hey ignite, how’d this work out for you?  I never did get it.  I also haven’t tackled it again since my last post.

Profile
 
 
Posted: 14 July 2008 09:49 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  402
Joined  03-17-2006

Actually I just found it yesterday so I haven’t had the time yet. I’ll probably get to it by the middle of the this week. I’ll be sure to post my experience here. wink

Profile
 
 
Posted: 29 July 2008 08:22 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  276
Joined  06-12-2002

Plugin works great for me. One request: could it be expanded to pull multiple calendar feeds (pipe-separated list) and then show all the COMBINED events?

Profile
 
 
Posted: 30 July 2008 08:54 PM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  402
Joined  03-17-2006

I have it partially working. It’s pulling back information but it’s not displaying in the correct order. I’m getting results that go from 2008, to 2017, to 2009, to 2013, and back to 2008. Any ideas as to what I might have wrong?

Profile
 
 
Posted: 05 August 2008 07:14 AM   [ Ignore ]   [ # 8 ]  
Summer Student
Total Posts:  25
Joined  09-24-2007

I’m also having similar issues to ignite with the randomly-ordered stuff if I try to dynamically set start date for displaying cal entries. It seems to order OK if I manually put in a start date.

My repeating events are also not showing up, other than the first occurrences. If I can get those two things fixed, this is great!

Profile
 
 
Posted: 06 October 2008 03:23 PM   [ Ignore ]   [ # 9 ]  
Summer Student
Total Posts:  26
Joined  08-28-2008

I am getting an error: GCal error: Unable to retrieve feed from Google => Invalid value for start-min parameter: c

Any suggestions?

Thanks

Profile
 
 
Posted: 07 November 2008 03:10 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  04-21-2008

Hi Matt:

Thanks for the great plugin as it wasn’t hard at all to implement. I’m having two issues I can’t get my head around:

1. I’m getting this error on my page:
Notice: Undefined index: in D:\web\vhosts\thecubanguy.com\httpdocs\tcgadmin\plugins\pi.gcal.php on line 291

You can view at: http://www.thecubanguy.com/index.php

And…

2. The feed is showing an entry almost 7 days old on top of the list. How do I get the plugin to show upcoming entries from today and on?

Cheers for this great plugin!

 Signature 

Good Design is What Good Business is all About!

Profile
 
 
Posted: 07 November 2008 03:33 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  04-21-2008

Well, I got to suppress the error for now; figuring if everything is working fine. (Hate to do this kind of things, but well tight-deadline).

Added this line on the pi.gcal.php file:

<?php error_reporting (E_ALL ^ E_NOTICE); ?>

 Signature 

Good Design is What Good Business is all About!

Profile
 
 
   
 
 
‹‹ KARMA plugin      Plugin: List Contents ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65087 Total Logged-in Users: 36
Total Topics: 82227 Total Anonymous Users: 21
Total Replies: 441926 Total Guests: 215
Total Posts: 524153    
Members ( View Memberlist )