1 of 2
1
Plugin: display public Google Calendar
Posted: 11 May 2008 08:33 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  104
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: 484)
 Signature 

Majides, Inc.
Fuelling CodeIgniter and ExpressionEngine from Japan

Profile
 
 
Posted: 03 June 2008 04: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 07:41 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  104
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 02:32 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  406
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 10: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 10:49 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  406
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 09:22 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  372
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 09:54 PM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  406
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 08:14 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  37
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 04:23 PM   [ Ignore ]   [ # 9 ]  
Lab Assistant
RankRank
Total Posts:  148
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 04:10 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  200
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 

Valon Sopi // Lead Interactive Designer @ boldUnderline. LLC
Prishtina, Republic of Kosova (ROK)
http://boldUnderline.com

Profile
 
 
Posted: 07 November 2008 04:33 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  200
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 

Valon Sopi // Lead Interactive Designer @ boldUnderline. LLC
Prishtina, Republic of Kosova (ROK)
http://boldUnderline.com

Profile
 
 
Posted: 29 May 2009 06:27 PM   [ Ignore ]   [ # 12 ]  
Summer Student
Total Posts:  2
Joined  03-26-2009

Is there anyway one of you could explain this to me? I’ve implemented the code

{exp:gcal gcal_id="a4dllr27klnnfao1iv9qvltack@group.calendar.google.com" from="June 3, 2009" show_future="true" orderby="d" limit="5"}
                
<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}

I’m a bit confused as to what the id actually is. I’ve grabbed it from my google calendar settings page but the events I have posted are not showing up.

From what I understand I drop the two files in the pi.gcal folder into my plugins folder and use the above code to call the plugin.

If I’m understanding this right I should not have to make a new template, that should be dynamically created by the php and inc file pulling the rss information from google.

I would love some help on this please.

Travis

Profile
 
 
Posted: 04 June 2009 11:46 AM   [ Ignore ]   [ # 13 ]  
Summer Student
Total Posts:  2
Joined  03-26-2009

just an update.

Once I took out the from=“June 3, 2009” the code worked fine for me. Just in case anyone else is having any problems.

I’m also looking for a solution to display events from multiple calendars if anyone has any directions to point me in.

Thanks

Travis Masingale

Profile
 
 
Posted: 19 July 2009 07:12 PM   [ Ignore ]   [ # 14 ]  
Summer Student
Avatar
Total Posts:  26
Joined  02-24-2009

@tmassingale,

thanks for that tip. I had to remove it too. I wish I could get the from and to attributes working though.

@all,
I’m also having the strange order problem and the repeating events not showing up right (i.e. the repeating event is weekly but the only one showing up is one from 2011! strange)

Also, the all day events are showing strange dates. i.e. if the date is Oct. 24 and all day is marked, it is showing the date as oct. 23 at 7pm to oct. 24 at 7pm.

any help?

 Signature 

- paul j.

Profile
 
 
Posted: 12 August 2009 11:02 PM   [ Ignore ]   [ # 15 ]  
Summer Student
Avatar
Total Posts:  12
Joined  10-05-2008

The plug-in works great for me.  I was wondering if someone knows how to paginate the results.  I have numerous future events that I would like to limit to about 20 per page.  Any Ideas.  The pagination code does not work.

Thanks

Profile
 
 
Posted: 16 October 2009 05:22 AM   [ Ignore ]   [ # 16 ]  
Grad Student
Avatar
Rank
Total Posts:  44
Joined  01-19-2009

I would really love to be able to use this…I’ve been sitting forever tweeking “pi.gcal.php doc” trying to get the title and description to display something. I’m really not a php programmer.  Date and description come up. Link is malformed. 

http://gsis.amystoddard.com/calendar


A simplified version of this other script works fine on my server here, but I don’t understand all the caching code to make it work within an ee template. 

Likely has nothing to do w/ it, but my error log (public root) says:
[16-Oct-2009 05:04:09] PHP Fatal error:  Call to undefined method GCal::_curl_fetch() in /home/amystodd/public_html/dev/gsis/admin/plugins/pi.gcal.php on line 91

Matt, will you help me get this working?

 Signature 

Amy Stoddard
http://www.amystoddard.com
Bundang, South Korea

Profile
 
 
Posted: 25 October 2009 06:01 PM   [ Ignore ]   [ # 17 ]  
Summer Student
Avatar
Total Posts:  26
Joined  02-24-2009

@aimelise, can i see your tag code for the plugin? i’m still having the same troubles I mentioned a long time ago in my above post. thanks.

 Signature 

- paul j.

Profile
 
 
Posted: 25 October 2009 08:55 PM   [ Ignore ]   [ # 18 ]  
Grad Student
Avatar
Rank
Total Posts:  44
Joined  01-19-2009

@ Paul J.  I couldn’t get this plugin to work, so I went about it a different route.  I used PHP to render XML that’s easier to step through.  That XML gets imported to an EE weblog using BrandNewBox.co.uk’s XMLGrab plugin.  I’ll post a full explanation of everything once its implemented.

I attached the PHP Script that renders the XML.  From there you should be able to get the XMLGrab plugin to work.

File Attachments
google-general.zip  (File Size: 4KB - Downloads: 59)
 Signature 

Amy Stoddard
http://www.amystoddard.com
Bundang, South Korea

Profile
 
 
   
1 of 2
1
 
‹‹ 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 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120257 Total Logged-in Users: 70
Total Topics: 126393 Total Anonymous Users: 35
Total Replies: 664710 Total Guests: 320
Total Posts: 791103    
Members ( View Memberlist )