Gcal sidebar WordPress Plugin

What is it?

GCal Sidebar is a a wordpress plugin that pulls a calendar from Google Calendar and displays it in the sidebar of your blog. The current version is 2.4, all known bugs have been fixed. It is used in many wordpress blogs. Where possible I try to pull as much information from the feed as I can. Follow the Gcal Sidebar news feed for updates.

Latest Release

  • GCal Sidebar 2.11 is out. In addition to a timezone fix for all day events, I changed the way it displays shortcode. Previously I simply wrote to the HTML stream. This could lead to errors in layout. Now, I return the HTML to WordPress for injection into the stream. There are no known issues with this release.
  • GCal Sidebar 2.8 is out. This is a bugfix release. 2.7 was horribly buggy, thanks to Chad and David Schroeder for taking the time to point out some of the flaws that I missed. Here's the list of bugs fixed, I don't know of any other issues, but if you guys take the time to let me know, they'll get fixed in short order.
    • Fixed bug using gmdate instead of local date, causing events to show up on the wrong day
    • Fixed bug causing an empty event to show up at the head of the list
    • Fixed bug where h3 was injected into the title incorrectly
    • Better input validation
  • GCal Sidebar 2.7 is out. This release is all about shortcodes. [ gcal-sidebar feed_id="FEED_ID" ]  to use the new shortcode. Mode and show_date are only supported by shortcode currently, I'll be working on converging the options for shortcodes and widgets over the next couple of weeks.

    List of shortcode options (Default options are first):

    • map_link=[0|1] 0 disables the map link, 1 shows a link to the location in google maps.
    • mode=[agenda|prose] agenda will display the title and time of the event, prose displays the title, then description
    • show_date[none|short|long] none displays no date header, short displays "Thu, Dec 2", long displays "Thursday, December 2"
    • pub_or_priv[0|1] 0 is a public calender, 1 is a private calendar
    • priv_id=[STRING] STRING is the private key of the calendar, see the FAQ for instructions on how to get it.
    • rs_offset=[0|number] lets you ignore the first X results
    • max_results=[4|number] Set the number of results to display in your calendar

How do I install it?

  1. Download the latest version
  2. Upload it to your WordPress server
  3. Activate it.

How do I use it?

  1. Get the calendar ID of the Google calendar you want to display, (Settings on the calendar drop down, then look for the Calendar Address entry in the table. Please note, the calendar must be a public calendar currently.
  2. Log into your WordPress server.
  3. Go to Appearance -> Widgets and add the Gcal Sidebar widget where you like.
  4. Configure within the widget

What config options are there?

  • ID: This is the Google ID of the calendar you want to display.
  • Title: What do you want as the heading(or title) for this widget?
  • Title URL: Should the title link someplace? If so, where?
  • Max Results: How many entries do you want to display? (Default is 4)
  • Results offset: Ignore the first X number of events. Useful to display different portions of the same calendar in different widgets.
  • Display link to map: Enabling this feature will add a link to a Google map surrounding the Location of the event.
  • Single Event URL: Do you want each event to link to the same location? Or back to the Google page for that event?
  • Public or Private: Allows you to set the private key for a calendar.
  • Timezone Offset: This should never be needed anymore.

What shortcode options are supported

  • map_link=[0|1] 0 disables the map link, 1 shows a link to the location in google maps.
  • mode=[agenda|prose] agenda will display the title and time of the event, prose displays the title, then description
  • show_date[none|short|long] none displays no date header, short displays “Thu, Dec 2”, long displays “Thursday, December 2”
  • pub_or_priv[0|1] 0 is a public calender, 1 is a private calendar
  • priv_id=[STRING] STRING is the private key of the calendar, see the FAQ for instructions on how to get it.
  • rs_offset=[0|number] lets you ignore the first X results
  • max_results=[4|number] Set the number of results to display in your calendar

Contributors

  • Kevin Gruber – Funding display offset feature
  • Luis Esparza – Development of private calendar support
  • Brady8 – All day event support
  • Ned – Rich snippets support

What Can I expect in the future?

How much does it cost?

  • Gcal Sidebar is provided free of cost under the GPL (Gnu Public License). If you like it and use it, we do appreciate donations.


28 Responses to “Gcal sidebar WordPress Plugin”

  1. Peter says:

    Hi,

    I cannot get this to work with my public google calendar.

    This is the error I get when I try using the xml, or the html, or the ical embed code.

    Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: Entity: line 1: parser error : Start tag expected, ‘<' not found in

    Pls assist

  2. Kevin Gruber says:

    Gcal Sidebar 0.4 works perfectly!

    I take one more advantage of the result offset function: I use a theme with 3 featured sidebar columns. The widget is multiple, so I place Gcal widgets in each column. In the widget of the left I display the upcoming event. In the middle column I display the 2nd event. In the 3rd column I display the next event as an event preview.

    So the screen result looks like a newspaper page with 3 justified event articles in order from left to right.

    I like this feature! It´s brilliant!

    Thank you!

  3. Ian says:

    I would be very interested in this plugin having multiple calendar support and also an ability to put directly in a template with a function, instead of just a widget.

  4. admin says:

    Multiple calendar support is somewhat problematic, but it is on my list of things I want to do. It used to have function support before I made it a class. I’ll look into adding that function again.

  5. Chris Hajer says:

    I would like to see multiple calendar per widget support as well. If you’d like someone to beta test for you, I’d be happy to.

    Thanks

  6. rjune says:

    I’m actually working on that feature right now. It’s a pain, because the config has to change a bit. You can see what I’m doing at http://testing.oriontechnologysolutions.com/ That’s my dev setup, and it changes often and irrationally, depending what I’m working on.

  7. rjune says:

    Ok guys, I’ve got 2.0 ready for testing. It has multiple calendar support. http://www.oriontechnologysolutions.com/download/gcal-sidebar/gcal-sidebar.2.0.zip

  8. rjune says:

    I forget to mention. to specifiy multiple calendars seperate calendar IDs with a ‘,’. So if you wanted CAL1 and CAL2, then specifiy CAL1,CAL2 in the ID field

  9. Ned says:

    Great plugin! I made some very minor modifications to lines 427-445 so that the events will be parsed by google’s rich snippets tool (http://www.google.com/webmasters/tools/richsnippets). I put the mods here: http://modwheel.org/gcal-rich.txt

  10. Danny says:

    This is a great widget. It got better when I found out it supported Multiple Calendars!! If I would like to change the line spacing, which file would handle the html output?

  11. rjune says:

    There are only two files, the plugin file and the readme. You can edit the stylesheet for your feed, or the display_feed function in the plugin file.

  12. xovut says:

    Hi rjune, great calendar plugin! I had the same issue as some of the others when i first installed. Showed the date (1 Jan 1970 730am – 730am) when I first installed it. Upon inputting events it went away. Would the problem come back once the events have ‘expired’?

    The second thing I wanted to know is how I could put a subscribe to this calendar button at the bottom of the widget.

    Your help is appreciated. Thanks!

  13. bug says:

    agree, get the same parser bug error with any calendar feed

    Entity: line 1: parser error : Start tag expected, ‘<' not found in wp-content/plugins/gcal-sidebar/gcal-sidebar.php on line 340

  14. […] 7th, 2011 No Comments I got a call the other day from Megan over at Kicks N Daisies. She used GCal Sidebar to display a Google Calendar in wordpress and wanted to hide the details of a calendar entry until […]

  15. watusi says:

    How about All Day / Multi-Day events displaying properly? Any plans to fix that? I love the plugin – it works great / looks great / I just wish that when I schedule an All day/ Multi-day event that the entry on the Calendar would display that information, rather than only the first date and 8PM – 8PM. PLEASE fix it – then it will be perfect! : )

  16. F6 says:

    Hi Rjune, i’ve tried evrything but still doesn’t work… Thank U!

    SimpleXMLElement::__construct() [simplexmlelement.–construct]: Entity: line 2: parser error : AttValue: ” or ‘ expected in /home/a6967311/public_html/wordpress/wp-content/plugins/gcal-sidebar/gcal-sidebar.php on line 369

  17. Ingebjørg says:

    I really want this widget to work but get an errow message about line 369. Tried to enter the little code you gave : echo $feedUrl; but it still doesn´t work.

    Any idea???

    Thanks

  18. Ingebjørg says:

    This is what I get when I install the widget:

    Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: Entity: line 1: parser error : Start tag expected, ‘<' not found in /home/ballet/public_html/wp-content/plugins/gcal-sidebar/gcal-sidebar.php on line 369

    Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: Invalid request URI in /home/ballet/public_html/wp-content/plugins/gcal-sidebar/gcal-sidebar.php on line 369

  19. I’ve seen this same issue in version 2.9. I fixed it by adding this as the first line to the get_feed function:

    date_default_timezone_set( $instance[‘timezone’] );

    Hope this helps you out. If someone could add this and push out an update that would be great!

    Cheers,

    -Xavier

    • Richard June says:

      PHP really wants you to set the timezone in the config file. Failing that, I pull timezone from either the config or the calendar if the config doesn’t specify it. get_feed only pulls the file from google, so I’m at a loss as to why it would affect anything.

  20. David says:

    Using v2.9 the “All Day” line in the php is missing the subtraction of date(“Z”) so that the timezone for all day events is adjusted for in the sidebar agenda view in WordPress.

    E.g. if I setup a google calendar all day event on 8/17, our wordpress site was showing the event as “All Day 8/16”. I added the subtraction of the timezone like was shown about 3 lines above the “All Day” logic and it worked in that case too.

    Thanks
    -db

    • Richard June says:

      Do you have a patch or can you post your mod?

      • David says:

        I don’t have a patch, I did the edit right in WP plugins editor on the website I admin. Here’s roughly what I did, I searched for “All Day”, only found one (v2.9), then added the date “Z” adjustment like I saw a few lines above it. This is in the “Agenda” section of the plugin.

        I hope it displays in the blog…

        // Added – date(“Z”) so it effectively adds our timezone info -db
        $body = “All Day on ” . date(“l, F j”, $event[‘startTime’] – date(“Z”));

        Thanks

Leave a Reply

WordPress Themes