Event Calendar WD – Responsive Event Calendar plugin - Version 1.0.3

Version Description

New: Event template New: "Show map in event page" option Changed: "Repeat until" field is required

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Event Calendar WD – Responsive Event Calendar plugin
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

css/style.css CHANGED
@@ -7,7 +7,7 @@
7
 
8
 
9
 
10
- .calendar_main:after{
11
  content: '';
12
  clear: both;
13
  display:table;
@@ -1321,6 +1321,7 @@ div[class^="ecwd-page-"].ecwd_calendar .ecwd-week-date.resp{
1321
  line-height: 18px !important;
1322
  text-transform: none;
1323
  letter-spacing: 0;
 
1324
  }
1325
 
1326
 
@@ -1490,6 +1491,51 @@ div[class^="ecwd-page-"].ecwd_calendar .ecwd-week-date.resp{
1490
  }
1491
 
1492
  /*#######################EVENT PAGE##############################*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1493
  .ecwd-event .event-venue,
1494
  .ecwd-event .event-detalis-date,
1495
  .ecwd-event .event-detalis-org{
@@ -2024,7 +2070,6 @@ a.ecwd-google-plus{
2024
  .ecwd-search input[type="text"]:focus {
2025
  width: 250px !important;
2026
  z-index: 2;
2027
- border: 1px solid #60A2B2;
2028
  background-color: #FFFFFF !important;
2029
  cursor: text;
2030
  text-indent: 5px;
@@ -2191,10 +2236,7 @@ a.ecwd-google-plus{
2191
  display: none;
2192
  }
2193
  @media only screen and (max-width: 500px){
2194
- .fa {
2195
- top: 11px;
2196
- left: 17px;
2197
- }
2198
  .calendar-head .previous, .calendar-head .next {
2199
  font-size: 14px;
2200
  }
@@ -2382,4 +2424,36 @@ a.ecwd-google-plus{
2382
  overflow: hidden;
2383
  }
2384
 
2385
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
 
9
 
10
+ .calendar_main:after, #ecwd-events-content .event-detalis:after{
11
  content: '';
12
  clear: both;
13
  display:table;
1321
  line-height: 18px !important;
1322
  text-transform: none;
1323
  letter-spacing: 0;
1324
+ clear: none;
1325
  }
1326
 
1327
 
1491
  }
1492
 
1493
  /*#######################EVENT PAGE##############################*/
1494
+
1495
+ #ecwd-events-content{
1496
+ max-width: 1000px;
1497
+ margin: 0 auto 50px;
1498
+ }
1499
+
1500
+ #ecwd-events-pg-template, .ecwd-theme-parent-twentyfourteen #ecwd-events-pg-template {
1501
+ padding-left: 220px;
1502
+ }
1503
+ .event-featured-image{
1504
+ float: left;
1505
+ margin: 0 15px 15px 0;
1506
+
1507
+ }
1508
+ #ecwd-events-content .event-featured-image img{
1509
+ max-width: 100%;
1510
+ width: auto;
1511
+ height: auto;
1512
+ }
1513
+ #ecwd-events-content .ecwd-event-details{
1514
+ float: left;
1515
+ }
1516
+
1517
+ #ecwd-events-content h1{
1518
+ font-size: 30px;
1519
+ margin: 10px 0;
1520
+
1521
+
1522
+ }
1523
+
1524
+
1525
+ /* = Twenty Fourteen Styling
1526
+ @ Template: ALL
1527
+ =============================================*/
1528
+
1529
+
1530
+ .ecwd-theme-twentyfourteen #ecwd-events-content {
1531
+ padding-left:0;
1532
+ padding-right:0;
1533
+ }
1534
+
1535
+ .ecwd-theme-twentyfourteen.events-archive .entry-content {
1536
+ width:90%;
1537
+ }
1538
+
1539
  .ecwd-event .event-venue,
1540
  .ecwd-event .event-detalis-date,
1541
  .ecwd-event .event-detalis-org{
2070
  .ecwd-search input[type="text"]:focus {
2071
  width: 250px !important;
2072
  z-index: 2;
 
2073
  background-color: #FFFFFF !important;
2074
  cursor: text;
2075
  text-indent: 5px;
2236
  display: none;
2237
  }
2238
  @media only screen and (max-width: 500px){
2239
+
 
 
 
2240
  .calendar-head .previous, .calendar-head .next {
2241
  font-size: 14px;
2242
  }
2424
  overflow: hidden;
2425
  }
2426
 
2427
+ }
2428
+
2429
+
2430
+
2431
+ /*
2432
+ Default Themes Correction
2433
+ */
2434
+
2435
+ /* For Twenty Fourteen
2436
+ ========================================================================== */
2437
+
2438
+ .ecwd-theme-twentyfourteen #ecwd-events-content .ecwd-event {
2439
+ padding: 20px;
2440
+ }
2441
+
2442
+ @media screen and (min-width: 1000px) {
2443
+ .ecwd-theme-twentyfourteen #ecwd-events-content {
2444
+ padding-left: 220px;
2445
+ }
2446
+ }
2447
+ /* Stop themes from hiding elements with the .updated CSS class */
2448
+ #ecwd-theme-twentyfourteen .updated {
2449
+ display: inherit;
2450
+ }
2451
+
2452
+ /* Twenty Fifteen
2453
+ ========================================================================== */
2454
+
2455
+
2456
+ .ecwd-theme-twentyfifteen.single-ecwd_event #ecwd-events-content {
2457
+ padding: 8.3333% 10%;
2458
+ margin: 0 8.3333%;
2459
+ }
ecwd.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
- * Version: 1.0.2
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
+ * Version: 1.0.3
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
ecwd_admin_class.php CHANGED
@@ -6,7 +6,7 @@
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
- protected $version = '1.0.2';
10
  protected $ecwd_page = null;
11
 
12
  private function __construct() {
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
+ protected $version = '1.0.3';
10
  protected $ecwd_page = null;
11
 
12
  private function __construct() {
ecwd_class.php CHANGED
@@ -7,7 +7,7 @@
7
 
8
  class ECWD {
9
 
10
- protected $version = '1.0.2';
11
  protected $plugin_name = 'event-calendar-wd';
12
  protected $prefix = 'ecwd';
13
  protected $old_version = '1.4.11';
@@ -20,6 +20,7 @@ class ECWD {
20
  $cpt_instance = ECWD_Cpt::get_instance();
21
  $this->user_info();
22
  add_action('init', array($this, 'add_localization'));
 
23
  add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
24
  add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
25
  }
@@ -54,6 +55,24 @@ class ECWD {
54
  //detect timezone
55
 
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  /**
58
  * Include all necessary files
59
  */
7
 
8
  class ECWD {
9
 
10
+ protected $version = '1.0.3';
11
  protected $plugin_name = 'event-calendar-wd';
12
  protected $prefix = 'ecwd';
13
  protected $old_version = '1.4.11';
20
  $cpt_instance = ECWD_Cpt::get_instance();
21
  $this->user_info();
22
  add_action('init', array($this, 'add_localization'));
23
+ add_filter( 'body_class', array( $this, 'theme_body_class' ) );
24
  add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
25
  add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
26
  }
55
  //detect timezone
56
 
57
  }
58
+
59
+
60
+ public static function theme_body_class( $classes ) {
61
+ $child_theme = get_option( 'stylesheet' );
62
+ $parent_theme = get_option( 'template' );
63
+
64
+ if ( $child_theme == $parent_theme ) {
65
+ $child_theme = false;
66
+ }
67
+
68
+ if ( $child_theme ) {
69
+ $theme_classes = "ecwd-theme-parent-$parent_theme ecwd-theme-child-$child_theme";
70
+ } else {
71
+ $theme_classes = "ecwd-theme-$parent_theme";
72
+ }
73
+ $classes[] = $theme_classes;
74
+ return $classes;
75
+ }
76
  /**
77
  * Include all necessary files
78
  */
includes/ecwd-cpt-class.php CHANGED
@@ -79,6 +79,8 @@ class ECWD_Cpt {
79
  'calendar_add_column_headers'
80
  ) );
81
  add_filter( 'manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_columns', array( $this, 'add_column_headers' ) );
 
 
82
  }
83
 
84
 
@@ -879,6 +881,7 @@ class ECWD_Cpt {
879
  ECWD_PLUGIN_PREFIX . '_event_location',
880
  ECWD_PLUGIN_PREFIX . '_event_venue',
881
  ECWD_PLUGIN_PREFIX . '_lat_long',
 
882
  ECWD_PLUGIN_PREFIX . '_map_zoom',
883
  ECWD_PLUGIN_PREFIX . '_event_date_from',
884
  ECWD_PLUGIN_PREFIX . '_event_date_to',
@@ -988,6 +991,9 @@ class ECWD_Cpt {
988
  $ecwd_post_meta_fields[ $post_type ] = apply_filters( $post_type . '_meta', $ecwd_post_meta_fields[ $post_type ] );
989
 
990
  if ( current_user_can( 'edit_post', $post_id ) ) {
 
 
 
991
  // Loop through our array and make sure it is posted and not empty in order to update it, otherwise we delete it
992
  if ( $post_type == ECWD_PLUGIN_PREFIX . '_theme' ) {
993
  $values = array();
@@ -1240,6 +1246,15 @@ class ECWD_Cpt {
1240
 
1241
  }
1242
 
 
 
 
 
 
 
 
 
 
1243
  public function delete_transient() {
1244
  try {
1245
  $calendars = $this->get_ecwd_calendars();
79
  'calendar_add_column_headers'
80
  ) );
81
  add_filter( 'manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_columns', array( $this, 'add_column_headers' ) );
82
+
83
+ add_filter( 'template_include', array($this, 'ecwd_templates') );
84
  }
85
 
86
 
881
  ECWD_PLUGIN_PREFIX . '_event_location',
882
  ECWD_PLUGIN_PREFIX . '_event_venue',
883
  ECWD_PLUGIN_PREFIX . '_lat_long',
884
+ ECWD_PLUGIN_PREFIX . '_event_show_map',
885
  ECWD_PLUGIN_PREFIX . '_map_zoom',
886
  ECWD_PLUGIN_PREFIX . '_event_date_from',
887
  ECWD_PLUGIN_PREFIX . '_event_date_to',
991
  $ecwd_post_meta_fields[ $post_type ] = apply_filters( $post_type . '_meta', $ecwd_post_meta_fields[ $post_type ] );
992
 
993
  if ( current_user_can( 'edit_post', $post_id ) ) {
994
+ if ( $post_type == ECWD_PLUGIN_PREFIX . '_event' && !isset($_POST[ ECWD_PLUGIN_PREFIX . '_event_show_map' ])) {
995
+ $_POST[ ECWD_PLUGIN_PREFIX . '_event_show_map' ] = 'no';
996
+ }
997
  // Loop through our array and make sure it is posted and not empty in order to update it, otherwise we delete it
998
  if ( $post_type == ECWD_PLUGIN_PREFIX . '_theme' ) {
999
  $values = array();
1246
 
1247
  }
1248
 
1249
+ public function ecwd_templates($template){
1250
+ $post_types = array( self::EVENT_POST_TYPE);
1251
+ if ( is_singular( $post_types ) && ! file_exists( get_stylesheet_directory() . '/single-event.php' ) ) {
1252
+ $template = ECWD_DIR . '/views/single-event.php';
1253
+ }
1254
+
1255
+ return $template;
1256
+ }
1257
+
1258
  public function delete_transient() {
1259
  try {
1260
  $calendars = $this->get_ecwd_calendars();
includes/ecwd-functions.php CHANGED
@@ -47,7 +47,7 @@ function ecwd_print_calendar( $calendar_ids, $display = 'mini', $args = array(),
47
  }
48
 
49
  //Create new display object, passing array of calendar id(s)
50
- $d = new ECWD_Display( $ids, $title_text, $sort, $date, $page, $args['search_params'], $displays, $filters, $page_items, $event_search , $display);
51
  $markup = '';
52
  $start = current_time( 'timestamp' );
53
 
@@ -62,7 +62,7 @@ function ecwd_print_calendar( $calendar_ids, $display = 'mini', $args = array(),
62
  $display = $prev_display;
63
  }
64
  if ( $ajax == false ) {
65
- if ( $widget == 1 )
66
  $markup .= '<div class="ecwd_' . $calendar_ids_html . ' calendar_widget_content calendar_main">';
67
  else
68
  $markup .= '<div class="ecwd_' . $calendar_ids_html . ' calendar_full_content calendar_main">';
@@ -262,13 +262,6 @@ function replaceFirstImages( $content ) {
262
  return $content;
263
  }
264
 
265
- add_filter( 'post_thumbnail_html', 'ecwd_post_thumbnail', 10, 5 );
266
- function ecwd_post_thumbnail( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
267
- if (is_singular(ECWD_PLUGIN_PREFIX . '_event') && get_post_type($post_id) == ECWD_PLUGIN_PREFIX . '_event' ) {
268
- $html='<br /><br />';
269
- }
270
- return $html;
271
- }
272
  function ecwd_event_content( $content ) {
273
  global $post;
274
  global $wp;
@@ -276,18 +269,8 @@ function ecwd_event_content( $content ) {
276
  //echo $content;
277
  if ( is_single() ) {
278
  $feat_image = '';
279
- if ( $post->post_type == ECWD_PLUGIN_PREFIX . '_event' ) {
280
- if ( has_post_thumbnail()) {
281
- $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'pull') );
282
- }
283
- $event_content = '';
284
- ob_start();
285
- include( ECWD_DIR . '/views/ecwd-event-content.php' );
286
- $event_content .= ob_get_clean();
287
- $content = $event_content . $content;
288
- } elseif ( $post->post_type == ECWD_PLUGIN_PREFIX . '_organizer' ) {
289
  $organizer_content = '';
290
- ob_start();
291
  include( ECWD_DIR . '/views/ecwd-organizer-content.php' );
292
  $organizer_content .= ob_get_clean();
293
  $content = $organizer_content;
@@ -327,7 +310,14 @@ function getAndReplaceFirstImage( $content ) {
327
  }
328
 
329
  add_filter( 'the_content', ECWD_PLUGIN_PREFIX . '_event_content' );
 
330
 
 
 
 
 
 
 
331
 
332
  function ecwd_event_post( $post ) {
333
  global $ecwd_options;
@@ -380,9 +370,9 @@ function ecwd_add_meta_tags() {
380
  $description .= ' '.$ecwd_event_location;
381
  echo '<meta property="og:description" content="'.$description.'"/>';
382
  $feat_image = '';
383
- if ( has_post_thumbnail($post->ID)) {
384
- $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'pull') );
385
- }
386
  echo '<meta property="og:image" content="'.$feat_image.'"/>';
387
  }
388
  }
47
  }
48
 
49
  //Create new display object, passing array of calendar id(s)
50
+ $d = new ECWD_Display( $ids, $title_text, $sort, $date, $page, $args['search_params'], $displays, $filters, $page_items, $event_search, $display);
51
  $markup = '';
52
  $start = current_time( 'timestamp' );
53
 
62
  $display = $prev_display;
63
  }
64
  if ( $ajax == false ) {
65
+ if ( $widget == 1 )
66
  $markup .= '<div class="ecwd_' . $calendar_ids_html . ' calendar_widget_content calendar_main">';
67
  else
68
  $markup .= '<div class="ecwd_' . $calendar_ids_html . ' calendar_full_content calendar_main">';
262
  return $content;
263
  }
264
 
 
 
 
 
 
 
 
265
  function ecwd_event_content( $content ) {
266
  global $post;
267
  global $wp;
269
  //echo $content;
270
  if ( is_single() ) {
271
  $feat_image = '';
272
+ if ( $post->post_type == ECWD_PLUGIN_PREFIX . '_organizer' ) {
 
 
 
 
 
 
 
 
 
273
  $organizer_content = '';
 
274
  include( ECWD_DIR . '/views/ecwd-organizer-content.php' );
275
  $organizer_content .= ob_get_clean();
276
  $content = $organizer_content;
310
  }
311
 
312
  add_filter( 'the_content', ECWD_PLUGIN_PREFIX . '_event_content' );
313
+ //add_filter('template_include', ECWD_PLUGIN_PREFIX . '_set_template');
314
 
315
+ function ecwd_set_template( $template ) {
316
+ if ( is_singular(ECWD_PLUGIN_PREFIX . '_event') && ECWD_DIR . '/views/ecwd-event-content.php' != $template ) {
317
+ $template = ECWD_DIR . '/views/ecwd-event-content.php';
318
+ }
319
+ return $template;
320
+ }
321
 
322
  function ecwd_event_post( $post ) {
323
  global $ecwd_options;
370
  $description .= ' '.$ecwd_event_location;
371
  echo '<meta property="og:description" content="'.$description.'"/>';
372
  $feat_image = '';
373
+ if ( has_post_thumbnail($post->ID)) {
374
+ $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'pull') );
375
+ }
376
  echo '<meta property="og:image" content="'.$feat_image.'"/>';
377
  }
378
  }
js/admin/admin.js CHANGED
@@ -88,6 +88,10 @@
88
  $("#post").submit(function (e) {
89
  var dateTo = Date.parse($("#ecwd_event_date_to").val()),
90
  dateFrom = Date.parse($("#ecwd_event_date_from").val());
 
 
 
 
91
  if(dateFrom && !dateTo){
92
  alert('Please set the end date');
93
  e.preventDefault();
@@ -96,6 +100,18 @@
96
  alert('Date to must be greater or equal to Date from');
97
  e.preventDefault();
98
  }
 
 
 
 
 
 
 
 
 
 
 
 
99
  });
100
 
101
  //calendar validations, etc
88
  $("#post").submit(function (e) {
89
  var dateTo = Date.parse($("#ecwd_event_date_to").val()),
90
  dateFrom = Date.parse($("#ecwd_event_date_from").val());
91
+ if(dateFrom=='' || isNaN(dateFrom) || isNaN(dateTo) || dateTo==''){
92
+ alert('Please set the event dates');
93
+ e.preventDefault();
94
+ }
95
  if(dateFrom && !dateTo){
96
  alert('Please set the end date');
97
  e.preventDefault();
100
  alert('Date to must be greater or equal to Date from');
101
  e.preventDefault();
102
  }
103
+ var repeat = $('input[name="ecwd_event_repeat_event"]:checked').val();
104
+ var until = Date.parse($('#ecwd_event_repeat_until_input').val());
105
+ if(repeat!=='no_repeat') {
106
+ if (until == '' || isNaN(until)) {
107
+ alert('Please set the repeat until date');
108
+ e.preventDefault();
109
+ }
110
+ if(!isNaN(dateFrom) && !isNaN(until) && until <= dateFrom){
111
+ alert('Repeat until date must be greater than Date from');
112
+ e.preventDefault();
113
+ }
114
+ }
115
  });
116
 
117
  //calendar validations, etc
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-event-calendar-wd.html
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit
5
  Requires at least: 3.9
6
  Tested up to: 4.2
7
- Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -111,6 +111,11 @@ After downloading the ZIP file of the Event Calendar WD plugin,
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
114
  = 1.0.2 =
115
  Fixed: Minor bugs
116
 
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit
5
  Requires at least: 3.9
6
  Tested up to: 4.2
7
+ Stable tag: 1.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
111
 
112
  == Changelog ==
113
 
114
+ = 1.0.3 =
115
+ New: Event template
116
+ New: "Show map in event page" option
117
+ Changed: "Repeat until" field is required
118
+
119
  = 1.0.2 =
120
  Fixed: Minor bugs
121
 
views/admin/ecwd-event-meta.php CHANGED
@@ -9,6 +9,10 @@ $meta = get_post_meta($post_id);
9
  // Load up all post meta data
10
  $ecwd_event_venue = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_venue', true);
11
  $ecwd_event_location = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_location', true);
 
 
 
 
12
  $ecwd_lat_long = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_lat_long', true);
13
  $ecwd_event_date_from = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_date_from', true);
14
  $ecwd_event_date_to = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_date_to', true);
@@ -112,6 +116,16 @@ $ecwd_event_video = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_video'
112
  </p>
113
  </td>
114
  </tr>
 
 
 
 
 
 
 
 
 
 
115
  <tr>
116
  <th scope="row"><?php _e('Event Dates', 'ecwd'); ?></th>
117
  <td>
9
  // Load up all post meta data
10
  $ecwd_event_venue = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_venue', true);
11
  $ecwd_event_location = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_location', true);
12
+ $ecwd_event_show_map = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_show_map', true);
13
+ if($ecwd_event_show_map==''){
14
+ $ecwd_event_show_map = 1;
15
+ }
16
  $ecwd_lat_long = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_lat_long', true);
17
  $ecwd_event_date_from = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_date_from', true);
18
  $ecwd_event_date_to = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_date_to', true);
116
  </p>
117
  </td>
118
  </tr>
119
+ <tr>
120
+ <th scope="row"><?php _e('Show map in event page', 'ecwd'); ?></th>
121
+ <td>
122
+ <div class="checkbox-div">
123
+ <input type='checkbox' class='ecwd_all_day_event' id='ecwd_event_show_map'
124
+ name='ecwd_event_show_map' value="1" <?php checked($ecwd_event_show_map, '1'); ?>/>
125
+ <label for="ecwd_event_show_map"></label>
126
+ </div>
127
+ </td>
128
+ </tr>
129
  <tr>
130
  <th scope="row"><?php _e('Event Dates', 'ecwd'); ?></th>
131
  <td>
views/single-event.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Display for Event Custom Post Types
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ die( '-1' );
7
+ }
8
+
9
+ global $post;
10
+ global $wp;
11
+ global $ecwd_options;
12
+
13
+ $post_id = $post->ID;
14
+ $meta = get_post_meta( $post_id );
15
+
16
+ $date_format = 'Y-m-d';
17
+ $time_format = 'H:i';
18
+ $social_icons = false;
19
+ if ( isset( $ecwd_options['date_format'] ) && $ecwd_options['date_format'] != '' ) {
20
+ $date_format = $ecwd_options['date_format'];
21
+ }
22
+ if ( isset( $ecwd_options['time_format'] ) && $ecwd_options['time_format'] != '' ) {
23
+ $time_format = $ecwd_options['time_format'];
24
+ }
25
+ if ( isset( $ecwd_options['social_icons'] ) && $ecwd_options['social_icons'] != '' ) {
26
+ $social_icons = $ecwd_options['social_icons'];
27
+ }
28
+ // Load up all post meta data
29
+ $ecwd_event_location = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_event_location', true );
30
+ $ecwd_event_latlong = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_lat_long', true );
31
+ $ecwd_event_zoom = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_map_zoom', true );
32
+ $ecwd_event_show_map = get_post_meta($post->ID, ECWD_PLUGIN_PREFIX . '_event_show_map', true);
33
+
34
+ if ( ! $ecwd_event_zoom ) {
35
+ $ecwd_event_zoom = 17;
36
+ }
37
+
38
+ $ecwd_event_organizers = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_event_organizers', true );
39
+ $ecwd_event_date_from = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_event_date_from', true );
40
+ $ecwd_event_date_to = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_event_date_to', true );
41
+ $ecwd_event_url = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_event_url', true );
42
+ $ecwd_event_video = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_event_video', true );
43
+ $ecwd_all_day_event = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_all_day_event', true );
44
+ $venue = '';
45
+ $venue_permalink = '';
46
+ $venue_post_id = get_post_meta( $post->ID, ECWD_PLUGIN_PREFIX . '_event_venue', true );
47
+ if ( $venue_post_id ) {
48
+ $venue_post = get_post( $venue_post_id );
49
+ if ( $venue_post ) {
50
+ $venue = $venue_post->post_title;
51
+ $venue_permalink = get_permalink( $venue_post->ID );
52
+ }
53
+ }
54
+
55
+ $this_event_url = get_permalink( $post->ID );
56
+ $organizers = array();
57
+ if ( is_array( $ecwd_event_organizers ) || is_object( $ecwd_event_organizers ) ) {
58
+ foreach ( $ecwd_event_organizers as $ecwd_event_organizer ) {
59
+ $organizers[] = get_post( $ecwd_event_organizer, ARRAY_A );
60
+ }
61
+ }
62
+ $featured_image = '';
63
+ if ( has_post_thumbnail() ) {
64
+ $featured_image = wp_get_attachment_url( get_post_thumbnail_id( $post->ID, 'full', false ) );
65
+ }
66
+
67
+ get_header();
68
+ ?>
69
+ <div id="ecwd-events-content" class="ecwd-events-single hentry">
70
+ <header class="entry-header">
71
+ <?php the_title( '<h1 class="ecwd-events-single-event-title summary entry-title">', '</h1>' ); ?>
72
+ </header>
73
+
74
+ <?php while ( have_posts() ) : the_post(); ?>
75
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
76
+
77
+ <div class="ecwd-event" itemscope itemtype="http://schema.org/Event">
78
+ <div class="event-detalis">
79
+
80
+ <?php ?>
81
+ <?php if ( $featured_image && $featured_image !== '' ) { ?>
82
+ <div class="event-featured-image">
83
+ <img src="<?php echo $featured_image; ?>"/>
84
+ </div>
85
+ <?php } ?>
86
+ <div class="ecwd-event-details">
87
+ <div class="event-detalis-date">
88
+ <label class="ecwd-event-date-info"
89
+ title="<?php _e( 'Date', 'ecwd' ); ?>"></label>
90
+ <span class="ecwd-event-date" itemprop="startDate"
91
+ content="<?php echo date( 'Y-m-d', strtotime( $ecwd_event_date_from ) ) . 'T' . date( 'H:i', strtotime( $ecwd_event_date_from ) ) ?>">
92
+ <?php if ( $ecwd_all_day_event == 1 ) {
93
+ echo date( $date_format, strtotime( $ecwd_event_date_from ) );
94
+ if ( $ecwd_all_day_event == 1 ) {
95
+ if ( $ecwd_event_date_to && date( $date_format, strtotime( $ecwd_event_date_from ) ) !== date( $date_format, strtotime( $ecwd_event_date_to ) ) ) {
96
+ echo ' - ' . date( $date_format, strtotime( $ecwd_event_date_to ) );
97
+ }
98
+ echo ' ' . __( 'All day', 'ecwd' );
99
+ }
100
+ } else {
101
+ echo date( $date_format, strtotime( $ecwd_event_date_from ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_from ) );
102
+
103
+ if ( $ecwd_event_date_to ) {
104
+ echo ' - ' . date( $date_format, strtotime( $ecwd_event_date_to ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_to ) );
105
+ }
106
+ } ?>
107
+ </span>
108
+ </div>
109
+ <?php if ( $ecwd_event_url ) { ?>
110
+ <div class="ecwd-url">
111
+
112
+ <a href="<?php echo $ecwd_event_url; ?>" target="_blank"><label
113
+ class="ecwd-event-url-info"
114
+ title="<?php _e( 'Url', 'ecwd' ); ?>"></label> <?php echo $ecwd_event_url; ?>
115
+ </a>
116
+ </div>
117
+ <?php } ?>
118
+ <?php if ( count( $organizers ) > 0 ) { ?>
119
+ <div class="event-detalis-org">
120
+ <label class="ecwd-event-org-info"
121
+ title="<?php _e( 'Organizers', 'ecwd' ); ?>"></label>
122
+ <?php if ( $organizers ) {
123
+ foreach ( $organizers as $organizer ) { ?>
124
+ <span itemprop="organizer">
125
+ <a href="<?php echo get_permalink( $organizer['ID'] ) ?>"><?php echo $organizer['post_title'] ?></a>
126
+ </span>
127
+ <?php }
128
+ } ?>
129
+ </div>
130
+ <?php } ?>
131
+ <div class="event-venue" itemprop="location" itemscope
132
+ itemtype="http://schema.org/Place">
133
+ <?php if ( $venue_post_id ) { ?>
134
+ <span itemprop="name"><a
135
+ href="<?php echo $venue_permalink ?>"><?php echo $venue; ?></a></span>
136
+ <div class="address" itemprop="address" itemscope
137
+ itemtype="http://schema.org/PostalAddress">
138
+ <?php echo $ecwd_event_location; ?>
139
+ <?php
140
+ if ( $ecwd_event_latlong ) {
141
+ ?>
142
+ <?php } ?>
143
+ </div>
144
+
145
+ <?php } elseif ( $ecwd_event_location ) { ?>
146
+ <div class="address" itemprop="address" itemscope
147
+ itemtype="http://schema.org/PostalAddress">
148
+ <?php echo $ecwd_event_location; ?>
149
+ </div>
150
+ <?php } ?>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ <?php if ($social_icons) {
155
+ ?>
156
+
157
+ <div class="ecwd-social">
158
+ <span class="share-links">
159
+ <a href="http://twitter.com/home?status=<?php echo get_permalink( $post_id ) ?>" class="ecwd-twitter"
160
+ target="_blank" data-original-title="Tweet It">
161
+ <span class="visuallyhidden">Twitter</span></a>
162
+ <a href="http://www.facebook.com/sharer.php?u=<?php echo get_permalink( $post_id ) ?>" class="ecwd-facebook"
163
+ target="_blank" data-original-title="Share on Facebook">
164
+ <span class="visuallyhidden">Facebook</span></a>
165
+ <a href="http://plus.google.com/share?url=<?php echo get_permalink( $post_id ) ?>" class="ecwd-google-plus"
166
+ target="_blank" data-original-title="Share on Google+">
167
+ <span class="visuallyhidden">Google+</span></a>
168
+ </span>
169
+ </div>
170
+ <?php } ?>
171
+ <?php
172
+ echo $ecwd_event_show_map.'sdsdsd';
173
+ if ($ecwd_event_show_map==1 && $ecwd_event_latlong ) {
174
+ $map_events = array();
175
+ $map_events[0]['latlong'] = explode( ',', $ecwd_event_latlong );
176
+ if ( $ecwd_event_location != '' ) {
177
+ $map_events[0]['location'] = $ecwd_event_location;
178
+ }
179
+ $map_events[0]['zoom'] = $ecwd_event_zoom;
180
+ $map_events[0]['infow'] = '<div class="ecwd_map_event">';
181
+ $map_events[0]['infow'] .= '<span class="location">' . $ecwd_event_location . '</span>';
182
+ $map_events[0]['infow'] .= '</div>';
183
+ $map_events[0]['infow'] .= '<div class="event-detalis-date">
184
+ <label class="ecwd-event-date-info" title="' . __( 'Date', 'ecwd' ) . '"></label>
185
+ <span class="ecwd-event-date" itemprop="startDate" content="' . date( 'Y-m-d', strtotime( $ecwd_event_date_from ) ) . 'T' . date( 'H:i', strtotime( $ecwd_event_date_from ) ) . '">';
186
+ if ( $ecwd_all_day_event == 1 ) {
187
+ $map_events[0]['infow'] .= date( $date_format, strtotime( $ecwd_event_date_from ) );
188
+ if ( $ecwd_event_date_to ) {
189
+ $map_events[0]['infow'] .= ' - ' . date( $date_format, strtotime( $ecwd_event_date_to ) ) . ' ' . __( 'All day', 'ecwd' );
190
+ }
191
+ } else {
192
+ $map_events[0]['infow'] .= date( $date_format, strtotime( $ecwd_event_date_from ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_from ) );
193
+
194
+ if ( $ecwd_event_date_to ) {
195
+ $map_events[0]['infow'] .= date( $date_format, strtotime( $ecwd_event_date_to ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_to ) );
196
+ }
197
+ }
198
+ $map_events[0]['infow'] .= ' </span>
199
+ </div>';
200
+
201
+ $markers = json_encode( $map_events );
202
+ ?>
203
+ <div class="ecwd-show-map">
204
+ <div class="ecwd_map_div">
205
+ </div>
206
+ <textarea class="hidden ecwd_markers"
207
+ style="display: none;"><?php echo $markers; ?></textarea>
208
+ </div>
209
+ <?php } ?>
210
+ <div class="clear"></div>
211
+ </div>
212
+
213
+
214
+ <div class="ecwd-event-video">
215
+ <?php
216
+ if ( strpos( $ecwd_event_video, 'youtube' ) > 0 ) {
217
+ parse_str( parse_url( $ecwd_event_video, PHP_URL_QUERY ), $video_array_of_vars );
218
+ if ( isset( $video_array_of_vars['v'] ) && $video_array_of_vars['v'] ) {
219
+ ?>
220
+ <object data="http://www.youtube.com/v/<?php echo $video_array_of_vars['v'] ?>"
221
+ type="application/x-shockwave-flash" width="400" height="300">
222
+ <param name="src"
223
+ value="http://www.youtube.com/v/<?php echo $video_array_of_vars['v'] ?>"/>
224
+ </object>
225
+ <?php }
226
+ } elseif ( strpos( $ecwd_event_video, 'vimeo' ) > 0 ) {
227
+ $videoID = explode( '/', $ecwd_event_video );
228
+ $videoID = $videoID[ count( $videoID ) - 1 ];
229
+ if ( $videoID ) {
230
+
231
+ ?>
232
+ <iframe
233
+ src="http://player.vimeo.com/video/<?php echo $videoID; ?>?title=0&amp;byline=0&amp;portrait=0&amp;badge=0&amp;color=ffffff"
234
+ width="" height="" frameborder="0" webkitAllowFullScreen mozallowfullscreen
235
+ allowFullScreen></iframe>
236
+ <?php }
237
+
238
+
239
+ }
240
+
241
+ ?>
242
+ </div>
243
+ <div>
244
+ <?php the_content(); ?>
245
+ </div>
246
+ <?php
247
+ if ( comments_open() ) { ?>
248
+ <div class="eswd-comments">
249
+
250
+ <?php echo comments_template(); ?>
251
+ </div>
252
+ <?php } ?>
253
+
254
+ </div> <!-- #post-x -->
255
+ <?php endwhile; ?>
256
+ </div>
257
+
258
+ <?php get_footer(); ?>