I'm trying atm to extend the group calendar addon with an iCal export function. I've got the code down to create the iCal string and put that into an ical.php in GroupCalendar/guild/. I can open the export with index.php?p=guild-GroupCalendar-ical. But there are always empty lines before my output and the google calendar doesn't recognize iCal formated that way. Any idea where thats coming from? Sorry, I'm no php god and it's the first time i meddle in the code of the roster.
TIA, Jakob
Thats my complete code, I just removed the iCal code for now, since it's incomplete and unimportant for the problem.
- Code: Select all
<?php
define('CALENDAR_TABLE',$roster->db->table('info',$addon['basename']));
define('ATTENDANCE_TABLE',$roster->db->table('attend',$addon['basename']));
define('OTHERINFO_TABLE',$roster->db->table('other',$addon['basename']));
$roster->output['show_header'] = false; // Disable the roster header
$roster->output['show_menu'] = false; // Disable roster menu
$roster->output['show_footer'] = false; // Disable roster footer
$roster->output['html_head'] = '';
global $roster, $addon;
header("Content-type: text/calendar");
// [...] creation of the iCal [...]
echo $ical;
?>