function checkDB() { $tmp = array(); $db =& JFactory::getDBO(); $query = "SELECT id, calendar_id, name, color, magic_cookie FROM #__gcalendar"; $db->setQuery($query); $results = $db->loadObjectList(); if (empty($results)) { $tmp[] = array('name' => 'DB Entries Check', 'description' => 'No DB data found.', 'status' => 'ok', 'solution' => ''); } else { foreach ($results as $result) { $feed = new SimplePie_GCalendar(); $feed->set_show_past_events(FALSE); $feed->set_sort_ascending(TRUE); $feed->set_orderby_by_start_date(TRUE); $feed->set_expand_single_events(TRUE); $feed->enable_order_by_date(FALSE); $feed->enable_cache(FALSE); $feed->set_cal_language(GCalendarUtil::getFrLanguage()); $feed->set_timezone(GCalendarUtil::getComponentParameter('timezone')); $url = SimplePie_GCalendar::create_feed_url($result->calendar_id, $result->magic_cookie); $feed->set_feed_url($url); $feed->init(); $feed->handle_content_type(); if ($feed->error()) { $desc = "The following Simplepie error occurred when reading calendar " . $result->name . ":<br>" . $feed->error(); $solution = "<ul><li>If the error is the same as in the connection test use the solution described there.</li>"; $solution .= "<li>Please check your shared settings of the calendar and the events, "; $solution .= "if you do not share your calendar with the public the <a href=\"http://code.google.com/apis/calendar/docs/2.0/developers_guide_protocol.html#AuthMagicCookie\">magic cookie</a> field must be set.</li>"; $solution .= "<li>Run the <a href=\"components/com_gcalendar/libraries/sp-gcalendar/sp_compatibility_test.php\">simplepie compatibility test</a> and check if your system does meet the minimum requirements of simplepie.</li>"; $solution .= "<li><b>If the problem still exists check the forum at <a href=\"http://gcalendar.laoneo.net\">gcalendar.laoneo.net</a>.</b></li>"; $status = 'failure'; } else { $solution = ''; $status = 'ok'; $desc = 'Simplepie could read the events without any problems from calendar ' . $result->name . '.'; } $tmp[] = array('name' => $result->name . ' Check', 'description' => $desc, 'status' => $status, 'solution' => $solution); } } return $tmp; }
function getGoogleCalendarFeeds($start, $end) { GCalendarUtil::ensureSPIsLoaded(); $calendarids = null; $gcids = $this->getState('gcids'); if (!empty($gcids)) { $calendarids = $gcids; } $results = GCalendarDBUtil::getCalendars($calendarids); if (empty($results)) { return array(); } $calendars = array(); foreach ($results as $result) { if (!empty($result->calendar_id)) { $feed = new SimplePie_GCalendar(); $feed->set_show_past_events(FALSE); $feed->set_sort_ascending(TRUE); $feed->set_orderby_by_start_date(TRUE); $feed->set_expand_single_events(TRUE); $feed->enable_order_by_date(FALSE); $feed->enable_cache(FALSE); $feed->set_start_date($start); $feed->set_end_date($end); $feed->set_max_events(100); $feed->put('gcid', $result->id); $feed->put('gccolor', $result->color); $feed->set_cal_language(GCalendarUtil::getFrLanguage()); $feed->set_timezone(GCalendarUtil::getComponentParameter('timezone')); $url = SimplePie_GCalendar::create_feed_url($result->calendar_id, $result->magic_cookie); $feed->set_feed_url($url); $feed->init(); $feed->handle_content_type(); $calendars[] = $feed; } } return $calendars; }
/** * Gets the simplepie event * @return string event */ function getGCalendar() { GCalendarUtil::ensureSPIsLoaded(); $results = GCalendarDBUtil::getCalendars(JRequest::getVar('gcid', null)); if (empty($results) || JRequest::getVar('eventID', null) == null) { return null; } $result = $results[0]; $feed = new SimplePie_GCalendar(); $feed->set_show_past_events(FALSE); $feed->set_sort_ascending(TRUE); $feed->set_orderby_by_start_date(TRUE); $feed->set_expand_single_events(TRUE); $feed->enable_order_by_date(FALSE); $feed->enable_cache(FALSE); $feed->set_start_date(JRequest::getVar('start', 0) - 86400); $feed->set_end_date(JRequest::getVar('end', 0) + 86400); $feed->put('gcid', $result->id); $feed->put('gccolor', $result->color); $feed->put('gcname', $result->name); $feed->set_cal_language(GCalendarUtil::getFrLanguage()); $feed->set_timezone(GCalendarUtil::getComponentParameter('timezone')); $url = SimplePie_GCalendar::create_feed_url($result->calendar_id, $result->magic_cookie); $feed->set_feed_url($url); $feed->init(); if ($feed->error()) { JError::raiseWarning(500, 'Simplepie detected an error for the calendar ' . $result->calendar_id . '. Please run the <a href="administrator/components/com_gcalendar/libraries/sp-gcalendar/sp_compatibility_test.php">compatibility utility</a>.<br>The following Simplepie error occurred:<br>' . $feed->error()); } $feed->handle_content_type(); $items = $feed->get_items(); foreach ($items as $item) { if ($item->get_id() == JRequest::getVar('eventID', null)) { return $item; } } return null; }
function getCalendarItems() { GCalendarUtil::ensureSPIsLoaded(); $params = $this->params; $calendarids = $params->get('calendarids'); $results = GCalendarDBUtil::getCalendars($calendarids); if (empty($results)) { JError::raiseWarning(500, 'The selected calendar(s) were not found in the database.'); return array(); } $values = array(); $sortOrder = $params->get('order', 1) == 1; $maxEvents = $params->get('max_events', 10); foreach ($results as $result) { if (!empty($result->calendar_id)) { $feed = new SimplePie_GCalendar(); $feed->set_show_past_events($params->get('past_events', TRUE)); $startDate = $params->get('start_date', ''); $endDate = $params->get('end_date', ''); if (!empty($startDate) && !empty($endDate)) { $feed->set_start_date(strtotime($startDate)); $feed->set_end_date(strtotime($endDate)); } $feed->set_sort_ascending(TRUE); $feed->set_orderby_by_start_date($sortOrder); $feed->set_expand_single_events($params->get('expand_events', TRUE)); $feed->enable_order_by_date(false); $conf =& JFactory::getConfig(); if ($params != null && ($params->get('gc_cache', 0) == 2 || $params->get('gc_cache', 0) == 1 && $conf->getValue('config.caching'))) { $cacheTime = $params->get('gccache_time', $conf->getValue('config.cachetime') * 60); // check if cache directory exists and is writeable $cacheDir = JPATH_BASE . DS . 'cache' . DS . $params->get('gc_cache_folder', ''); JFolder::create($cacheDir, 0755); if (!is_writable($cacheDir)) { JError::raiseWarning(500, "Created cache at " . $cacheDir . " is not writable, disabling cache."); $cache_exists = false; } else { $cache_exists = true; } //check and set caching $feed->enable_cache($cache_exists); if ($cache_exists) { $feed->set_cache_location($cacheDir); $feed->set_cache_duration($cacheTime); } } else { $feed->enable_cache(false); $feed->set_cache_duration(-1); } $feed->set_max_events($maxEvents); $feed->set_timezone(GCalendarUtil::getComponentParameter('timezone')); $feed->set_cal_language(GCalendarUtil::getFrLanguage()); $feed->set_cal_query($params->get('find', '')); $feed->put('gcid', $result->id); $feed->put('gcname', $result->name); $feed->put('gccolor', $result->color); $url = SimplePie_GCalendar::create_feed_url($result->calendar_id, $result->magic_cookie); $feed->set_feed_url($url); // Initialize the feed so that we can use it. $feed->init(); // echo $feed->feed_url; if ($feed->error()) { JError::raiseWarning(500, 'Simplepie detected an error. Please run the <a href="administrator/components/com_gcalendar/libraries/sp-gcalendar/sp_compatibility_test.php">compatibility utility</a>.', $feed->error()); } // Make sure the content is being served out to the browser properly. $feed->handle_content_type(); $values = array_merge($values, $feed->get_items()); } } // we sort the array based on the event compare function usort($values, array("SimplePie_Item_GCalendar", "compare")); $events = array_filter($values, array($this, "filter")); $offset = $params->get('offset', 0); $numevents = $params->get('count', $maxEvents); $events = array_slice($values, $offset, $numevents); //return the feed data structure for the template return $events; }
/** * The simplepie event is rendered for the given formats and * returned as HTML code. * * @param $event * @param $format * @param $dateformat * @param $timeformat * @return the HTML code of the efent */ function renderEvent($event, $format, $dateformat, $timeformat) { $feed = $event->get_feed(); $tz = GCalendarUtil::getComponentParameter('timezone'); if ($tz == '') { $tz = $feed->get_timezone(); } $itemID = GCalendarUtil::getItemId($feed->get('gcid')); if (!empty($itemID)) { $itemID = '&Itemid=' . $itemID; } else { $menu = JSite::getMenu(); $activemenu = $menu->getActive(); if ($activemenu != null) { $itemID = '&Itemid=' . $activemenu->id; } } // These are the dates we'll display $startDate = self::strftime($dateformat, $event->get_start_date()); $startTime = self::strftime($timeformat, $event->get_start_date()); $endDate = self::strftime($dateformat, $event->get_end_date()); $endTime = self::strftime($timeformat, $event->get_end_date()); $temp_event = $format; switch ($event->get_day_type()) { case $event->SINGLE_WHOLE_DAY: $temp_event = str_replace("{startdate}", $startDate, $temp_event); $temp_event = str_replace("{starttime}", "", $temp_event); $temp_event = str_replace("{dateseparator}", "", $temp_event); $temp_event = str_replace("{enddate}", "", $temp_event); $temp_event = str_replace("{endtime}", "", $temp_event); break; case $event->SINGLE_PART_DAY: $temp_event = str_replace("{startdate}", $startDate, $temp_event); $temp_event = str_replace("{starttime}", $startTime, $temp_event); $temp_event = str_replace("{dateseparator}", "-", $temp_event); $temp_event = str_replace("{enddate}", "", $temp_event); $temp_event = str_replace("{endtime}", $endTime, $temp_event); break; case $event->MULTIPLE_WHOLE_DAY: $SECSINDAY = 86400; $endDate = self::strftime($dateformat, $event->get_end_date() - $SECSINDAY); $temp_event = str_replace("{startdate}", $startDate, $temp_event); $temp_event = str_replace("{starttime}", "", $temp_event); $temp_event = str_replace("{dateseparator}", "-", $temp_event); $temp_event = str_replace("{enddate}", $endDate, $temp_event); $temp_event = str_replace("{endtime}", "", $temp_event); break; case $event->MULTIPLE_PART_DAY: $temp_event = str_replace("{startdate}", $startDate, $temp_event); $temp_event = str_replace("{starttime}", $startTime, $temp_event); $temp_event = str_replace("{dateseparator}", "-", $temp_event); $temp_event = str_replace("{enddate}", $endDate, $temp_event); $temp_event = str_replace("{endtime}", $endTime, $temp_event); break; } if (substr_count($temp_event, '"{description}"')) { // If description is in html attribute $desc = htmlspecialchars(str_replace('"', "'", $event->get_description())); } else { //Make any URLs used in the description also clickable $desc = preg_replace("@(src|href)=\"https?\\://@i", '\\1="', $event->get_description()); $desc = preg_replace("@(((f|ht)tps?://)[^\"\\'\\>\\s]+)@", '<a href="\\1" target="_blank">\\1</a>', $desc); //or "¤(((f|ht)tp:\/\/)[\-a-zA-Z0-9@:%_\+\.~#\?,\/=&;]+)¤" } $temp_event = str_replace("{title}", $event->get_title(), $temp_event); $temp_event = str_replace("{description}", $desc, $temp_event); $temp_event = str_replace("{where}", $event->get_location(), $temp_event); $temp_event = str_replace("{backlink}", htmlentities(JRoute::_('index.php?option=com_gcalendar&view=event&eventID=' . $event->get_id() . '&start=' . $event->get_start_date() . '&end=' . $event->get_end_date() . '&gcid=' . $feed->get('gcid') . $itemID)), $temp_event); $temp_event = str_replace("{link}", $event->get_link() . '&ctz=' . $tz, $temp_event); $temp_event = str_replace("{maplink}", "http://maps.google.com/?q=" . urlencode($event->get_location()), $temp_event); $temp_event = str_replace("{calendarname}", $feed->get('gcname'), $temp_event); $temp_event = str_replace("{calendarcolor}", $feed->get('gccolor'), $temp_event); // Accept and translate HTML $temp_event = html_entity_decode($temp_event); return $temp_event; }
/** * Checks if the DST applyes to the timezone of GCalendar for the given date. * * @param $date unix timestamp * @param $tz the timezone * @return if is DST */ function isDST($date, $tz = null) { if (empty($tz)) { $tz = GCalendarUtil::getComponentParameter('timezone'); } if (class_exists('DateTimeZone') && !empty($tz)) { $gtz = new DateTimeZone($tz); return $gtz->getOffset(new DateTime('2007-01-01 01:00')) != $gtz->getOffset(new DateTime(strftime('%Y-%m-%d %H:%M', $date))) ? true : false; } return false; }
function checkTimezones() { $defaultTZ = ini_get('date.timezone'); if (function_exists('date_default_timezone_get')) { $defaultTZ = date_default_timezone_get(); } if (empty($defaultTZ)) { $defaultTZ = 'empty'; } $gcalendarTZ = GCalendarUtil::getComponentParameter('timezone'); if (empty($gcalendarTZ)) { $gcalendarTZ = 'empty'; } $desc = "Your default timezone is " . $defaultTZ . " and the GCalendar timezone is " . $gcalendarTZ . ". They are the same which means you should have no problems with date issues."; $status = 'ok'; $solution = ''; if ($defaultTZ != $gcalendarTZ) { $desc = "Your default timezone is " . $defaultTZ . " and the GCalendar timezone is " . $gcalendarTZ . ". They are not the same which means you can run into some date issues."; $status = 'warning'; $solution = 'Set the timezone propriate timezone in the GCalendar preferences or the <a href="http://php.net/manual/en/function.date-default-timezone-get.php" target="_blank">default timezone</a>.'; } return array('name' => 'Timezone Check', 'description' => $desc, 'status' => $status, 'solution' => $solution); }
function getGoogleCalendarFeeds($startDate, $endDate, $projection = null) { GCalendarUtil::ensureSPIsLoaded(); $results = $this->getDBCalendars(); if (empty($results)) { return null; } $params = $this->getState('parameters.menu'); $useCache = false; $calendarids = array(); if ($params != null) { $useCache = $params->get('cache', 'no') == 'yes'; $tmp = $params->get('calendarids'); if (is_array($tmp)) { $calendarids = $tmp; } else { if (!empty($tmp)) { $calendarids[] = $tmp; } } } $calendars = array(); foreach ($results as $result) { if (empty($result->calendar_id)) { continue; } if (!empty($calendarids) && !in_array($result->id, $calendarids)) { continue; } $feed = new SimplePie_GCalendar(); $feed->set_show_past_events(FALSE); $feed->set_sort_ascending(TRUE); $feed->set_orderby_by_start_date(TRUE); $feed->set_expand_single_events(TRUE); $feed->enable_order_by_date(FALSE); $feed->enable_cache($useCache); if ($useCache) { // check if cache directory exists and is writeable $cacheDir = JPATH_BASE . DS . 'cache' . DS . 'com_gcalendar'; JFolder::create($cacheDir, 0755); if (!is_writable($cacheDir)) { JError::raiseWarning(500, "Created cache at " . $cacheDir . " is not writable, disabling cache."); $cache_exists = false; } else { $cache_exists = true; } //check and set caching $feed->enable_cache($cache_exists); if ($cache_exists) { $feed->set_cache_location($cacheDir); $cache_time = intval($params->get('cache_time', 3600)); $feed->set_cache_duration($cache_time); } } $feed->set_projection($projection); $feed->set_start_date($startDate); $feed->set_end_date($endDate); $feed->set_max_events(100); $feed->put('gcid', $result->id); $feed->put('gccolor', $result->color); $feed->put('gcname', $result->name); $feed->set_cal_language(GCalendarUtil::getFrLanguage()); $feed->set_timezone(GCalendarUtil::getComponentParameter('timezone')); $url = SimplePie_GCalendar::create_feed_url($result->calendar_id, $result->magic_cookie); $feed->set_feed_url($url); $feed->init(); $feed->handle_content_type(); $calendars[] = $feed; } return $calendars; }
* @since 2.2.0 */ defined('_JEXEC') or die('Restricted access'); JHtml::_('jquery.framework'); $document = JFactory::getDocument(); $document->addScript(JURI::base() . 'components/com_gcalendar/libraries/jquery/ui/jquery-ui.custom.min.js'); $document->addScript(JURI::base() . 'components/com_gcalendar/libraries/fullcalendar/fullcalendar.min.js'); $document->addStyleSheet(JURI::base() . 'components/com_gcalendar/libraries/fullcalendar/fullcalendar.css'); $document->addStyleSheet(JURI::base() . 'components/com_gcalendar/libraries/jquery/ext/tipTip.css'); $document->addScript(JURI::base() . 'components/com_gcalendar/libraries/jquery/gcalendar/jquery.gcalendar-all.min.js'); $document->addStyleSheet(JURI::base() . 'modules/mod_gcalendar/tmpl/gcalendar.css'); $color = $params->get('event_color', '135CAE'); $fadedColor = GCalendarUtil::getFadedColor($color); $cssClass = "gcal-module_event_gccal_" . $module->id; $document->addStyleDeclaration("." . $cssClass . ",." . $cssClass . " a, ." . $cssClass . " div{background-color: " . $fadedColor . " !important; border-color: #" . $color . "; color: " . $fadedColor . ";} .fc-header-center{vertical-align: middle !important;} #gcalendar_module_" . $module->id . " .fc-state-default span, #gcalendar_module_" . $module->id . " .ui-state-default{padding:0px !important;}"); $theme = $params->get('theme', GCalendarUtil::getComponentParameter('theme')); if (JRequest::getVar('theme', null) != null) { $theme = JRequest::getVar('theme', null); } if (!empty($theme)) { $document->addStyleSheet(JURI::base() . 'components/com_gcalendar/libraries/jquery/themes/' . $theme . '/jquery-ui.custom.css'); } $daysLong = "["; $daysShort = "["; $daysMin = "["; $monthsLong = "["; $monthsShort = "["; for ($i = 0; $i < 7; $i++) { $daysLong .= "'" . GCalendarUtil::dayToString($i, false) . "'"; $daysShort .= "'" . GCalendarUtil::dayToString($i, true) . "'"; $daysMin .= "'" . mb_substr(GCalendarUtil::dayToString($i, true), 0, 2) . "'";
* You should have received a copy of the GNU General Public License * along with GCalendar. If not, see <http://www.gnu.org/licenses/>. * * @author Allon Moritz * @copyright 2007-2009 Allon Moritz * @version $Revision: 2.1.2 $ */ defined('_JEXEC') or die('Restricted access'); require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_gcalendar' . DS . 'util.php'; $tz = GCalendarUtil::getComponentParameter('timezone'); if (!empty($tz)) { $tz = '&ctz=' . $tz; } $lg = '&hl=' . GCalendarUtil::getFrLanguage(); $url = 'http://www.google.com/calendar/event?eid=' . $this->eventID . $tz . $lg; $domain = GCalendarUtil::getComponentParameter('google_apps_domain'); if (!empty($domain)) { $url = 'http://www.google.com/calendar/hosted/' . $domain . '/event?eid=' . $this->eventID . $tz . $lg; } $itemID = GCalendarUtil::getItemId(JRequest::getVar('gcid', null)); if (!empty($itemID) && JRequest::getVar('tmpl', null) != 'component') { $component =& JComponentHelper::getComponent('com_gcalendar'); $menu =& JSite::getMenu(); $item = $menu->getItem($itemID); if ($item != null) { $backLinkView = $item->query['view']; echo "<table><tr><td valign=\"middle\">\n"; echo '<a href="' . JRoute::_('index.php?option=com_gcalendar&view=' . $backLinkView . '&Itemid=' . $itemID) . "\">\n"; echo "<img id=\"prevBtn_img\" height=\"16\" border=\"0\" width=\"16\" alt=\"backlink\" src=\"components/com_gcalendar/hiddenviews/event/tmpl/back.png\"/>\n"; echo "</a></td><td valign=\"middle\">\n"; echo '<a href="' . JRoute::_('index.php?option=com_gcalendar&view=' . $backLinkView . '&Itemid=' . $itemID) . '">' . JText::_('CALENDAR_BACK_LINK') . "</a>\n";
/** * @param $calendar * @param $eventId * * @return Zend_Gdata_App_Entry|NULL */ public static function getEvent($calendar, $eventId) { // Implement View Level Access $user = JFactory::getUser(); if (!$user->authorise('core.admin') && !in_array($calendar->access, $user->getAuthorisedViewLevels())) { return null; } $cache = JFactory::getCache('com_gcalendar'); $cache->setCaching(GCalendarUtil::getComponentParameter('gc_cache', 1) == '1'); if (GCalendarUtil::getComponentParameter('gc_cache', 1) == 2) { $conf = JFactory::getConfig(); $cache->setCaching($conf->getValue('config.caching')); } $cache->setLifeTime(GCalendarUtil::getComponentParameter('gc_cache_time', 900)); $event = $cache->call(array('GCalendarZendHelper', 'internalGetEvent'), $calendar, $eventId); // Implement View Level Access $user = JFactory::getUser(); if (!$user->authorise('core.admin') && !in_array($calendar->access_content, $user->getAuthorisedViewLevels())) { $event->setTitle(JText::_('COM_GCALENDAR_EVENT_BUSY_LABEL')); $event->setContent(null); $event->setWhere(null); $event->setWho(array()); } return $event; }
public function getModifiedDate() { if ($this->modifiedDate == null) { $this->modifiedDate = JFactory::getDate($this->getPublished()); $this->modifiedDate->setTimezone(new DateTimeZone(GCalendarUtil::getComponentParameter('timezone'))); } return $this->modifiedDate; }
} if (GCalendarUtil::getComponentParameter('show_event_location', 1) == 1) { $loc = $event->get_location(); if (!empty($loc)) { echo "<tr><td class=\"event_content_key\">" . JText::_('LOCATION') . ": </td><td>" . $loc . "</td></tr>\n"; echo "<tr><td colspan=\"2\"><iframe width=\"100%\" height=\"300px\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.com/maps?q=" . urlencode($loc) . "&output=embed\"></iframe></td></tr>\n"; } } $desc = preg_replace("@(src|href)=\"https?://@i", '\\1="', $event->get_description()); if (GCalendarUtil::getComponentParameter('show_event_description', 1) == 1 && !empty($desc)) { echo "<tr><td class=\"event_content_key\">" . JText::_('DESCRIPTION') . ": </td><td>" . htmlspecialchars_decode(nl2br(preg_replace("@(((f|ht)tp:\\/\\/)[^\"\\'\\>\\s]+)@", '<a href="\\1" target="_blank">\\1</a>', $desc))) . "</td></tr>\n"; } if (GCalendarUtil::getComponentParameter('show_event_author', 2) == 1) { $authors = $event->get_authors(); if (count($authors) > 0) { $document->addScript(JURI::base() . 'components/com_gcalendar/hiddenviews/event/tmpl/default.js'); echo "<tr><td class=\"event_content_key\">" . JText::_('AUTHOR') . ": </td><td style=\"valign:top\">" . $authors[0]->get_name() . " <a href=\"javascript:sdafgkl437jeeee('" . base64_encode(str_replace('@', '#', $authors[0]->get_email())) . "')\"><img height=\"11\" border=\"0\" width=\"16\" alt=\"email\" src=\"components/com_gcalendar/images/mail.png\"/></a></td></tr>\n"; } } if (GCalendarUtil::getComponentParameter('show_event_copy_info', 1) == 1) { $urlText = 'action=TEMPLATE&text=' . urlencode($event->get_title()); $urlText .= '&dates=' . strftime($copyDateTimeFormat, $event->get_start_date()) . '%2F' . strftime($copyDateTimeFormat, $event->get_end_date()); $urlText .= '&location=' . urlencode($event->get_location()); $urlText .= '&details=' . urlencode($event->get_description()); $urlText .= '&hl=' . GCalendarUtil::getFrLanguage() . '&ctz=' . GCalendarUtil::getComponentParameter('timezone'); $urlText .= '&sf=true&output=xml'; echo "<tr><td class=\"event_content_key\">" . JText::_('COPY') . ": </td><td><a target=\"_blank\" href=\"http://www.google.com/calendar/render?" . $urlText . "\">" . JText::_('COPY_TO_MY_CALENDAR') . "</a></td></tr>\n"; } echo "</table></div>\n"; } echo "<div style=\"text-align:center;margin-top:10px\" id=\"gcalendar_powered\"><a href=\"http://g4j.laoneo.net\">Powered by GCalendar</a></div>\n";