Jump to content

Extension talk:Google Calendar

Add topic
From mediawiki.org
Latest comment: 13 years ago by Ernstkm in topic Verified working with 1.16

a screenshot will follow, as soon as i can upload images Tuwan 17:08, 29 July 2008 (UTC)Reply

Private Calendar Support

[edit]

I modified the renderGoogleCalendar() function so that it could take a private calendar URL in HTML format. See Google Calendar > Settings > Calendars > Share this calendar > Calendar Details > Private Address. Right-click "HTML", save the link and then paste it into your wiki, between the <googlecalendar> tags.

Your wiki code should look something like this:

<googlecalendar>
http://www.google.com/calendar/embed?src=googleusername@gmail.com&ctz=America/Vancouver&pvttk=1142456efbddf354652c7189
</googlecalendar>

Here's the code that you need. In your extensions/googleCalendar.php file, replace the renderGoogleCalendar() method with:

function renderGoogleCalendar($input) {
        $input = htmlspecialchars($input);
        //$input = "6444586097901795775"
        $width = 425;
        $height = 350;
		
		
        $output = '<iframe src="http://www.google.com/calendar/embed?src=g43t277um81su1tjvgvah609qk%40group.calendar.google.com&pvttk=db8cdde758254dbe5a511723cac5da46&title=CSC-NZ&chrome=NAVIGATION&height=600&epr=4" style=" border-width:0 " width="480" frameborder="0" height="600"></iframe>';
        if ($input)
		{
			$output = '<iframe src="http://www.google.com/calendar/embed?src='.$input.'&title=CSC-NZ&chrome=NAVIGATION&height=600&epr=4" style=" border-width:0 " width="480" frameborder="0" height="600"></iframe>';
		}
		if (strcmp(substr($input, 0, 3), "http"))
		{
			$output = '<iframe src="'.htmlspecialchars_decode($input).'" style=" border-width:0 " width="480" frameborder="0" height="600"></iframe>';
        }

/*		

        $output = '<embed style="width:'.$width.'px; height:'.$height.'px;" '
                .'id="CalendarPlayback" type="application/x-shockwave-flash" '
                .'src="http://calendar.google.com/googleplayer.swf?docId='
                .$input.'"> </embed>';
        */
        return $output;
}

--Iwoj 00:43, 19 November 2008 (UTC)Reply

Verified working with 1.16

[edit]

...even though the author's page is inaccessible (as of this writing, 08 August 2011). Links updated to point to the archive.org Wayback Machine snapshot from 2009-01-15. --Ernstkm 11:27, 8 August 2011 (UTC)Reply