Team:Northwestern/Calendar
From 2010.igem.org
Line 9: | Line 9: | ||
!align="center"|[[Team:Northwestern/Protocol|Protocol]] | !align="center"|[[Team:Northwestern/Protocol|Protocol]] | ||
|} | |} | ||
+ | |||
+ | <?php | ||
+ | # Google Calendar Extension | ||
+ | # | ||
+ | # Purpose: | ||
+ | # Embed a Google Calendar in a MediaWiki page | ||
+ | # Tag/Wikitext : | ||
+ | # <googlecalendar>docid</googlecalendar> | ||
+ | # Example : | ||
+ | # from <iframe src="http://www.google.com/calendar/embed?src=umhappyhours%40gmail.com" | ||
+ | # style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe> | ||
+ | # Instructions : | ||
+ | # set $input to the Google Account that owns the calendar you want to embed | ||
+ | # set $width & $height to the proportions appropriate for your wiki page | ||
+ | # | ||
+ | # Credits | ||
+ | # This code is adapted from Kasper Souren's original extension, sometimes available at | ||
+ | # http://wiki.couchsurfing.com/wiki/index.php?title=Google_Calendar_MediaWiki_plugin | ||
+ | # License | ||
+ | # GNU Public | ||
+ | |||
+ | $wgExtensionFunctions[] = 'wfGoogleCalendar'; | ||
+ | $wgExtensionCredits['parserhook'][] = array( | ||
+ | 'name' => 'Google Calendar', | ||
+ | 'description' => 'Display Google Calendar', | ||
+ | 'author' => 'Libby Hemphill', | ||
+ | 'url' => '' | ||
+ | ); | ||
+ | |||
+ | function wfGoogleCalendar() { | ||
+ | global $wgParser; | ||
+ | $wgParser->setHook('googlecalendar', 'renderGoogleCalendar'); | ||
+ | } | ||
+ | |||
+ | # The callback function for converting the input text to HTML output | ||
+ | function renderGoogleCalendar($input) { | ||
+ | $input = htmlspecialchars($input); | ||
+ | //$input = "umhappyhours@gmail.com" | ||
+ | $width = 425; | ||
+ | $height = 350; | ||
+ | |||
+ | $output = '<iframe src="http://www.google.com/calendar/embed?src=' . $input; | ||
+ | $output .= '" style="border: 0" width="' . $width; | ||
+ | $output .= '" height="' . $height . '" frameborder="0" scrolling="no"></iframe>'; | ||
+ | |||
+ | return $output; | ||
+ | } | ||
+ | ?> | ||
+ | |||
+ | <googlecalendar>umhappyhours@gmail.com</googlecalendar> | ||
https://www.google.com/calendar/embedhelper | https://www.google.com/calendar/embedhelper |
Revision as of 03:00, 25 May 2010
Home | Team | Project | Parts | Notebook | Safety | Calendar | Protocol |
---|
<?php
- Google Calendar Extension
- Purpose:
- Embed a Google Calendar in a MediaWiki page
- Tag/Wikitext :
- <googlecalendar>docid</googlecalendar>
- Example :
- from <iframe src="http://www.google.com/calendar/embed?src=umhappyhours%40gmail.com"
- style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
- Instructions :
- set $input to the Google Account that owns the calendar you want to embed
- set $width & $height to the proportions appropriate for your wiki page
- Credits
- This code is adapted from Kasper Souren's original extension, sometimes available at
- http://wiki.couchsurfing.com/wiki/index.php?title=Google_Calendar_MediaWiki_plugin
- License
- GNU Public
$wgExtensionFunctions[] = 'wfGoogleCalendar'; $wgExtensionCredits['parserhook'][] = array(
'name' => 'Google Calendar', 'description' => 'Display Google Calendar', 'author' => 'Libby Hemphill', 'url' =>
);
function wfGoogleCalendar() {
global $wgParser; $wgParser->setHook('googlecalendar', 'renderGoogleCalendar');
}
- The callback function for converting the input text to HTML output
function renderGoogleCalendar($input) {
$input = htmlspecialchars($input); //$input = "umhappyhours@gmail.com" $width = 425; $height = 350;
$output = '<iframe src="http://www.google.com/calendar/embed?src=' . $input; $output .= '" style="border: 0" width="' . $width; $output .= '" height="' . $height . '" frameborder="0" scrolling="no"></iframe>';
return $output;
} ?>
<googlecalendar>umhappyhours@gmail.com</googlecalendar>
https://www.google.com/calendar/embedhelper
http://www.google.com/calendar/embed?src=jt8b61e40pnap50ddhtfcpoua8%40group.calendar.google.com&ctz=America/Chicago
<googlecalendar>?height=600&wkst=1&bgcolor=%23FFFFFF&src=jt8b61e40pnap50ddhtfcpoua8%40group.calendar.google.com&color=%238C500B&ctz=Pacific%2FApia" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></googlecalendar>
<iframe src="http://www.google.com/calendar/embed?src=jt8b61e40pnap50ddhtfcpoua8%40group.calendar.google.com&ctz=America/Chicago" style="border: 0" width="800" height="600"
frameborder="0" scrolling="no"></iframe>
http://www.libbyh.com/2007/12/07/google-calendar-mediawiki-plugin/