PluginProbe
Event Post / 5.2
Event Post v5.2
6.1.1 6.1.0 6.0.1 6.0.0 5.12.0 trunk 3.9 4.0 4.2 4.3 4.4 4.5 5.0 5.1 5.10.0 5.10.1 5.10.2 5.10.3 5.10.4 5.11.0 5.11.1 5.2 5.5 5.6 5.6.1 All 46 releases
event-post / export / ics.php

ics.php in Event Post 5.2, at export/ics.php

64 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if(isset($_GET['t']) && isset($_GET['sd']) && isset($_GET['ed']) && isset($_GET['d']) && isset($_GET['a']) && isset($_GET['u'])){
3 header("content-type:text/".(isset($mime)?$mime:'x-icalendar'));
4 header("Pragma: public");
5 header("Expires: 0");
6 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
7 header("Cache-Control: public");
8 header("Content-Disposition: attachment; filename=".$_GET['u'].'.'.(isset($format)?$format:'ics').';' );
9
10 $date_start = $_GET['sd'];
11 $vtz = $_GET['tz'];
12 $gmt = $_GET['gmt'];
13 $date_end = $_GET['ed'];
14
15 $separator = "\n";
16
17 $props = array();
18
19 // General
20 $props[] = 'BEGIN:VCALENDAR';
21 $props[] = 'PRODID://WordPress//Event-Post V'. file_get_contents(('../VERSION')).'//EN';
22 $props[] = 'VERSION:2.0';
23
24 // Timezone
25 if(!empty($vtz)){
26 array_push($props,
27 'BEGIN:VTIMEZONE',
28 'TZID:'.$vtz,
29 'BEGIN:DAYLIGHT',
30 'TZOFFSETFROM:+0100',
31 'TZOFFSETTO:'.($gmt).'00',
32 //'TZNAME:CEST',
33 'DTSTART:19700329T020000',
34 'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3',
35 'END:DAYLIGHT',
36 'BEGIN:STANDARD',
37 'TZOFFSETFROM:'.($gmt).'00',
38 'TZOFFSETTO:+0100',
39 'TZNAME:CET',
40 'DTSTART:19701025T030000',
41 'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10',
42 'END:STANDARD',
43 'END:VTIMEZONE'
44 );
45 }
46
47 // Event
48 array_push($props,
49 'BEGIN:VEVENT',
50 'SUMMARY:'.stripslashes($_GET['t']),
51 'UID:'.$_GET['u'],
52 'LOCATION:'.stripslashes($_GET['a']),
53 'DTSTART'.(!empty($vtz)?';TZID='.$vtz:'').':'.$date_start.(!empty($vtz)?'':'Z'),
54 'DTEND'.(!empty($vtz)?';TZID='.$vtz:'').':'.$date_end.(!empty($vtz)?'':'Z'),
55 'DESCRIPTION:'.stripslashes($_GET['d']),
56 'END:VEVENT'
57 );
58
59 // End
60 $props[] = 'END:VCALENDAR';
61
62 echo implode($separator, $props);
63 }
64 ?>