Here's some code you can use:
PHP Code:
if ($_REQUEST['do'] == 'outlookevent')
{
if (!$eventinfo['eventid'])
{
eval(print_standard_error('error_invalidid'));
}
$noheader = 1;
$fromdate_1 = date('Ymd', $eventinfo['dateline_from']);
$fromdate_2 = date('His', $eventinfo['dateline_from']);
$fromdate = $fromdate_1 . 'T' . $fromdate_2;
if ($eventinfo['dateline_to'] != 0)
{
$todate_1 = date('Ymd', $eventinfo['dateline_to']);
$todate_2 = date('His', $eventinfo['dateline_to']);
}
else
{
$todate_1 = date('Ymd', $eventinfo['dateline_to'] + 86400);
$todate_2 = date('His', $eventinfo['dateline_to']);
}
$todate = $todate_1 . 'T' . $todate_2;
$vcsoutput = 'BEGIN:VCALENDAR
VERSION:1.0
BEGIN: VEVENT
DTStart:' . $fromdate . '
DTEnd:' . $todate_1 . '
UID:' . $fromdate . $todate_1 . '
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=0D=0A=0D=0A' . $eventinfo[event] . '
PRIORITY:3
End:VEVENT
End:VCALENDAR';
header('Content-type: application/download');
header('Content-Disposition: attachment; filename=event.vcs');
echo $vcsoutput;
exit;
}
Add this to your calendar.php, before this:
PHP Code:
eval(print_standard_error('error_invalidid'));
/*======================================================================*\
|| ####################################################################
Then, add a link and link to calendar.php?do=outlookevent&e=$eventid