|
Cookbook /
GoogleCalendarSummary: Embeds a Google Calendar in a PmWiki page
Version: 2006-09-30
Prerequisites: PmWiki 2.x
Status: Initial release
Maintainer: zkarj
Categories: Includes
Questions answered by this recipeHow can I embed a Google Calendar in a PmWiki page? DescriptionEmbeds a Google Calendar in a PmWiki page, for viewing. To install, download googlecalendar.phpΔ and install in your cookbook directory, then add the following line to your config.php include_once('cookbook/googlecalendar.php');
See Notes below for usage. NotesThis recipe adds a The minimal form is:
This will display the specified public calendar with default settings (see below). The calendar is displayed inside an HTML Additional, optional parameters may be specified as follows (defaults in bold).
Specify a title to appear on your calendar. Default is "My Calendar". Best to avoid anything other than alphanumeric and spaces. Essentially anything that can appear unescaped in a URL is fine.
Specify what controls will be displayed.
Specify the type of calendar to display.
Specify the width of the frame (and thus the calendar) in pixels. Default is 640.
Specify the height of the frame in pixels. Default is 610 which is just enough for the default calendar (produced with only the
Control the height of each row of the calendar by specifying the number of events that should fit. Only useful for
Specify which day of the week is in the left-most column of the calendar. Only useful for
Specify the background color of the frame. This is a standard HTML hex value including the leading #.
Specify whether a border is drawn in the frame. This is an appoximately 50% gray, single pixel border. Release Notes
CommentsIn general, only a "public" Google calendar will be shown. If you want to show a private calendar (which, of course, you would only do in a password protected page), use this form: (:GoogleCalendar calendar=myaddress%40gmail.com&pvttk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:) Where xxx... is the key that you get from Google Calendar:
Davide Andrea 11/4/06 Valid XHTML Fix
In 'googlecalendar.php' from line 29 to 47.
from:
------------------------------
$output = '<iframe src="http://www.google.com/calendar/embed?';
$output .= 'src=' . $args['calendar'];
$output .= '&title=' . $args['title'];
if ($args['control'] == 'navonly') { $output .= '&chrome=NAVIGATION'; }
elseif ($args['control'] == 'none') { $output .= '&chrome=NONE'; }
if ($args['mode'] == 'agenda') { $output .= '&mode=AGENDA'; }
$output .= '&epr=' . $args['items'];
$output .= '&wkst=';
if ($args['week'] == 'Sun') { $output .= '1'; }
elseif ($args['week'] == 'Mon') { $output .= '2'; }
else { $output .= '7'; }
if ($args['bgcolor']) { $output .= '&bgcolor=%23' . $args['bgcolor']; }
$output .= '&height=' . $args['height'] . '"';
if ($args['border'] == 'off') { $output .= ' style="border-width:0"'; }
else { $output .= ' style="border:solid 1px #777"'; }
$output .= ' width=' . $args['width'];
$output .= ' frameborder="0"';
$output .= ' height=' . $args['height'];
$output .= '></iframe>';
------------------------------
to:
------------------------------
$output = '<iframe src="http://www.google.com/calendar/embed?';
$output .= 'src=' . $args['calendar'];
$output .= '&title=' . $args['title'];
if ($args['control'] == 'navonly') { $output .= '&chrome=NAVIGATION'; }
elseif ($args['control'] == 'none') { $output .= '&chrome=NONE'; }
if ($args['mode'] == 'agenda') { $output .= '&mode=AGENDA'; }
$output .= '&epr=' . $args['items'];
$output .= '&wkst=';
if ($args['week'] == 'Sun') { $output .= '1'; }
elseif ($args['week'] == 'Mon') { $output .= '2'; }
else { $output .= '7'; }
if ($args['bgcolor']) { $output .= '&bgcolor=%23' . $args['bgcolor']; }
$output .= '&height=' . $args['height'] . '"';
if ($args['border'] == 'off') { $output .= ' style="border-width:0"'; }
else { $output .= ' style="border:solid 1px #777"'; }
$output .= ' width="' . $args['width'] . '"';
$output .= ' frameborder="0"';
$output .= ' height="' . $args['height'] . '"';
$output .= '></iframe>';
------------------------------
-2007/07/12 Diafygi See AlsoContributors |