Calendar - Version 1.3.10

Version Description

  • Validated performance and compatability with latest version of WordPress
  • Fixed bug with mouse hover box which caused longer titles to wrap in an unpleasant fashion
  • Corrected incorrect formatting of DTSTAMP field in iCalendar feed
  • Added a filter entitled "modify_drawn_event_content" which allows custom drawing of events on full calendar (requested by user Eric3D)
  • Tackled, after a fashion, the issue of repeating UIDs in iCalendar feed. May now result in IDs changing on a daily basis for some recurring events but should validate
  • Added time zone support into the iCalendar feed
Download this release

Release Info

Developer KieranOShea
Plugin Icon 128x128 Calendar
Version 1.3.10
Comparing to
See all releases

Code changes from version 1.3.9 to 1.3.10

Files changed (3) hide show
  1. calendar-feed.php +23 -7
  2. calendar.php +7 -4
  3. readme.txt +10 -2
calendar-feed.php CHANGED
@@ -29,6 +29,21 @@ PRODID:-//wordpress.org/plugins calendar//EN
29
  CALSCALE:GREGORIAN
30
  ";
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  // Hard code future days to protect server load
33
  $future_days = 30;
34
  $day_count = 0;
@@ -46,19 +61,20 @@ CALSCALE:GREGORIAN
46
  $end = date('Ymd',mktime(($day_count+1)*24,0,0,date("m"),date("d"),date("Y")));;
47
  } else {
48
  // A little fudge on the end time here; we assume all events are 1 hour as end time isn't a field in calendar
49
- $start = date('Ymd',mktime($day_count*24,0,0,date("m"),date("d"),date("Y")))."T".date('His',strtotime($event->event_time))."Z";
50
- $end = date('Ymd',mktime($day_count*24,0,0,date("m"),date("d"),date("Y")))."T".date('His',strtotime($event->event_time)+3600)."Z";
51
  }
52
  $ical_result .= "BEGIN:VEVENT
53
- DTSTART:".$start."
54
- DTEND:".$end."
55
  SUMMARY:".$event->event_title."
56
  DESCRIPTION:".$event->event_desc."
57
- UID:".$event->event_id."@".$_SERVER['SERVER_NAME']."
58
  SEQUENCE:0
59
- DTSTAMP:".date("YmdTHisZ")."
60
  END:VEVENT
61
- "; // Note the UID definition; event id is unique per install, each install has it's own domain (in theory)
 
62
  }
63
  $day_count++;
64
  }
29
  CALSCALE:GREGORIAN
30
  ";
31
 
32
+ // Add support for time zones, assume UTC if no date found
33
+ $found_timezone = get_option('timezone_string');
34
+ $tz_prefix = "";
35
+ $utc_tail = "Z";
36
+ if (!empty($found_timezone)) {
37
+ $tz_prefix = ";TZID=".$found_timezone;
38
+ $utc_tail = "";
39
+ $ical_result .= "BEGIN:VTIMEZONE
40
+ TZID:".$found_timezone."
41
+ TZURL:http://tzurl.org/zoneinfo/".$found_timezone."
42
+ X-LIC-LOCATION:".$found_timezone."
43
+ END:VTIMEZONE
44
+ ";
45
+ }
46
+
47
  // Hard code future days to protect server load
48
  $future_days = 30;
49
  $day_count = 0;
61
  $end = date('Ymd',mktime(($day_count+1)*24,0,0,date("m"),date("d"),date("Y")));;
62
  } else {
63
  // A little fudge on the end time here; we assume all events are 1 hour as end time isn't a field in calendar
64
+ $start = date('Ymd',mktime($day_count*24,0,0,date("m"),date("d"),date("Y")))."T".date('His',strtotime($event->event_time)).$utc_tail;
65
+ $end = date('Ymd',mktime($day_count*24,0,0,date("m"),date("d"),date("Y")))."T".date('His',strtotime($event->event_time)+3600).$utc_tail;
66
  }
67
  $ical_result .= "BEGIN:VEVENT
68
+ DTSTART".$tz_prefix.":".$start."
69
+ DTEND".$tz_prefix.":".$end."
70
  SUMMARY:".$event->event_title."
71
  DESCRIPTION:".$event->event_desc."
72
+ UID:eventId=".$event->event_id."eventInstance=".$day_count."@".$_SERVER['SERVER_NAME']."
73
  SEQUENCE:0
74
+ DTSTAMP:".date("Ymd\THis\Z")."
75
  END:VEVENT
76
+ "; // Note the UID definition; event id is unique per install, each install has it's own domain (in theory), day count
77
+ // prevents dupe UIDs where there are repeats of the same event
78
  }
79
  $day_count++;
80
  }
calendar.php CHANGED
@@ -7,7 +7,7 @@ Author: Kieran O'Shea
7
  Author URI: http://www.kieranoshea.com
8
  Text Domain: calendar
9
  Domain Path: /languages
10
- Version: 1.3.9
11
  */
12
 
13
  /* Copyright 2008 Kieran O'Shea (email : kieran@kieranoshea.com)
@@ -459,17 +459,17 @@ function check_calendar()
459
  color:#000000;
460
  border-bottom:1px dotted #000000;
461
  }
462
- .calnk a span {
463
  display:none;
464
  }
465
- .calnk a:hover span {
466
  color:#333333;
467
  background:#F6F79B;
468
  display:block;
469
  position:absolute;
470
  margin-top:1px;
471
  padding:5px;
472
- width:150px;
473
  z-index:100;
474
  line-height:1.2em;
475
  }
@@ -578,6 +578,7 @@ function check_calendar()
578
  margin-left:0px;
579
  }
580
  .calnk a:hover span span.event-title-break {
 
581
  width:96%;
582
  text-align:center;
583
  height:1px;
@@ -588,6 +589,7 @@ function check_calendar()
588
  margin-left:0px;
589
  }
590
  .calnk a:hover span span.event-content-break {
 
591
  width:96%;
592
  text-align:center;
593
  height:1px;
@@ -2353,6 +2355,7 @@ function draw_events($events)
2353
  foreach($events as $event)
2354
  {
2355
  $output .= '* '.draw_event($event).'<br />';
 
2356
  }
2357
  return $output;
2358
  }
7
  Author URI: http://www.kieranoshea.com
8
  Text Domain: calendar
9
  Domain Path: /languages
10
+ Version: 1.3.10
11
  */
12
 
13
  /* Copyright 2008 Kieran O'Shea (email : kieran@kieranoshea.com)
459
  color:#000000;
460
  border-bottom:1px dotted #000000;
461
  }
462
+ .calnk a > span {
463
  display:none;
464
  }
465
+ .calnk a:hover > span {
466
  color:#333333;
467
  background:#F6F79B;
468
  display:block;
469
  position:absolute;
470
  margin-top:1px;
471
  padding:5px;
472
+ width:auto;
473
  z-index:100;
474
  line-height:1.2em;
475
  }
578
  margin-left:0px;
579
  }
580
  .calnk a:hover span span.event-title-break {
581
+ display:block;
582
  width:96%;
583
  text-align:center;
584
  height:1px;
589
  margin-left:0px;
590
  }
591
  .calnk a:hover span span.event-content-break {
592
+ display:block;
593
  width:96%;
594
  text-align:center;
595
  height:1px;
2355
  foreach($events as $event)
2356
  {
2357
  $output .= '* '.draw_event($event).'<br />';
2358
+ $output = apply_filters('modify_drawn_event_content', $output, $event);
2359
  }
2360
  return $output;
2361
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: KieranOShea
3
  Donate link: http://www.kieranoshea.com
4
  Tags: calendar, dates, times, events
5
  Requires at least: 4.3.1
6
- Tested up to: 4.6
7
- Stable tag: 1.3.9
8
 
9
  A simple but effective Calendar plugin for WordPress that allows you to
10
  manage your events and appointments and display them to the world.
@@ -227,6 +227,14 @@ You've not called wp_head() in your theme's header and/or wp_footer() in your th
227
 
228
  == Changelog ==
229
 
 
 
 
 
 
 
 
 
230
  = 1.3.9 =
231
  * Improved the feed of events to use iCalendar format
232
 
3
  Donate link: http://www.kieranoshea.com
4
  Tags: calendar, dates, times, events
5
  Requires at least: 4.3.1
6
+ Tested up to: 4.9.4
7
+ Stable tag: 1.3.10
8
 
9
  A simple but effective Calendar plugin for WordPress that allows you to
10
  manage your events and appointments and display them to the world.
227
 
228
  == Changelog ==
229
 
230
+ = 1.3.10 =
231
+ * Validated performance and compatability with latest version of WordPress
232
+ * Fixed bug with mouse hover box which caused longer titles to wrap in an unpleasant fashion
233
+ * Corrected incorrect formatting of DTSTAMP field in iCalendar feed
234
+ * Added a filter entitled "modify_drawn_event_content" which allows custom drawing of events on full calendar (requested by user Eric3D)
235
+ * Tackled, after a fashion, the issue of repeating UIDs in iCalendar feed. May now result in IDs changing on a daily basis for some recurring events but should validate
236
+ * Added time zone support into the iCalendar feed
237
+
238
  = 1.3.9 =
239
  * Improved the feed of events to use iCalendar format
240