My Calendar - Version 2.5.14

Version Description

  • Bug fix: saving setting for main calendar URL from front page doesn't work
  • Bug fix: esc_url only in appropriate places
  • Bug fix: Recognize month parameter from shortcode in navigation elements
  • Bug fix: 404s for deleted events
  • Bug fix: Print styles handle date in week view better
  • Bug fix: Events not visible in list with list JS disabled
  • Bug fix: SQL query for conflict checking threw errors
  • New option: list all events in list view with JS
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 2.5.14
Comparing to
See all releases

Code changes from version 2.5.13 to 2.5.14

css/mc-print.css CHANGED
@@ -82,6 +82,17 @@ a {
82
  border-bottom: 1px solid #ddd
83
  }
84
 
 
 
 
 
 
 
 
 
 
 
 
85
  .return {
86
  font-weight: 700;
87
  font-size: 1.5em;
82
  border-bottom: 1px solid #ddd
83
  }
84
 
85
+ .my-calendar-week .mc-date {
86
+ width: 100%;
87
+ padding: 0;
88
+ margin-left: 0;
89
+ float: none;
90
+ top: 0;
91
+ right: 0;
92
+ border-left: none;
93
+ display: block;
94
+ }
95
+
96
  .return {
97
  font-weight: 700;
98
  font-size: 1.5em;
css/reset.css CHANGED
@@ -140,5 +140,6 @@ button.mc-text-button:hover, button .mc-text-button:focus {
140
  max-width: none ! important;
141
  }
142
 
143
- .mcjs.mc-main .details, .mcjs.mc-main .calendar-events { display: none; }
144
  .mcjs.mc-main .single-event .details, .mcjs.mc-main .list.day .details { display: block; }
 
140
  max-width: none ! important;
141
  }
142
 
143
+ .mcjs.mc-main.listjs .details, .mcjs.mc-main.gridjs .calendar-events { display: none; }
144
  .mcjs.mc-main .single-event .details, .mcjs.mc-main .list.day .details { display: block; }
145
+
js/jquery.public.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ $(function () {
3
+ // Delete single instances of recurring events.
4
+ $( '.mc_response' ).hide();
5
+ $('button.delete_occurrence').on( 'click', function () {
6
+ var value = $(this).attr( 'data-value' );
7
+ var data = {
8
+ 'action': mc_data.action,
9
+ 'occur_id': value,
10
+ 'security': mc_data.security
11
+ };
12
+ $.post( ajaxurl, data, function (response) {
13
+ if ( response.success == 1 ) {
14
+ $( "button[data-value='"+value+"']" ).parent( 'li' ).hide();
15
+ }
16
+ $('.mc_response').text( response.response ).show( 300 );
17
+ }, "json" );
18
+ });
19
+ }(jQuery));
my-calendar-core.php CHANGED
@@ -375,6 +375,7 @@ $script = '
375
  $inner = apply_filters( 'mc_filter_javascript_footer', $inner );
376
  echo ( $inner != '' ) ? $script . $mcjs : '';
377
  } else {
 
378
  if ( @in_array( $id, $pages ) || get_option( 'mc_show_js' ) == '' ) {
379
  if ( get_option( 'mc_calendar_javascript' ) != 1 && get_option( 'mc_open_uri' ) != 'true' ) {
380
  $url = apply_filters( 'mc_grid_js', plugins_url( 'js/mc-grid.js', __FILE__ ) );
@@ -877,45 +878,6 @@ function mc_is_selected( $theFieldname, $theValue, $theArray = '' ) {
877
  return '';
878
  }
879
 
880
- function mc_month_comparison( $month ) {
881
- $current_month = date( "n", current_time( 'timestamp' ) );
882
- if ( isset( $_GET['yr'] ) && isset( $_GET['month'] ) ) {
883
- if ( $month == $_GET['month'] ) {
884
- return ' selected="selected"';
885
- }
886
- } elseif ( $month == $current_month ) {
887
- return ' selected="selected"';
888
- }
889
-
890
- return '';
891
- }
892
-
893
- function mc_day_comparison( $day ) {
894
- $current_day = date( "j", current_time( 'timestamp' ) );
895
- if ( isset( $_GET['yr'] ) && isset( $_GET['month'] ) && isset( $_GET['dy'] ) ) {
896
- if ( $day == $_GET['dy'] ) {
897
- return ' selected="selected"';
898
- }
899
- } else if ( $day == $current_day ) {
900
- return ' selected="selected"';
901
- }
902
-
903
- return '';
904
- }
905
-
906
- function mc_year_comparison( $year ) {
907
- $current_year = date( "Y", current_time( 'timestamp' ) );
908
- if ( isset( $_GET['yr'] ) && isset( $_GET['month'] ) ) {
909
- if ( $year == $_GET['yr'] ) {
910
- return ' selected="selected"';
911
- }
912
- } else if ( $year == $current_year ) {
913
- return ' selected="selected"';
914
- }
915
-
916
- return '';
917
- }
918
-
919
  function mc_event_repeats_forever( $recur, $repeats ) {
920
  if ( $recur != 'S' && $repeats == 0 ) {
921
  return true;
375
  $inner = apply_filters( 'mc_filter_javascript_footer', $inner );
376
  echo ( $inner != '' ) ? $script . $mcjs : '';
377
  } else {
378
+ $enqueue_mcjs = false;
379
  if ( @in_array( $id, $pages ) || get_option( 'mc_show_js' ) == '' ) {
380
  if ( get_option( 'mc_calendar_javascript' ) != 1 && get_option( 'mc_open_uri' ) != 'true' ) {
381
  $url = apply_filters( 'mc_grid_js', plugins_url( 'js/mc-grid.js', __FILE__ ) );
878
  return '';
879
  }
880
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
881
  function mc_event_repeats_forever( $recur, $repeats ) {
882
  if ( $recur != 'S' && $repeats == 0 ) {
883
  return true;
my-calendar-event-manager.php CHANGED
@@ -812,7 +812,7 @@ function mc_show_block( $field, $has_data, $data, $echo = true, $default = '' )
812
  }
813
  break;
814
  case 'event_author' :
815
- if ( $show_block && is_object( $data ) && $data->event_author === '0' ) {
816
  $author = ( empty( $data->event_author ) ) ? $user_ID : $data->event_author;
817
  $select = mc_selected_users( $author, 'authors' );
818
  $return = '
@@ -2357,15 +2357,19 @@ function mc_check_data( $action, $post, $i ) {
2357
  return $data;
2358
  }
2359
 
 
 
 
 
2360
  function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
2361
  global $wpdb;
2362
- $select_location = ( $event_label != '' ) ? "event_label = '$event_label'AND" : '';
2363
  $event_query = "SELECT occur_id
2364
- FROM " . my_calendar_table() . "
2365
- ON ( " . my_calendar_event_table() . "
2366
- JOIN event_id=occur_event_id)
2367
  WHERE $select_location
2368
- ( occur_begin BETWEEN '$begin $time'AND '$end $endtime'OR occur_end BETWEEN '$begin $time'AND '$end $endtime')";
2369
  $results = $wpdb->get_results( $event_query );
2370
 
2371
  return ( ! empty( $results ) ) ? $results : false;
812
  }
813
  break;
814
  case 'event_author' :
815
+ if ( $show_block && is_object( $data ) && ( $data->event_author === '0' || !get_user_by( 'ID', $data->event_author ) ) ) {
816
  $author = ( empty( $data->event_author ) ) ? $user_ID : $data->event_author;
817
  $select = mc_selected_users( $author, 'authors' );
818
  $return = '
2357
  return $data;
2358
  }
2359
 
2360
+ /*
2361
+ SELECT occur_id FROM wp_my_calendar_events JOIN ( wp_my_calendar ON event_id=occur_event_id) WHERE event_label = 'Wells Hall' AND ( occur_begin BETWEEN '2017-09-13 21:45:00' AND '2017-09-13 23:15:00' OR occur_end BETWEEN '2017-09-13 21:45:00' AND '2017-09-13 23:15:00')
2362
+ */
2363
+
2364
  function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
2365
  global $wpdb;
2366
+ $select_location = ( $event_label != '' ) ? "event_label = '$event_label' AND" : '';
2367
  $event_query = "SELECT occur_id
2368
+ FROM " . my_calendar_event_table() . "
2369
+ JOIN " . my_calendar_table() . "
2370
+ ON (event_id=occur_event_id)
2371
  WHERE $select_location
2372
+ ( occur_begin BETWEEN '$begin $time' AND '$end $endtime' OR occur_end BETWEEN '$begin $time' AND '$end $endtime')";
2373
  $results = $wpdb->get_results( $event_query );
2374
 
2375
  return ( ! empty( $results ) ) ? $results : false;
my-calendar-output.php CHANGED
@@ -511,9 +511,13 @@ function mc_edit_panel( $html, $event, $type, $time ) {
511
  return $html . $edit;
512
  }
513
 
514
- function mc_build_date_switcher( $type = 'calendar', $cid = 'all', $time = 'month' ) {
515
  global $wpdb;
516
  $mcdb = $wpdb;
 
 
 
 
517
  if ( get_option( 'mc_remote' ) == 'true' && function_exists( 'mc_remote_db' ) ) {
518
  $mcdb = mc_remote_db();
519
  }
@@ -544,15 +548,15 @@ function mc_build_date_switcher( $type = 'calendar', $cid = 'all', $time = 'mont
544
  $day_switcher = '
545
  <label class="maybe-hide" for="' . $cid . '-day">' . __( 'Day', 'my-calendar' ) . ':</label> <select id="' . $cid . '-day" name="dy">' . "\n";
546
  for ( $i = 1; $i <= 31; $i++ ) {
547
- $day_switcher .= "<option value='$i'" . mc_day_comparison( $i ) . '>' . $i . '</option>' . "\n";
548
  }
549
  $day_switcher .= '</select>';
550
  }
551
  // We build the months in the switcher
552
  $date_switcher .= '
553
  <label class="maybe-hide" for="' . $cid . '-month">' . __( 'Month', 'my-calendar' ) . ':</label> <select id="' . $cid . '-month" name="month">' . "\n";
554
- for ( $i = 1; $i <= 12; $i ++ ) {
555
- $date_switcher .= "<option value='$i'" . mc_month_comparison( $i ) . '>' . date_i18n( 'F', mktime( 0, 0, 0, $i, 1 ) ) . '</option>' . "\n";
556
  }
557
  $date_switcher .= '</select>' . "\n" . '
558
  <label class="maybe-hide" for="' . $cid . '-year">' . __( 'Year', 'my-calendar' ) . ':</label> <select id="' . $cid . '-year" name="yr">' . "\n";
@@ -569,19 +573,19 @@ function mc_build_date_switcher( $type = 'calendar', $cid = 'all', $time = 'mont
569
  while ( $past > 0 ) {
570
  $p .= '<option value="';
571
  $p .= date( "Y", time() + ( $offset ) ) - $past;
572
- $p .= '"' . mc_year_comparison( date( "Y", time() + ( $offset ) ) - $past ) . '>';
573
  $p .= date( "Y", time() + ( $offset ) ) - $past . "</option>\n";
574
  $past = $past - 1;
575
  }
576
  while ( $fut < $future ) {
577
  $f .= '<option value="';
578
  $f .= date( "Y", time() + ( $offset ) ) + $fut;
579
- $f .= '"' . mc_year_comparison( date( "Y", time() + ( $offset ) ) + $fut ) . '>';
580
  $f .= date( "Y", time() + ( $offset ) ) + $fut . "</option>\n";
581
  $fut = $fut + 1;
582
  }
583
  $date_switcher .= $p;
584
- $date_switcher .= '<option value="' . date( "Y", time() + ( $offset ) ) . '"' . mc_year_comparison( date( "Y", time() + ( $offset ) ) ) . '>' . date( "Y", time() + ( $offset ) ) . "</option>\n";
585
  $date_switcher .= $f;
586
  $date_switcher .= '</select> ' . $day_switcher . '<input type="submit" class="button" value="' . __( 'Go', 'my-calendar' ) . '" /></div>
587
  </form></div>';
@@ -724,6 +728,13 @@ function mc_events_class( $events, $date = false ) {
724
  return $events_class;
725
  }
726
 
 
 
 
 
 
 
 
727
  function mc_list_title( $events ) {
728
  usort( $events, 'my_calendar_time_cmp' );
729
  $now = $events[0];
@@ -740,6 +751,32 @@ function mc_list_title( $events ) {
740
  return $title;
741
  }
742
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
743
  function mc_search_results( $query ) {
744
  $before = apply_filters( 'mc_past_search_results', 0, 'basic' );
745
  $after = apply_filters( 'mc_future_search_results', 10, 'basic' ); // return only future events, nearest 10
@@ -755,8 +792,6 @@ function mc_search_results( $query ) {
755
 
756
  $event_array = mc_get_search_results( $search );
757
 
758
- //$event_array = mc_flatten_array( $event_array );
759
-
760
  if ( ! empty( $event_array ) ) {
761
  $template = '<strong>{date}</strong> {title} {details}';
762
  $template = apply_filters( 'mc_search_template', $template );
@@ -900,11 +935,17 @@ function mc_show_search_results( $content ) {
900
  add_action( 'template_redirect', 'mc_hidden_event' );
901
  function mc_hidden_event() {
902
  $do_redirect = false;
 
903
  if ( isset( $_GET['mc_id'] ) ) {
904
  $mc_id = intval( $_GET['mc_id'] );
905
- $event = mc_get_event( $mc_id, 'object' );
906
- if ( mc_event_is_hidden( $event ) ) {
907
  $do_redirect = true;
 
 
 
 
 
 
908
  }
909
  } else {
910
  global $wp_query;
@@ -930,7 +971,13 @@ function mc_hidden_event() {
930
  if ( $id ) {
931
  $uri = get_permalink( $id );
932
  }
933
- wp_safe_redirect( $uri );
 
 
 
 
 
 
934
  }
935
  }
936
 
@@ -1090,8 +1137,13 @@ function my_calendar( $name, $format, $category, $time = 'month', $ltype = '', $
1090
  }
1091
  $format = apply_filters( 'mc_display_format', $format, $args );
1092
 
1093
- // mc body wrapper
1094
- $mc_wrapper = "<div id=\"$id\" class=\"mc-main mcjs $format $time $main_class\" aria-live='assertive' aria-atomic='true'>";
 
 
 
 
 
1095
  $mc_closer = "</div>";
1096
 
1097
  $date_format = ( get_option( 'mc_date_format' ) != '' ) ? get_option( 'mc_date_format' ) : get_option( 'date_format' );
@@ -1326,7 +1378,7 @@ function my_calendar( $name, $format, $category, $time = 'month', $ltype = '', $
1326
  }
1327
  // set up date switcher
1328
  if ( in_array( 'jump', $used ) ) {
1329
- $jump = ( $time != 'week' ) ? mc_build_date_switcher( $format, $main_class, $time ) : '';
1330
  }
1331
  // set up above-calendar order of fields
1332
  if ( get_option( 'mc_topnav' ) != '' ) {
@@ -1580,7 +1632,9 @@ function my_calendar( $name, $format, $category, $time = 'month', $ltype = '', $
1580
  $weekend_class = ( $is_weekend ) ? 'weekend' : '';
1581
  if ( $format == "list" ) {
1582
  if ( get_option( 'mc_show_list_info' ) == 'true' ) {
1583
- $title = ' - ' . $is_anchor . "<span class='mc-list-details'>" . mc_list_title( $events ) . "</span>" . $is_close_anchor;
 
 
1584
  } else {
1585
  $title = '';
1586
  }
@@ -2082,7 +2136,7 @@ function mc_build_url( $add, $subtract, $root = '' ) {
2082
  unset( $variables['page_id'] );
2083
  $home = add_query_arg( $variables, $home );
2084
 
2085
- return esc_url( $home );
2086
  }
2087
 
2088
  function my_calendar_show_locations( $datatype = 'name', $template = '' ) {
511
  return $html . $edit;
512
  }
513
 
514
+ function mc_build_date_switcher( $type = 'calendar', $cid = 'all', $time = 'month', $date = array() ) {
515
  global $wpdb;
516
  $mcdb = $wpdb;
517
+ $c_month = isset( $date['month'] ) ? $date['month'] : date( "n", current_time( 'timestamp' ) );
518
+ $c_month = str_replace( '0', '', $c_month );
519
+ $c_year = isset( $date['year'] ) ? $date['year'] : date( "Y", current_time( 'timestamp' ) );
520
+ $c_day = isset( $date['day'] ) ? $date['day'] : date( "j", current_time( 'timestamp' ) );
521
  if ( get_option( 'mc_remote' ) == 'true' && function_exists( 'mc_remote_db' ) ) {
522
  $mcdb = mc_remote_db();
523
  }
548
  $day_switcher = '
549
  <label class="maybe-hide" for="' . $cid . '-day">' . __( 'Day', 'my-calendar' ) . ':</label> <select id="' . $cid . '-day" name="dy">' . "\n";
550
  for ( $i = 1; $i <= 31; $i++ ) {
551
+ $day_switcher .= "<option value='$i'" . selected( $i, $c_day, false ) . '>' . $i . '</option>' . "\n";
552
  }
553
  $day_switcher .= '</select>';
554
  }
555
  // We build the months in the switcher
556
  $date_switcher .= '
557
  <label class="maybe-hide" for="' . $cid . '-month">' . __( 'Month', 'my-calendar' ) . ':</label> <select id="' . $cid . '-month" name="month">' . "\n";
558
+ for ( $i = 1; $i <= 12; $i ++ ) {
559
+ $date_switcher .= "<option value='$i'" . selected( $i, $c_month, false ) . '>' . date_i18n( 'F', mktime( 0, 0, 0, $i, 1 ) ) . '</option>' . "\n";
560
  }
561
  $date_switcher .= '</select>' . "\n" . '
562
  <label class="maybe-hide" for="' . $cid . '-year">' . __( 'Year', 'my-calendar' ) . ':</label> <select id="' . $cid . '-year" name="yr">' . "\n";
573
  while ( $past > 0 ) {
574
  $p .= '<option value="';
575
  $p .= date( "Y", time() + ( $offset ) ) - $past;
576
+ $p .= '"' . selected( date( "Y", time() + ( $offset ) ) - $past, $c_year, false ) . '>';
577
  $p .= date( "Y", time() + ( $offset ) ) - $past . "</option>\n";
578
  $past = $past - 1;
579
  }
580
  while ( $fut < $future ) {
581
  $f .= '<option value="';
582
  $f .= date( "Y", time() + ( $offset ) ) + $fut;
583
+ $f .= '"' . selected( date( "Y", time() + ( $offset ) ) + $fut, $c_year, false ) . '>';
584
  $f .= date( "Y", time() + ( $offset ) ) + $fut . "</option>\n";
585
  $fut = $fut + 1;
586
  }
587
  $date_switcher .= $p;
588
+ $date_switcher .= '<option value="' . date( "Y", time() + ( $offset ) ) . '"' . selected( date( "Y", time() + ( $offset ) ), $c_year, false ) . '>' . date( "Y", time() + ( $offset ) ) . "</option>\n";
589
  $date_switcher .= $f;
590
  $date_switcher .= '</select> ' . $day_switcher . '<input type="submit" class="button" value="' . __( 'Go', 'my-calendar' ) . '" /></div>
591
  </form></div>';
728
  return $events_class;
729
  }
730
 
731
+ /**
732
+ * List first selected event + event count
733
+ *
734
+ * @arg $events Array of event objects
735
+ *
736
+ * @return string
737
+ */
738
  function mc_list_title( $events ) {
739
  usort( $events, 'my_calendar_time_cmp' );
740
  $now = $events[0];
751
  return $title;
752
  }
753
 
754
+ /**
755
+ * List all events viewable in this context
756
+ *
757
+ * @arg $events Array of event objects
758
+ *
759
+ * @return string
760
+ */
761
+ function mc_list_titles( $events ) {
762
+ usort( $events, 'my_calendar_time_cmp' );
763
+ $titles = '';
764
+
765
+ foreach( $events as $event ) {
766
+ $title = apply_filters( 'mc_list_event_title_hint', mc_kses_post( stripcslashes( $event->event_title ) ), $event, $events );
767
+ $titles .= ( $titles != '' ) ? "<br />" . $title : $title;
768
+ }
769
+
770
+ return "<span class='mc-list-event'>$titles</span>";
771
+ }
772
+
773
+ /**
774
+ * Output search results for a given query
775
+ *
776
+ * @param $query (mixed, array or string) Search query
777
+ *
778
+ * @return string HTML output
779
+ */
780
  function mc_search_results( $query ) {
781
  $before = apply_filters( 'mc_past_search_results', 0, 'basic' );
782
  $after = apply_filters( 'mc_future_search_results', 10, 'basic' ); // return only future events, nearest 10
792
 
793
  $event_array = mc_get_search_results( $search );
794
 
 
 
795
  if ( ! empty( $event_array ) ) {
796
  $template = '<strong>{date}</strong> {title} {details}';
797
  $template = apply_filters( 'mc_search_template', $template );
935
  add_action( 'template_redirect', 'mc_hidden_event' );
936
  function mc_hidden_event() {
937
  $do_redirect = false;
938
+ $is_404 = false;
939
  if ( isset( $_GET['mc_id'] ) ) {
940
  $mc_id = intval( $_GET['mc_id'] );
941
+ if ( !mc_valid_id( $mc_id ) ) {
 
942
  $do_redirect = true;
943
+ $is_404 = true;
944
+ } else {
945
+ $event = mc_get_event( $mc_id, 'object' );
946
+ if ( mc_event_is_hidden( $event ) ) {
947
+ $do_redirect = true;
948
+ }
949
  }
950
  } else {
951
  global $wp_query;
971
  if ( $id ) {
972
  $uri = get_permalink( $id );
973
  }
974
+ if ( !$is_404 ) {
975
+ wp_safe_redirect( $uri );
976
+ } else {
977
+ global $wp_query;
978
+ $wp_query->set_404();
979
+ status_header( 404 );
980
+ }
981
  }
982
  }
983
 
1137
  }
1138
  $format = apply_filters( 'mc_display_format', $format, $args );
1139
 
1140
+ // mc body wrapper - what JS blocks are enabled?
1141
+ $list_js_class = ( get_option( 'mc_list_javascript' ) == 0 ) ? 'listjs' : '';
1142
+ $grid_js_class = ( get_option( 'mc_calendar_javascript' ) == 0 ) ? 'gridjs' : '';
1143
+ $mini_js_class = ( get_option( 'mc_mini_javascript' ) == 0 ) ? 'minijs' : '';
1144
+ $ajax_js_class = ( get_option( 'mc_ajax_javascript' ) == 0 ) ? 'ajaxjs' : '';
1145
+
1146
+ $mc_wrapper = "<div id=\"$id\" class=\"mc-main mcjs $list_js_class $grid_js_class $mini_js_class $ajax_js_class $format $time $main_class\" aria-live='assertive' aria-atomic='true'>";
1147
  $mc_closer = "</div>";
1148
 
1149
  $date_format = ( get_option( 'mc_date_format' ) != '' ) ? get_option( 'mc_date_format' ) : get_option( 'date_format' );
1378
  }
1379
  // set up date switcher
1380
  if ( in_array( 'jump', $used ) ) {
1381
+ $jump = ( $time != 'week' ) ? mc_build_date_switcher( $format, $main_class, $time, array( 'month' => $c_month, 'day' => $c_day, 'year' => $c_year ) ) : '';
1382
  }
1383
  // set up above-calendar order of fields
1384
  if ( get_option( 'mc_topnav' ) != '' ) {
1632
  $weekend_class = ( $is_weekend ) ? 'weekend' : '';
1633
  if ( $format == "list" ) {
1634
  if ( get_option( 'mc_show_list_info' ) == 'true' ) {
1635
+ $title = ' - ' . $is_anchor . "<span class='mc-list-details select-event'>" . mc_list_title( $events ) . "</span>" . $is_close_anchor;
1636
+ } else if ( get_option( 'mc_show_list_events' ) == 'true' ) {
1637
+ $title = ' - ' . $is_anchor . "<span class='mc-list-details all-events'>" . mc_list_titles( $events ) . "</span>" . $is_close_anchor;
1638
  } else {
1639
  $title = '';
1640
  }
2136
  unset( $variables['page_id'] );
2137
  $home = add_query_arg( $variables, $home );
2138
 
2139
+ return $home;
2140
  }
2141
 
2142
  function my_calendar_show_locations( $datatype = 'name', $template = '' ) {
my-calendar-settings.php CHANGED
@@ -234,7 +234,6 @@ function edit_my_calendar_config() {
234
  if ( isset( $_POST['mc_show_months'] ) ) {
235
  $permalinks = get_option( 'mc_use_permalinks' );
236
  $mc_open_day_uri = ( ! empty( $_POST['mc_open_day_uri'] ) ) ? $_POST['mc_open_day_uri'] : '';
237
- update_option( 'mc_uri', $_POST['mc_uri'] );
238
  update_option( 'mc_use_permalinks', ( ! empty( $_POST['mc_use_permalinks'] ) ) ? 'true' : 'false' );
239
  update_option( 'mc_open_uri', ( ! empty( $_POST['mc_open_uri'] ) && $_POST['mc_open_uri'] == 'on' && get_option( 'mc_uri' ) != '' ) ? 'true' : 'false' );
240
  update_option( 'mc_mini_uri', $_POST['mc_mini_uri'] );
@@ -243,6 +242,7 @@ function edit_my_calendar_config() {
243
  update_option( 'mc_show_event_vcal', ( ! empty( $_POST['mc_show_event_vcal'] ) && $_POST['mc_show_event_vcal'] == 'on' ) ? 'true' : 'false' );
244
  update_option( 'mc_show_gcal', ( ! empty( $_POST['mc_show_gcal'] ) && $_POST['mc_show_gcal'] == 'on' ) ? 'true' : 'false' );
245
  update_option( 'mc_show_list_info', ( ! empty( $_POST['mc_show_list_info'] ) && $_POST['mc_show_list_info'] == 'on' ) ? 'true' : 'false' );
 
246
  update_option( 'mc_show_months', (int) $_POST['mc_show_months'] );
247
  // calculate sequence for navigation elements
248
  $top = $bottom = array();
@@ -575,8 +575,6 @@ function edit_my_calendar_config() {
575
  <fieldset>
576
  <legend><?php _e( 'Calendar Link Targets', 'my-calendar' ); ?></legend>
577
  <ul>
578
- <?php $guess = mc_guess_calendar(); ?>
579
- <li><?php mc_settings_field( 'mc_uri', __( 'Where is your main calendar page?', 'my-calendar' ), '', "$guess[message]", array( 'size' => '60' ), 'url' ); ?></li>
580
  <?php
581
  if ( isset( $_POST['mc_use_permalinks'] ) && $note != '' ) {
582
  $url = admin_url( 'options-permalink.php#mc_cpt_base' );
@@ -695,6 +693,7 @@ function edit_my_calendar_config() {
695
  <ul>
696
  <li><?php mc_settings_field( 'mc_show_months', __( 'How many months of events to show at a time:', 'my-calendar' ), '', '', array( 'size' => '3' ), 'text' ); ?></li>
697
  <li><?php mc_settings_field( 'mc_show_list_info', __( 'Show the first event\'s title and the number of events that day next to the date.', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
 
698
  </ul>
699
  </fieldset>
700
 
234
  if ( isset( $_POST['mc_show_months'] ) ) {
235
  $permalinks = get_option( 'mc_use_permalinks' );
236
  $mc_open_day_uri = ( ! empty( $_POST['mc_open_day_uri'] ) ) ? $_POST['mc_open_day_uri'] : '';
 
237
  update_option( 'mc_use_permalinks', ( ! empty( $_POST['mc_use_permalinks'] ) ) ? 'true' : 'false' );
238
  update_option( 'mc_open_uri', ( ! empty( $_POST['mc_open_uri'] ) && $_POST['mc_open_uri'] == 'on' && get_option( 'mc_uri' ) != '' ) ? 'true' : 'false' );
239
  update_option( 'mc_mini_uri', $_POST['mc_mini_uri'] );
242
  update_option( 'mc_show_event_vcal', ( ! empty( $_POST['mc_show_event_vcal'] ) && $_POST['mc_show_event_vcal'] == 'on' ) ? 'true' : 'false' );
243
  update_option( 'mc_show_gcal', ( ! empty( $_POST['mc_show_gcal'] ) && $_POST['mc_show_gcal'] == 'on' ) ? 'true' : 'false' );
244
  update_option( 'mc_show_list_info', ( ! empty( $_POST['mc_show_list_info'] ) && $_POST['mc_show_list_info'] == 'on' ) ? 'true' : 'false' );
245
+ update_option( 'mc_show_list_events', ( ! empty( $_POST['mc_show_list_events'] ) && $_POST['mc_show_list_events'] == 'on' ) ? 'true' : 'false' );
246
  update_option( 'mc_show_months', (int) $_POST['mc_show_months'] );
247
  // calculate sequence for navigation elements
248
  $top = $bottom = array();
575
  <fieldset>
576
  <legend><?php _e( 'Calendar Link Targets', 'my-calendar' ); ?></legend>
577
  <ul>
 
 
578
  <?php
579
  if ( isset( $_POST['mc_use_permalinks'] ) && $note != '' ) {
580
  $url = admin_url( 'options-permalink.php#mc_cpt_base' );
693
  <ul>
694
  <li><?php mc_settings_field( 'mc_show_months', __( 'How many months of events to show at a time:', 'my-calendar' ), '', '', array( 'size' => '3' ), 'text' ); ?></li>
695
  <li><?php mc_settings_field( 'mc_show_list_info', __( 'Show the first event\'s title and the number of events that day next to the date.', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
696
+ <li><?php mc_settings_field( 'mc_show_list_events', __( 'Show all event titles next to the date.', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
697
  </ul>
698
  </fieldset>
699
 
my-calendar.php CHANGED
@@ -7,7 +7,7 @@ Author: Joseph C Dolson
7
  Author URI: http://www.joedolson.com
8
  Text Domain: my-calendar
9
  Domain Path: lang
10
- Version: 2.5.13
11
  */
12
  /* Copyright 2009-2017 Joe Dolson (email : joe@joedolson.com)
13
 
@@ -30,7 +30,7 @@ if ( ! defined( 'ABSPATH' ) ) {
30
  } // Exit if accessed directly
31
 
32
  global $mc_version, $wpdb;
33
- $mc_version = '2.5.13';
34
 
35
  register_activation_hook( __FILE__, 'mc_plugin_activated' );
36
  register_deactivation_hook( __FILE__, 'mc_plugin_deactivated' );
7
  Author URI: http://www.joedolson.com
8
  Text Domain: my-calendar
9
  Domain Path: lang
10
+ Version: 2.5.14
11
  */
12
  /* Copyright 2009-2017 Joe Dolson (email : joe@joedolson.com)
13
 
30
  } // Exit if accessed directly
31
 
32
  global $mc_version, $wpdb;
33
+ $mc_version = '2.5.14';
34
 
35
  register_activation_hook( __FILE__, 'mc_plugin_activated' );
36
  register_deactivation_hook( __FILE__, 'mc_plugin_deactivated' );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.joedolson.com/donate/
4
  Tags: calendar, dates, times, event, events, scheduling, schedule, event manager, event calendar, class, concert, venue, location, box office, tickets, registration
5
  Requires at least: 4.4
6
  Tested up to: 4.8
7
- Stable tag: 2.5.13
8
  Text domain: my-calendar
9
  License: GPLv2 or later
10
 
@@ -83,6 +83,17 @@ Translating my plug-ins is always appreciated. Visit <a href="https://translate.
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
 
 
 
 
 
86
  = 2.5.13 =
87
 
88
  * Bug fix: Categories can not be part of the md5 hash used to identify unique tables (breaks AJAX nav for categories)
@@ -93,7 +104,6 @@ Translating my plug-ins is always appreciated. Visit <a href="https://translate.
93
  * Bug fix: JetPack Grunion Contact form interfered with TinyMCE in contexts outside of post editor (https://github.com/Automattic/jetpack/issues/7598)
94
  * Bug fix: ensure date is retained if datepicker disabled
95
  * Bug fix: archived events filter marked as active when not
96
- *
97
 
98
  = 2.5.12 =
99
 
4
  Tags: calendar, dates, times, event, events, scheduling, schedule, event manager, event calendar, class, concert, venue, location, box office, tickets, registration
5
  Requires at least: 4.4
6
  Tested up to: 4.8
7
+ Stable tag: 2.5.14
8
  Text domain: my-calendar
9
  License: GPLv2 or later
10
 
83
 
84
  == Changelog ==
85
 
86
+ = 2.5.14 =
87
+
88
+ * Bug fix: saving setting for main calendar URL from front page doesn't work
89
+ * Bug fix: esc_url only in appropriate places
90
+ * Bug fix: Recognize month parameter from shortcode in navigation elements
91
+ * Bug fix: 404s for deleted events
92
+ * Bug fix: Print styles handle date in week view better
93
+ * Bug fix: Events not visible in list with list JS disabled
94
+ * Bug fix: SQL query for conflict checking threw errors
95
+ * New option: list all events in list view with JS
96
+
97
  = 2.5.13 =
98
 
99
  * Bug fix: Categories can not be part of the md5 hash used to identify unique tables (breaks AJAX nav for categories)
104
  * Bug fix: JetPack Grunion Contact form interfered with TinyMCE in contexts outside of post editor (https://github.com/Automattic/jetpack/issues/7598)
105
  * Bug fix: ensure date is retained if datepicker disabled
106
  * Bug fix: archived events filter marked as active when not
 
107
 
108
  = 2.5.12 =
109
 
styles/twentyfifteen.css CHANGED
@@ -482,4 +482,11 @@
482
  float: none;
483
  padding: 10px;
484
  max-width: 100%;
 
 
 
 
 
 
 
485
  }
482
  float: none;
483
  padding: 10px;
484
  max-width: 100%;
485
+ }
486
+
487
+ .mc-list-details.all-events {
488
+ text-align: left;
489
+ display: inline-block;
490
+ text-transform: none;
491
+ padding-left: 2em;
492
  }
uninstall.php CHANGED
@@ -95,6 +95,7 @@ if ( ! defined( 'ABSPATH' ) && ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
95
  delete_option( 'mc_open_day_uri' );
96
  delete_option( 'mc_open_uri' );
97
  delete_option( 'mc_show_list_info' );
 
98
  delete_option( 'mc_event_link' );
99
  delete_option( 'mc_default_category' );
100
  delete_option( 'mc_inverse_color' );
95
  delete_option( 'mc_open_day_uri' );
96
  delete_option( 'mc_open_uri' );
97
  delete_option( 'mc_show_list_info' );
98
+ delete_option( 'mc_show_list_events' );
99
  delete_option( 'mc_event_link' );
100
  delete_option( 'mc_default_category' );
101
  delete_option( 'mc_inverse_color' );