Event Calendar WD – Responsive Event Calendar plugin - Version 1.0.16

Version Description

Added: Show the repeat rate in event page option

Download this release

Release Info

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

Code changes from version 1.0.15 to 1.0.16

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.15
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.16
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.15';
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.16';
10
  protected $ecwd_page = null;
11
 
12
  private function __construct() {
ecwd_class.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  class ECWD {
8
 
9
- protected $version = '1.0.15';
10
  protected $plugin_name = 'event-calendar-wd';
11
  protected $prefix = 'ecwd';
12
  protected $old_version = '1.0.13';
6
  */
7
  class ECWD {
8
 
9
+ protected $version = '1.0.16';
10
  protected $plugin_name = 'event-calendar-wd';
11
  protected $prefix = 'ecwd';
12
  protected $old_version = '1.0.13';
includes/ecwd-functions.php CHANGED
@@ -395,8 +395,8 @@ function ecwd_print_countdown( $event_id, $widget = 1, $theme_id = null, $args =
395
  }
396
  $time_format .= (isset( $ecwd_options['time_type'])?' '.$ecwd_options['time_type']: '');
397
  if(isset($ecwd_options['time_type']) && $ecwd_options['time_type'] !=''){
398
- $time_format = str_replace('H', 'h', $time_format);
399
- }
400
  $defaults = array(
401
  'title_text' => '',
402
  'sort' => 'asc',
395
  }
396
  $time_format .= (isset( $ecwd_options['time_type'])?' '.$ecwd_options['time_type']: '');
397
  if(isset($ecwd_options['time_type']) && $ecwd_options['time_type'] !=''){
398
+ $time_format = str_replace('H', 'h', $time_format);
399
+ }
400
  $defaults = array(
401
  'title_text' => '',
402
  'sort' => 'asc',
includes/register-settings.php CHANGED
@@ -125,6 +125,12 @@ function ecwd_register_settings() {
125
  'desc' => __( 'Check to display social icons in event, organizer and venue pages.', 'ecwd' ),
126
  'type' => 'checkbox'
127
  ),
 
 
 
 
 
 
128
  'related_events' => array(
129
  'id' => 'related_events',
130
  'name' => __( 'Show related events in the event page', 'ecwd' ),
125
  'desc' => __( 'Check to display social icons in event, organizer and venue pages.', 'ecwd' ),
126
  'type' => 'checkbox'
127
  ),
128
+ 'show_repeat_rate' => array(
129
+ 'id' => 'show_repeat_rate',
130
+ 'name' => __( 'Show the repeat rate', 'ecwd' ),
131
+ 'desc' => __( 'Check to show the repeat rate in event page .', 'ecwd' ),
132
+ 'type' => 'checkbox'
133
+ ),
134
  'related_events' => array(
135
  'id' => 'related_events',
136
  'name' => __( 'Show related events in the event page', 'ecwd' ),
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.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -130,6 +130,9 @@ After downloading the ZIP file of the Event Calendar WD plugin,
130
 
131
  == Changelog ==
132
 
 
 
 
133
  = 1.0.15 =
134
  Added: Show AM/PM option
135
 
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.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
130
 
131
  == Changelog ==
132
 
133
+ = 1.0.16 =
134
+ Added: Show the repeat rate in event page option
135
+
136
  = 1.0.15 =
137
  Added: Show AM/PM option
138
 
views/single-event.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
3
  * Display for Event Custom Post Types
4
  */
5
- if ( ! defined( 'ABSPATH' ) ) {
6
- die( '-1' );
7
  }
8
 
9
  global $post;
@@ -12,516 +12,528 @@ global $ecwd_options;
12
  global $wp_query;
13
 
14
  $post_id = $post->ID;
15
- $meta = get_post_meta( $post_id );
16
 
17
- $date_format = 'Y-m-d';
18
- $time_format = 'H:i';
19
  $ecwd_social_icons = false;
20
- if ( isset( $ecwd_options['date_format'] ) && $ecwd_options['date_format'] != '' ) {
21
- $date_format = $ecwd_options['date_format'];
22
  }
23
- if ( isset( $ecwd_options['time_format'] ) && $ecwd_options['time_format'] != '' ) {
24
- $time_format = $ecwd_options['time_format'];
25
  }
26
- $time_format .= (isset( $ecwd_options['time_type'])?' '.$ecwd_options['time_type']: '');
27
- if(isset($ecwd_options['time_type']) && $ecwd_options['time_type'] !=''){
28
  $time_format = str_replace('H', 'h', $time_format);
29
  }
30
 
31
- if ( isset( $ecwd_options['social_icons'] ) && $ecwd_options['social_icons'] != '' ) {
32
- $ecwd_social_icons = $ecwd_options['social_icons'];
33
  }
34
  // Load up all post meta data
35
 
36
 
37
- $ecwd_event = $post;
38
- $ecwd_event_metas = get_post_meta( $ecwd_event->ID, '', true );
39
- $ecwd_event_date_from = $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ][0];
40
- $ecwd_event_date_to = $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ][0];
41
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_url' ] = array( 0 => '' );
42
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ] ) ) {
43
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ] = array( 0 => '' );
44
  }
45
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ] ) ) {
46
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ] = array( 0 => '' );
47
  }
48
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ] ) ) {
49
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ] = array( 0 => '' );
50
  }
51
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ] ) ) {
52
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ] = array( 0 => '' );
53
  }
54
 
55
  $permalink = get_the_permalink($ecwd_event->ID);
56
- $this_event = $events[ $ecwd_event->ID ] = new ECWD_Event( $ecwd_event->ID, '', $ecwd_event->post_title, $ecwd_event->post_content, $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_url' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ][0], $permalink, $ecwd_event, '', $ecwd_event_metas );
57
- $d = new ECWD_Display('');
58
- if ( isset( $_GET['eventDate'] ) || isset($wp_query->query_vars['eventDate'] )) {
59
- $fromDate = isset( $_GET['eventDate'] )?$_GET['eventDate']:$wp_query->query_vars['eventDate'];
60
-
61
- $eventdayslong = $d->dateDiff( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ][0] );
62
- $toDate = date('Y-m-d', strtotime( ( date( "Y-m-d", ( strtotime( $fromDate ) ) ) . " +" . ( $eventdayslong + 2 ) . " days" ) ));
63
- $this_event_dates = $d->get_event_days( array($ecwd_event->ID=> $this_event ), 1, $fromDate, $toDate );
64
- if(isset($this_event_dates[0]['from']) && strtotime($fromDate)==strtotime($this_event_dates[0]['from'])) {
65
- $ecwd_event_date_from = $this_event_dates[0]['from'].' '.$this_event_dates[0]['starttime'];
66
- $ecwd_event_date_to = $this_event_dates[0]['to'].' '.$this_event_dates[0]['endtime'];
67
- }
68
  }
69
 
70
 
71
- $ecwd_event_location = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ][0]:'';
72
- $ecwd_event_latlong = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ][0]:'';
73
- $ecwd_event_zoom = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_map_zoom' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_map_zoom' ][0]:'';
74
- $ecwd_event_show_map = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_show_map' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_show_map' ][0]:0;
75
- if ( $ecwd_event_show_map == '' ) {
76
- $ecwd_event_show_map = 1;
77
  }
78
- if ( ! $ecwd_event_zoom ) {
79
- $ecwd_event_zoom = 17;
80
  }
81
 
82
- $ecwd_event_organizers = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_organizers' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_organizers' ][0]:'';
83
 
84
 
85
 
86
- $ecwd_event_url = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_url' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_url' ][0]:'';
87
- $ecwd_event_video = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_video' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_video' ][0]:'';
88
- $ecwd_all_day_event = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_all_day_event' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_all_day_event' ][0]:0;
89
- $venue = '';
90
- $venue_permalink = '';
91
- $venue_post_id = isset($ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_venue' ][0])?$ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_venue' ][0]:0;
92
- if ( $venue_post_id ) {
93
- $venue_post = get_post( $venue_post_id );
94
- if ( $venue_post ) {
95
- $venue = $venue_post->post_title;
96
- $venue_permalink = get_permalink( $venue_post->ID );
97
- }
98
  }
99
 
100
  $organizers = array();
101
 
102
- if ( is_array( $ecwd_event_organizers ) || is_object( $ecwd_event_organizers ) ) {
103
- foreach ( $ecwd_event_organizers as $ecwd_event_organizer ) {
104
- $organizers[] = get_post( $ecwd_event_organizer, ARRAY_A );
105
- }
106
  }
107
  $featured_image = '';
108
- if ( has_post_thumbnail() ) {
109
- $featured_image = wp_get_attachment_url( get_post_thumbnail_id( $post->ID, 'full', false ) );
110
  }
111
 
112
  $category_and_tags = false;
113
 
114
- if ( isset( $ecwd_options['category_and_tags'] ) && $ecwd_options['category_and_tags'] != '' ) {
115
- $category_and_tags = $ecwd_options['category_and_tags'];
116
  }
117
- $args = array( 'orderby' => 'name', 'order' => 'ASC', 'fields' => 'all' );
118
- $event_tags = wp_get_post_terms( $post->ID, 'ecwd_event_tag', $args );
119
- $event_categories = wp_get_post_terms( $post->ID, 'ecwd_event_category', $args );
120
 
121
  get_header();
122
  ?>
123
  <div id="ecwd-events-content" class="ecwd-events-single hentry">
124
 
125
 
126
- <?php while ( have_posts() ) :
127
- the_post(); ?>
128
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
129
-
130
- <div class="ecwd-event" itemscope itemtype="http://schema.org/Event">
131
- <header class="entry-header">
132
- <?php the_title( '<h1 class="ecwd-events-single-event-title summary entry-title">', '</h1>' ); ?>
133
- </header>
134
- <div class="event-detalis">
135
-
136
- <?php ?>
137
- <?php if ( $featured_image && $featured_image !== '' ) { ?>
138
- <div class="event-featured-image">
139
- <img src="<?php echo $featured_image; ?>"/>
140
- </div>
141
- <?php } ?>
142
- <div class="ecwd-event-details">
143
- <div class="event-detalis-date">
144
- <label class="ecwd-event-date-info"
145
- title="<?php _e( 'Date', 'ecwd' ); ?>"></label>
146
- <span class="ecwd-event-date" itemprop="startDate"
147
- content="<?php echo date( 'Y-m-d', strtotime( $ecwd_event_date_from ) ) . 'T' . date( 'H:i', strtotime( $ecwd_event_date_from ) ) ?>">
148
- <?php if ( $ecwd_all_day_event == 1 ) {
149
- echo date( $date_format, strtotime( $ecwd_event_date_from ) );
150
- if ( $ecwd_all_day_event == 1 ) {
151
- if ( $ecwd_event_date_to && date( $date_format, strtotime( $ecwd_event_date_from ) ) !== date( $date_format, strtotime( $ecwd_event_date_to ) ) ) {
152
- echo ' - ' . date( $date_format, strtotime( $ecwd_event_date_to ) );
153
- }
154
- echo ' ' . __( 'All day', 'ecwd' );
155
- }
156
- } else {
157
- echo date( $date_format, strtotime( $ecwd_event_date_from ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_from ) );
158
-
159
- if ( $ecwd_event_date_to ) {
160
- echo ' - ' . date( $date_format, strtotime( $ecwd_event_date_to ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_to ) );
161
- }
162
- } ?>
163
- </span>
164
- </div>
165
- <?php if ( $ecwd_event_url ) { ?>
166
- <div class="ecwd-url">
167
-
168
- <a href="<?php echo $ecwd_event_url; ?>" target="_blank"><label
169
- class="ecwd-event-url-info"
170
- title="<?php _e( 'Url', 'ecwd' ); ?>"></label> <?php echo $ecwd_event_url; ?>
171
- </a>
172
- </div>
173
- <?php } ?>
174
- <?php if ( count( $organizers ) > 0 ) { ?>
175
- <div class="event-detalis-org">
176
- <label class="ecwd-event-org-info"
177
- title="<?php _e( 'Organizers', 'ecwd' ); ?>"></label>
178
- <?php
179
- foreach ( $organizers as $organizer ) { ?>
180
- <span itemprop="organizer">
181
- <a href="<?php echo get_permalink( $organizer['ID'] ) ?>"><?php echo $organizer['post_title'] ?></a>
182
- </span>
183
- <?php } ?>
184
- </div>
185
- <?php } ?>
186
- <div class="event-venue" itemprop="location" itemscope
187
- itemtype="http://schema.org/Place">
188
- <?php if ( $venue_post_id ) { ?>
189
- <label class="ecwd-venue-info"
190
- title="<?php _e( 'Venue', 'ecwd' ); ?>"></label>
191
- <span itemprop="name"><a
192
- href="<?php echo $venue_permalink ?>"><?php echo $venue; ?></a></span>
193
- <div class="address" itemprop="address" itemscope
194
- itemtype="http://schema.org/PostalAddress">
195
- <?php echo $ecwd_event_location; ?>
196
- </div>
197
-
198
- <?php } elseif ( $ecwd_event_location ) { ?>
199
- <label class="ecwd-venue-info"
200
- title="<?php _e( 'Location', 'ecwd' ); ?>"></label>
201
- <span class="address" itemprop="address" itemscope
202
- itemtype="http://schema.org/PostalAddress">
203
- <?php echo $ecwd_event_location; ?>
204
- </span>
205
- <?php } ?>
206
- </div>
207
- <?php do_action( 'ecwd_view_ext' );?>
208
- </div>
209
- </div>
210
- <?php if ( $ecwd_social_icons ) {
211
- ?>
212
-
213
- <div class="ecwd-social">
214
- <span class="share-links">
215
- <a href="http://twitter.com/home?status=<?php echo get_permalink( $post_id ) ?>"
216
- class="ecwd-twitter"
217
- target="_blank" data-original-title="Tweet It">
218
- <span class="visuallyhidden">Twitter</span></a>
219
- <a href="http://www.facebook.com/sharer.php?u=<?php echo get_permalink( $post_id ) ?>"
220
- class="ecwd-facebook"
221
- target="_blank" data-original-title="Share on Facebook">
222
- <span class="visuallyhidden">Facebook</span></a>
223
- <a href="http://plus.google.com/share?url=<?php echo get_permalink( $post_id ) ?>"
224
- class="ecwd-google-plus"
225
- target="_blank" data-original-title="Share on Google+">
226
- <span class="visuallyhidden">Google+</span></a>
227
- </span>
228
- </div>
229
- <?php } ?>
230
- <?php
231
- if ( $ecwd_event_show_map == 1 && $ecwd_event_latlong ) {
232
- $map_events = array();
233
- $map_events[0]['latlong'] = explode( ',', $ecwd_event_latlong );
234
- if ( $ecwd_event_location != '' ) {
235
- $map_events[0]['location'] = $ecwd_event_location;
236
- }
237
- $map_events[0]['zoom'] = $ecwd_event_zoom;
238
- $map_events[0]['infow'] = '<div class="ecwd_map_event">';
239
- $map_events[0]['infow'] .= '<span class="location">' . $ecwd_event_location . '</span>';
240
- $map_events[0]['infow'] .= '</div>';
241
- $map_events[0]['infow'] .= '<div class="event-detalis-date">
242
- <label class="ecwd-event-date-info" title="' . __( 'Date', 'ecwd' ) . '"></label>
243
- <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 ) ) . '">';
244
- if ( $ecwd_all_day_event == 1 ) {
245
- $map_events[0]['infow'] .= date( $date_format, strtotime( $ecwd_event_date_from ) );
246
- if ( $ecwd_event_date_to ) {
247
- $map_events[0]['infow'] .= ' - ' . date( $date_format, strtotime( $ecwd_event_date_to ) ) . ' ' . __( 'All day', 'ecwd' );
248
- }
249
- } else {
250
- $map_events[0]['infow'] .= date( $date_format, strtotime( $ecwd_event_date_from ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_from ) );
251
-
252
- if ( $ecwd_event_date_to ) {
253
- $map_events[0]['infow'] .= date( $date_format, strtotime( $ecwd_event_date_to ) ) . ' ' . date( $time_format, strtotime( $ecwd_event_date_to ) );
254
- }
255
- }
256
- $map_events[0]['infow'] .= ' </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  </div>';
258
 
259
- $markers = json_encode( $map_events );
260
- ?>
261
- <div class="ecwd-show-map">
262
- <div class="ecwd_map_div">
263
- </div>
264
- <textarea class="hidden ecwd_markers"
265
- style="display: none;"><?php echo $markers; ?></textarea>
266
- </div>
267
- <?php } ?>
268
- <div class="clear"></div>
269
-
270
-
271
- <div class="ecwd-event-video">
272
- <?php
273
- if ( strpos( $ecwd_event_video, 'youtube' ) > 0 ) {
274
- parse_str( parse_url( $ecwd_event_video, PHP_URL_QUERY ), $video_array_of_vars );
275
- if ( isset( $video_array_of_vars['v'] ) && $video_array_of_vars['v'] ) {
276
- ?>
277
- <object data="http://www.youtube.com/v/<?php echo $video_array_of_vars['v'] ?>"
278
- type="application/x-shockwave-flash" width="400" height="300">
279
- <param name="src"
280
- value="http://www.youtube.com/v/<?php echo $video_array_of_vars['v'] ?>"/>
281
- </object>
282
- <?php }
283
- } elseif ( strpos( $ecwd_event_video, 'vimeo' ) > 0 ) {
284
- $videoID = explode( '/', $ecwd_event_video );
285
- $videoID = $videoID[ count( $videoID ) - 1 ];
286
- if ( $videoID ) {
287
-
288
- ?>
289
- <iframe
290
- src="http://player.vimeo.com/video/<?php echo $videoID; ?>?title=0&amp;byline=0&amp;portrait=0&amp;badge=0&amp;color=ffffff"
291
- width="" height="" frameborder="0" webkitAllowFullScreen mozallowfullscreen
292
- allowFullScreen></iframe>
293
- <?php }
294
-
295
-
296
- }
297
-
298
- ?>
299
- </div>
300
- <!-- Content -->
301
- <div>
302
- <?php the_content(); ?>
303
- </div>
304
- <!-- End Content -->
305
- <!-- Categories and tags -->
306
- <?php if ( $category_and_tags == 1 ) { ?>
307
- <div class="event_cageory_and_tags">
308
-
309
- <?php
310
- if ( ! empty( $event_categories ) ) { ?>
311
- <ul class="event_categories">
312
- <?php
313
-
314
- foreach ( $event_categories as $category ) {
315
-
316
- $metas = get_option( "ecwd_event_category_$category->term_id" );
317
-
318
- ?>
319
- <li class="event_category event-details-title">
320
- <?php if ( $metas['color'] ) { ?>
321
- <span class="event-metalabel"
322
- style="background:<?php echo $metas['color']; ?>"></span>
323
- <span class="event_catgeory_name"> <a
324
- href="<?php echo get_category_link( $category ); ?>"
325
- style="color:<?php echo $metas['color']; ?>"><?php echo $category->name; ?> </a></span>
326
- <?php } else { ?>
327
- <span class="event_catgeory_name"> <a
328
- href="<?php echo get_category_link( $category ); ?>"><?php echo $category->name; ?> </a></span>
329
- <?php } ?>
330
- </li>
331
- <?php
332
- }
333
- ?>
334
- </ul>
335
- <?php
336
- }
337
- ?>
338
-
339
-
340
- <?php
341
- if ( ! empty( $event_tags ) ) {
342
- ?>
343
-
344
- <ul class="event_tags">
345
-
346
- <?php
347
- foreach ( $event_tags as $tag ) {
348
- ?>
349
- <li class="event_tag">
350
- <span class="event_tag_name">
351
- <a href="<?php echo get_tag_link( $tag ); ?>">#<?php echo $tag->name; ?> </a>
352
- </span>
353
- </li>
354
- <?php
355
- }
356
- ?></ul>
357
- <?php
358
- }
359
- ?>
360
- </div>
361
- <?php } ?>
362
- <!-- END Categories and tags -->
363
-
364
-
365
-
366
- <?php
367
- if ( ! isset( $ecwd_options['related_events'] ) || $ecwd_options['related_events'] == 1 ) {
368
- $post_cats = wp_get_post_terms( $post_id, ECWD_PLUGIN_PREFIX . '_event_category' );
369
- $cat_ids = wp_list_pluck( $post_cats, 'term_id' );
370
- $post_tags = wp_get_post_terms( $post_id, ECWD_PLUGIN_PREFIX . '_event_tag' );
371
- $tag_ids = wp_list_pluck( $post_tags, 'term_id' );
372
- $events = array();
373
- $today = date( 'Y-m-d' );
374
-
375
- $args = array(
376
- 'numberposts' => - 1,
377
- 'post_type' => ECWD_PLUGIN_PREFIX . '_event',
378
- 'tax_query' => array(
379
- array(
380
- 'taxonomy' => ECWD_PLUGIN_PREFIX . '_event_category',
381
- 'terms' => $cat_ids,
382
- 'field' => 'term_id',
383
- )
384
- ),
385
- 'orderby' => 'meta_value',
386
- 'order' => 'ASC'
387
- );
388
- $ecwd_events_by_cats = get_posts( $args );
389
- $args = array(
390
- 'numberposts' => - 1,
391
- 'post_type' => ECWD_PLUGIN_PREFIX . '_event',
392
- 'tax_query' => array(
393
- array(
394
- 'taxonomy' => ECWD_PLUGIN_PREFIX . '_event_tag',
395
- 'terms' => $tag_ids,
396
- 'field' => 'term_id',
397
- ),
398
- ),
399
- 'orderby' => 'meta_value',
400
- 'order' => 'ASC'
401
- );
402
- $ecwd_events_by_tags = get_posts( $args );
403
- $ecwd_events = array_merge( $ecwd_events_by_tags, $ecwd_events_by_cats );
404
- $ecwd_events = array_map( "unserialize", array_unique( array_map( "serialize", $ecwd_events ) ) );
405
- wp_reset_postdata();
406
- wp_reset_query();
407
-
408
- foreach ( $ecwd_events as $ecwd_event ) {
409
- if ( $ecwd_event->ID != $post_id ) {
410
- $term_metas = '';
411
- $categories = get_the_terms( $ecwd_event->ID, ECWD_PLUGIN_PREFIX . '_event_category' );
412
- if ( is_array( $categories ) ) {
413
- foreach ( $categories as $category ) {
414
- $term_metas = get_option( "ecwd_event_category_$category->term_id" );
415
- $term_metas['id'] = $category->term_id;
416
- $term_metas['name'] = $category->name;
417
- $term_metas['slug'] = $category->slug;
418
- }
419
- }
420
- $ecwd_event_metas = get_post_meta( $ecwd_event->ID, '', true );
421
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_url' ] = array( 0 => '' );
422
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ] ) ) {
423
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ] = array( 0 => '' );
424
- }
425
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ] ) ) {
426
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ] = array( 0 => '' );
427
- }
428
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ] ) ) {
429
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ] = array( 0 => '' );
430
- }
431
- if ( ! isset( $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ] ) ) {
432
- $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ] = array( 0 => '' );
433
- }
434
-
435
- $permalink = get_permalink( $ecwd_event->ID );
436
- $events[ $ecwd_event->ID ] = new ECWD_Event( $ecwd_event->ID, 0, $ecwd_event->post_title, $ecwd_event->post_content, $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_location' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_from' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_date_to' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_event_url' ][0], $ecwd_event_metas[ ECWD_PLUGIN_PREFIX . '_lat_long' ][0], $permalink, $ecwd_event, $term_metas, $ecwd_event_metas );
437
- }
438
- }
439
-
440
- $d = new ECWD_Display( 0, '', '', $today );
441
- $events = $d->get_event_days( $events );
442
- ?>
443
-
444
- <?php if ( count( $events ) > 0 ) {
445
- $events = $d->events_unique( $events );
446
- ?>
447
- <!-- Related Events-->
448
- <div class="ecwd-upcoming-events">
449
- <h3> <?php _e( 'Related events', 'ecwd' ) ?></h3>
450
-
451
- <div class="upcoming_events_slider">
452
-
453
- <div class="upcoming_events_slider-arrow-left"><a href="#left"></a></div>
454
- <div class="upcoming_events_slider-arrow-right"><a href="#right"></a></div>
455
- <ul>
456
- <?php
457
- foreach ( $events as $ecwd_event ) {
458
- ?>
459
- <li itemscope itemtype="http://schema.org/Event" class="upcoming_events_item"
460
- data-date="<?php echo date( 'Y-m-d', strtotime( $ecwd_event['from'] ) ); ?>">
461
- <div class="upcoming_event_container">
462
- <?php $image_class = '';
463
- $image = getAndReplaceFirstImage( $ecwd_event['post']->post_content );
464
- if ( ! has_post_thumbnail( $ecwd_event['id'] ) && $image['image'] == "" ) {
465
- $image_class = "ecwd-no-image";
466
- }
467
- echo '<div class="upcoming_events_item-img ' . $image_class . '">';
468
- if ( get_the_post_thumbnail( $ecwd_event['id'] ) ) {
469
- echo get_the_post_thumbnail( $ecwd_event['id'], 'thumb' );
470
- } elseif ( $image['image'] != null ) {
471
- echo '<img src="' . $image['image'] . '" />';
472
- $ecwd_event['post']->post_content = $image['content'];
473
- }
474
- echo '</div>'; ?>
475
- <div class="event-title" itemprop="name">
476
- <a href="<?php echo $ecwd_event['permalink'] ?>"><?php echo $ecwd_event['title'] ?></a>
477
- </div>
478
- <div class="event-date" itemprop="startDate"
479
- content="<?php echo date( 'Y-m-d', strtotime( $ecwd_event['from'] ) ) . 'T' . date( 'H:i', strtotime( $ecwd_event['starttime'] ) ) ?>">
480
-
481
- <?php
482
- if ( isset( $ecwd_event['all_day_event'] ) && $ecwd_event['all_day_event'] == 1 ) {
483
- echo date( $date_format, strtotime( $ecwd_event['from'] ) );
484
- if ( $ecwd_event['to'] && date( $date_format, strtotime( $ecwd_event['from'] ) ) !== date( $date_format, strtotime( $ecwd_event['to'] ) ) ) {
485
- echo ' - ' . date( $date_format, strtotime( $ecwd_event['to'] ) );
486
- }
487
- echo ' ' . __( 'All day', 'ecwd' );
488
- } else {
489
-
490
- echo date( $date_format, strtotime( $ecwd_event['from'] ) ) . ' ' . date( $time_format, strtotime( $ecwd_event['starttime'] ) );
491
-
492
- if ( $ecwd_event['to'] ) {
493
- echo ' - ' . date( $date_format, strtotime( $ecwd_event['to'] ) ) . ' ' . date( $time_format, strtotime( $ecwd_event['endtime'] ) );
494
- }
495
- } ?>
496
- </div>
497
-
498
-
499
- <div
500
- class="upcoming_events_item-content"><?php echo( $ecwd_event['post']->post_content ? $ecwd_event['post']->post_content : 'No additional details for this event.' ); ?> </div>
501
- </div>
502
- </li>
503
- <?php
504
- }
505
- ?>
506
- </ul>
507
- </div>
508
- </div>
509
-
510
- <?php } ?>
511
- <?php }?>
512
-
513
- </div>
514
- <!-- #Related Events-->
515
- </div> <!-- #post-x -->
516
- <?php
517
-
518
- if ( comments_open() && $post->comment_status == 'open' ) { ?>
519
- <div class="ecwd-comments">
520
-
521
- <?php echo comments_template(); ?>
522
- </div>
523
- <?php } ?>
524
- <?php endwhile; ?>
525
 
526
  </div>
527
 
2
  /**
3
  * Display for Event Custom Post Types
4
  */
5
+ if (!defined('ABSPATH')) {
6
+ die('-1');
7
  }
8
 
9
  global $post;
12
  global $wp_query;
13
 
14
  $post_id = $post->ID;
15
+ $meta = get_post_meta($post_id);
16
 
17
+ $date_format = 'Y-m-d';
18
+ $time_format = 'H:i';
19
  $ecwd_social_icons = false;
20
+ if (isset($ecwd_options['date_format']) && $ecwd_options['date_format'] != '') {
21
+ $date_format = $ecwd_options['date_format'];
22
  }
23
+ if (isset($ecwd_options['time_format']) && $ecwd_options['time_format'] != '') {
24
+ $time_format = $ecwd_options['time_format'];
25
  }
26
+ $time_format .= (isset($ecwd_options['time_type']) ? ' ' . $ecwd_options['time_type'] : '');
27
+ if(isset($ecwd_options['time_type']) && $ecwd_options['time_type'] !='') {
28
  $time_format = str_replace('H', 'h', $time_format);
29
  }
30
 
31
+ if (isset($ecwd_options['social_icons']) && $ecwd_options['social_icons'] != '') {
32
+ $ecwd_social_icons = $ecwd_options['social_icons'];
33
  }
34
  // Load up all post meta data
35
 
36
 
37
+ $ecwd_event = $post;
38
+ $ecwd_event_metas = get_post_meta($ecwd_event->ID, '', true);
39
+ $ecwd_event_date_from = $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'][0];
40
+ $ecwd_event_date_to = $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'][0];
41
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_url'] = array(0 => '');
42
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'])) {
43
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'] = array(0 => '');
44
  }
45
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'])) {
46
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'] = array(0 => '');
47
  }
48
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'])) {
49
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'] = array(0 => '');
50
  }
51
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'])) {
52
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'] = array(0 => '');
53
  }
54
 
55
  $permalink = get_the_permalink($ecwd_event->ID);
56
+ $this_event = $events[$ecwd_event->ID] = new ECWD_Event($ecwd_event->ID, '', $ecwd_event->post_title, $ecwd_event->post_content, $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_url'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'][0], $permalink, $ecwd_event, '', $ecwd_event_metas);
57
+ $d = new ECWD_Display('');
58
+ if (isset($_GET['eventDate']) || isset($wp_query->query_vars['eventDate'])) {
59
+ $fromDate = isset($_GET['eventDate']) ? $_GET['eventDate'] : $wp_query->query_vars['eventDate'];
60
+
61
+ $eventdayslong = $d->dateDiff($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'][0]);
62
+ $toDate = date('Y-m-d', strtotime(( date("Y-m-d", ( strtotime($fromDate))) . " +" . ( $eventdayslong + 2 ) . " days")));
63
+ $this_event_dates = $d->get_event_days(array($ecwd_event->ID => $this_event), 1, $fromDate, $toDate);
64
+ if (isset($this_event_dates[0]['from']) && strtotime($fromDate) == strtotime($this_event_dates[0]['from'])) {
65
+ $ecwd_event_date_from = $this_event_dates[0]['from'] . ' ' . $this_event_dates[0]['starttime'];
66
+ $ecwd_event_date_to = $this_event_dates[0]['to'] . ' ' . $this_event_dates[0]['endtime'];
67
+ }
68
  }
69
 
70
 
71
+ $ecwd_event_location = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'][0] : '';
72
+ $ecwd_event_latlong = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'][0] : '';
73
+ $ecwd_event_zoom = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_map_zoom'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_map_zoom'][0] : '';
74
+ $ecwd_event_show_map = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_show_map'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_show_map'][0] : 0;
75
+ if ($ecwd_event_show_map == '') {
76
+ $ecwd_event_show_map = 1;
77
  }
78
+ if (!$ecwd_event_zoom) {
79
+ $ecwd_event_zoom = 17;
80
  }
81
 
82
+ $ecwd_event_organizers = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_organizers'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_organizers'][0] : '';
83
 
84
 
85
 
86
+ $ecwd_event_url = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_url'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_url'][0] : '';
87
+ $ecwd_event_video = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_video'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_video'][0] : '';
88
+ $ecwd_all_day_event = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_all_day_event'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_all_day_event'][0] : 0;
89
+ $venue = '';
90
+ $venue_permalink = '';
91
+ $venue_post_id = isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_venue'][0]) ? $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_venue'][0] : 0;
92
+ if ($venue_post_id) {
93
+ $venue_post = get_post($venue_post_id);
94
+ if ($venue_post) {
95
+ $venue = $venue_post->post_title;
96
+ $venue_permalink = get_permalink($venue_post->ID);
97
+ }
98
  }
99
 
100
  $organizers = array();
101
 
102
+ if (is_array($ecwd_event_organizers) || is_object($ecwd_event_organizers)) {
103
+ foreach ($ecwd_event_organizers as $ecwd_event_organizer) {
104
+ $organizers[] = get_post($ecwd_event_organizer, ARRAY_A);
105
+ }
106
  }
107
  $featured_image = '';
108
+ if (has_post_thumbnail()) {
109
+ $featured_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'full', false));
110
  }
111
 
112
  $category_and_tags = false;
113
 
114
+ if (isset($ecwd_options['category_and_tags']) && $ecwd_options['category_and_tags'] != '') {
115
+ $category_and_tags = $ecwd_options['category_and_tags'];
116
  }
117
+ $args = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all');
118
+ $event_tags = wp_get_post_terms($post->ID, 'ecwd_event_tag', $args);
119
+ $event_categories = wp_get_post_terms($post->ID, 'ecwd_event_category', $args);
120
 
121
  get_header();
122
  ?>
123
  <div id="ecwd-events-content" class="ecwd-events-single hentry">
124
 
125
 
126
+ <?php
127
+ while (have_posts()) :
128
+ the_post();
129
+ ?>
130
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
131
+
132
+ <div class="ecwd-event" itemscope itemtype="http://schema.org/Event">
133
+ <header class="entry-header">
134
+ <?php the_title('<h1 class="ecwd-events-single-event-title summary entry-title">', '</h1>'); ?>
135
+ </header>
136
+ <div class="event-detalis">
137
+
138
+ <?php ?>
139
+ <?php if ($featured_image && $featured_image !== '') { ?>
140
+ <div class="event-featured-image">
141
+ <img src="<?php echo $featured_image; ?>"/>
142
+ </div>
143
+ <?php } ?>
144
+ <div class="ecwd-event-details">
145
+ <div class="event-detalis-date">
146
+ <label class="ecwd-event-date-info"
147
+ title="<?php _e('Date', 'ecwd'); ?>"></label>
148
+ <span class="ecwd-event-date" itemprop="startDate"
149
+ content="<?php echo date('Y-m-d', strtotime($ecwd_event_date_from)) . 'T' . date('H:i', strtotime($ecwd_event_date_from)) ?>">
150
+ <?php
151
+ if ($ecwd_all_day_event == 1) {
152
+ echo date($date_format, strtotime($ecwd_event_date_from));
153
+ if ($ecwd_all_day_event == 1) {
154
+ if ($ecwd_event_date_to && date($date_format, strtotime($ecwd_event_date_from)) !== date($date_format, strtotime($ecwd_event_date_to))) {
155
+ echo ' - ' . date($date_format, strtotime($ecwd_event_date_to));
156
+ }
157
+ echo ' ' . __('All day', 'ecwd');
158
+ }
159
+ } else {
160
+ echo date($date_format, strtotime($ecwd_event_date_from)) . ' ' . date($time_format, strtotime($ecwd_event_date_from));
161
+
162
+ if ($ecwd_event_date_to) {
163
+ echo ' - ' . date($date_format, strtotime($ecwd_event_date_to)) . ' ' . date($time_format, strtotime($ecwd_event_date_to));
164
+ }
165
+ }
166
+ ?>
167
+ </span>
168
+ </div>
169
+ <?php
170
+ if (isset($ecwd_options['show_repeat_rate'])) {
171
+ $repeat_rate_text = $d->get_repeat_rate($post_id, '', $date_format);
172
+ if ($repeat_rate_text != ''):
173
+ ?>
174
+ <div class="ecwd_repeat_rate_text">
175
+ <span><?php echo $d->get_repeat_rate($post_id, '', $date_format); ?></span>
176
+ </div>
177
+ <?php
178
+ endif;
179
+ }
180
+ ?>
181
+ <?php if ($ecwd_event_url) { ?>
182
+ <div class="ecwd-url">
183
+
184
+ <a href="<?php echo $ecwd_event_url; ?>" target="_blank"><label
185
+ class="ecwd-event-url-info"
186
+ title="<?php _e('Url', 'ecwd'); ?>"></label> <?php echo $ecwd_event_url; ?>
187
+ </a>
188
+ </div>
189
+ <?php } ?>
190
+ <?php if (count($organizers) > 0) { ?>
191
+ <div class="event-detalis-org">
192
+ <label class="ecwd-event-org-info"
193
+ title="<?php _e('Organizers', 'ecwd'); ?>"></label>
194
+ <?php foreach ($organizers as $organizer) { ?>
195
+ <span itemprop="organizer">
196
+ <a href="<?php echo get_permalink($organizer['ID']) ?>"><?php echo $organizer['post_title'] ?></a>
197
+ </span>
198
+ <?php } ?>
199
+ </div>
200
+ <?php } ?>
201
+ <div class="event-venue" itemprop="location" itemscope
202
+ itemtype="http://schema.org/Place">
203
+ <?php if ($venue_post_id) { ?>
204
+ <label class="ecwd-venue-info"
205
+ title="<?php _e('Venue', 'ecwd'); ?>"></label>
206
+ <span itemprop="name"><a
207
+ href="<?php echo $venue_permalink ?>"><?php echo $venue; ?></a></span>
208
+ <div class="address" itemprop="address" itemscope
209
+ itemtype="http://schema.org/PostalAddress">
210
+ <?php echo $ecwd_event_location; ?>
211
+ </div>
212
+
213
+ <?php } elseif ($ecwd_event_location) { ?>
214
+ <label class="ecwd-venue-info"
215
+ title="<?php _e('Location', 'ecwd'); ?>"></label>
216
+ <span class="address" itemprop="address" itemscope
217
+ itemtype="http://schema.org/PostalAddress">
218
+ <?php echo $ecwd_event_location; ?>
219
+ </span>
220
+ <?php } ?>
221
+ </div>
222
+ <?php do_action('ecwd_view_ext'); ?>
223
+ </div>
224
+ </div>
225
+ <?php if ($ecwd_social_icons) {
226
+ ?>
227
+
228
+ <div class="ecwd-social">
229
+ <span class="share-links">
230
+ <a href="http://twitter.com/home?status=<?php echo get_permalink($post_id) ?>"
231
+ class="ecwd-twitter"
232
+ target="_blank" data-original-title="Tweet It">
233
+ <span class="visuallyhidden">Twitter</span></a>
234
+ <a href="http://www.facebook.com/sharer.php?u=<?php echo get_permalink($post_id) ?>"
235
+ class="ecwd-facebook"
236
+ target="_blank" data-original-title="Share on Facebook">
237
+ <span class="visuallyhidden">Facebook</span></a>
238
+ <a href="http://plus.google.com/share?url=<?php echo get_permalink($post_id) ?>"
239
+ class="ecwd-google-plus"
240
+ target="_blank" data-original-title="Share on Google+">
241
+ <span class="visuallyhidden">Google+</span></a>
242
+ </span>
243
+ </div>
244
+ <?php } ?>
245
+ <?php
246
+ if ($ecwd_event_show_map == 1 && $ecwd_event_latlong) {
247
+ $map_events = array();
248
+ $map_events[0]['latlong'] = explode(',', $ecwd_event_latlong);
249
+ if ($ecwd_event_location != '') {
250
+ $map_events[0]['location'] = $ecwd_event_location;
251
+ }
252
+ $map_events[0]['zoom'] = $ecwd_event_zoom;
253
+ $map_events[0]['infow'] = '<div class="ecwd_map_event">';
254
+ $map_events[0]['infow'] .= '<span class="location">' . $ecwd_event_location . '</span>';
255
+ $map_events[0]['infow'] .= '</div>';
256
+ $map_events[0]['infow'] .= '<div class="event-detalis-date">
257
+ <label class="ecwd-event-date-info" title="' . __('Date', 'ecwd') . '"></label>
258
+ <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)) . '">';
259
+ if ($ecwd_all_day_event == 1) {
260
+ $map_events[0]['infow'] .= date($date_format, strtotime($ecwd_event_date_from));
261
+ if ($ecwd_event_date_to) {
262
+ $map_events[0]['infow'] .= ' - ' . date($date_format, strtotime($ecwd_event_date_to)) . ' ' . __('All day', 'ecwd');
263
+ }
264
+ } else {
265
+ $map_events[0]['infow'] .= date($date_format, strtotime($ecwd_event_date_from)) . ' ' . date($time_format, strtotime($ecwd_event_date_from));
266
+
267
+ if ($ecwd_event_date_to) {
268
+ $map_events[0]['infow'] .= ' '.date($date_format, strtotime($ecwd_event_date_to)) . ' ' . date($time_format, strtotime($ecwd_event_date_to));
269
+ }
270
+ }
271
+ $map_events[0]['infow'] .= ' </span>
272
  </div>';
273
 
274
+ $markers = json_encode($map_events);
275
+ ?>
276
+ <div class="ecwd-show-map">
277
+ <div class="ecwd_map_div">
278
+ </div>
279
+ <textarea class="hidden ecwd_markers"
280
+ style="display: none;"><?php echo $markers; ?></textarea>
281
+ </div>
282
+ <?php } ?>
283
+ <div class="clear"></div>
284
+
285
+
286
+ <div class="ecwd-event-video">
287
+ <?php
288
+ if (strpos($ecwd_event_video, 'youtube') > 0) {
289
+ parse_str(parse_url($ecwd_event_video, PHP_URL_QUERY), $video_array_of_vars);
290
+ if (isset($video_array_of_vars['v']) && $video_array_of_vars['v']) {
291
+ ?>
292
+ <object data="http://www.youtube.com/v/<?php echo $video_array_of_vars['v'] ?>"
293
+ type="application/x-shockwave-flash" width="400" height="300">
294
+ <param name="src"
295
+ value="http://www.youtube.com/v/<?php echo $video_array_of_vars['v'] ?>"/>
296
+ </object>
297
+ <?php
298
+ }
299
+ } elseif (strpos($ecwd_event_video, 'vimeo') > 0) {
300
+ $videoID = explode('/', $ecwd_event_video);
301
+ $videoID = $videoID[count($videoID) - 1];
302
+ if ($videoID) {
303
+ ?>
304
+ <iframe
305
+ src="http://player.vimeo.com/video/<?php echo $videoID; ?>?title=0&amp;byline=0&amp;portrait=0&amp;badge=0&amp;color=ffffff"
306
+ width="" height="" frameborder="0" webkitAllowFullScreen mozallowfullscreen
307
+ allowFullScreen></iframe>
308
+ <?php
309
+ }
310
+ }
311
+ ?>
312
+ </div>
313
+ <!-- Content -->
314
+ <div>
315
+ <?php the_content(); ?>
316
+ </div>
317
+ <!-- End Content -->
318
+ <!-- Categories and tags -->
319
+ <?php if ($category_and_tags == 1) { ?>
320
+ <div class="event_cageory_and_tags">
321
+
322
+ <?php if (!empty($event_categories)) { ?>
323
+ <ul class="event_categories">
324
+ <?php
325
+ foreach ($event_categories as $category) {
326
+
327
+ $metas = get_option("ecwd_event_category_$category->term_id");
328
+ ?>
329
+ <li class="event_category event-details-title">
330
+ <?php if ($metas['color']) { ?>
331
+ <span class="event-metalabel"
332
+ style="background:<?php echo $metas['color']; ?>"></span>
333
+ <span class="event_catgeory_name"> <a
334
+ href="<?php echo get_category_link($category); ?>"
335
+ style="color:<?php echo $metas['color']; ?>"><?php echo $category->name; ?> </a></span>
336
+ <?php } else { ?>
337
+ <span class="event_catgeory_name"> <a
338
+ href="<?php echo get_category_link($category); ?>"><?php echo $category->name; ?> </a></span>
339
+ <?php } ?>
340
+ </li>
341
+ <?php
342
+ }
343
+ ?>
344
+ </ul>
345
+ <?php
346
+ }
347
+ ?>
348
+
349
+
350
+ <?php
351
+ if (!empty($event_tags)) {
352
+ ?>
353
+
354
+ <ul class="event_tags">
355
+
356
+ <?php
357
+ foreach ($event_tags as $tag) {
358
+ ?>
359
+ <li class="event_tag">
360
+ <span class="event_tag_name">
361
+ <a href="<?php echo get_tag_link($tag); ?>">#<?php echo $tag->name; ?> </a>
362
+ </span>
363
+ </li>
364
+ <?php
365
+ }
366
+ ?></ul>
367
+ <?php
368
+ }
369
+ ?>
370
+ </div>
371
+ <?php } ?>
372
+ <!-- END Categories and tags -->
373
+
374
+
375
+
376
+ <?php
377
+ if (!isset($ecwd_options['related_events']) || $ecwd_options['related_events'] == 1) {
378
+ $post_cats = wp_get_post_terms($post_id, ECWD_PLUGIN_PREFIX . '_event_category');
379
+ $cat_ids = wp_list_pluck($post_cats, 'term_id');
380
+ $post_tags = wp_get_post_terms($post_id, ECWD_PLUGIN_PREFIX . '_event_tag');
381
+ $tag_ids = wp_list_pluck($post_tags, 'term_id');
382
+ $events = array();
383
+ $today = date('Y-m-d');
384
+
385
+ $args = array(
386
+ 'numberposts' => - 1,
387
+ 'post_type' => ECWD_PLUGIN_PREFIX . '_event',
388
+ 'tax_query' => array(
389
+ array(
390
+ 'taxonomy' => ECWD_PLUGIN_PREFIX . '_event_category',
391
+ 'terms' => $cat_ids,
392
+ 'field' => 'term_id',
393
+ )
394
+ ),
395
+ 'orderby' => 'meta_value',
396
+ 'order' => 'ASC'
397
+ );
398
+ $ecwd_events_by_cats = get_posts($args);
399
+ $args = array(
400
+ 'numberposts' => - 1,
401
+ 'post_type' => ECWD_PLUGIN_PREFIX . '_event',
402
+ 'tax_query' => array(
403
+ array(
404
+ 'taxonomy' => ECWD_PLUGIN_PREFIX . '_event_tag',
405
+ 'terms' => $tag_ids,
406
+ 'field' => 'term_id',
407
+ ),
408
+ ),
409
+ 'orderby' => 'meta_value',
410
+ 'order' => 'ASC'
411
+ );
412
+ $ecwd_events_by_tags = get_posts($args);
413
+ $ecwd_events = array_merge($ecwd_events_by_tags, $ecwd_events_by_cats);
414
+ $ecwd_events = array_map("unserialize", array_unique(array_map("serialize", $ecwd_events)));
415
+ wp_reset_postdata();
416
+ wp_reset_query();
417
+
418
+ foreach ($ecwd_events as $ecwd_event) {
419
+ if ($ecwd_event->ID != $post_id) {
420
+ $term_metas = '';
421
+ $categories = get_the_terms($ecwd_event->ID, ECWD_PLUGIN_PREFIX . '_event_category');
422
+ if (is_array($categories)) {
423
+ foreach ($categories as $category) {
424
+ $term_metas = get_option("ecwd_event_category_$category->term_id");
425
+ $term_metas['id'] = $category->term_id;
426
+ $term_metas['name'] = $category->name;
427
+ $term_metas['slug'] = $category->slug;
428
+ }
429
+ }
430
+ $ecwd_event_metas = get_post_meta($ecwd_event->ID, '', true);
431
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_url'] = array(0 => '');
432
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'])) {
433
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'] = array(0 => '');
434
+ }
435
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'])) {
436
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'] = array(0 => '');
437
+ }
438
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'])) {
439
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'] = array(0 => '');
440
+ }
441
+ if (!isset($ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'])) {
442
+ $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'] = array(0 => '');
443
+ }
444
+
445
+ $permalink = get_permalink($ecwd_event->ID);
446
+ $events[$ecwd_event->ID] = new ECWD_Event($ecwd_event->ID, 0, $ecwd_event->post_title, $ecwd_event->post_content, $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_location'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_from'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_date_to'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_event_url'][0], $ecwd_event_metas[ECWD_PLUGIN_PREFIX . '_lat_long'][0], $permalink, $ecwd_event, $term_metas, $ecwd_event_metas);
447
+ }
448
+ }
449
+
450
+ $d = new ECWD_Display(0, '', '', $today);
451
+ $events = $d->get_event_days($events);
452
+ ?>
453
+
454
+ <?php
455
+ if (count($events) > 0) {
456
+ $events = $d->events_unique($events);
457
+ ?>
458
+ <!-- Related Events-->
459
+ <div class="ecwd-upcoming-events">
460
+ <h3> <?php _e('Related events', 'ecwd') ?></h3>
461
+
462
+ <div class="upcoming_events_slider">
463
+
464
+ <div class="upcoming_events_slider-arrow-left"><a href="#left"></a></div>
465
+ <div class="upcoming_events_slider-arrow-right"><a href="#right"></a></div>
466
+ <ul>
467
+ <?php
468
+ foreach ($events as $ecwd_event) {
469
+ ?>
470
+ <li itemscope itemtype="http://schema.org/Event" class="upcoming_events_item"
471
+ data-date="<?php echo date('Y-m-d', strtotime($ecwd_event['from'])); ?>">
472
+ <div class="upcoming_event_container">
473
+ <?php
474
+ $image_class = '';
475
+ $image = getAndReplaceFirstImage($ecwd_event['post']->post_content);
476
+ if (!has_post_thumbnail($ecwd_event['id']) && $image['image'] == "") {
477
+ $image_class = "ecwd-no-image";
478
+ }
479
+ echo '<div class="upcoming_events_item-img ' . $image_class . '">';
480
+ if (get_the_post_thumbnail($ecwd_event['id'])) {
481
+ echo get_the_post_thumbnail($ecwd_event['id'], 'thumb');
482
+ } elseif ($image['image'] != null) {
483
+ echo '<img src="' . $image['image'] . '" />';
484
+ $ecwd_event['post']->post_content = $image['content'];
485
+ }
486
+ echo '</div>';
487
+ ?>
488
+ <div class="event-title" itemprop="name">
489
+ <a href="<?php echo $ecwd_event['permalink'] ?>"><?php echo $ecwd_event['title'] ?></a>
490
+ </div>
491
+ <div class="event-date" itemprop="startDate"
492
+ content="<?php echo date('Y-m-d', strtotime($ecwd_event['from'])) . 'T' . date('H:i', strtotime($ecwd_event['starttime'])) ?>">
493
+
494
+ <?php
495
+ if (isset($ecwd_event['all_day_event']) && $ecwd_event['all_day_event'] == 1) {
496
+ echo date($date_format, strtotime($ecwd_event['from']));
497
+ if ($ecwd_event['to'] && date($date_format, strtotime($ecwd_event['from'])) !== date($date_format, strtotime($ecwd_event['to']))) {
498
+ echo ' - ' . date($date_format, strtotime($ecwd_event['to']));
499
+ }
500
+ echo ' ' . __('All day', 'ecwd');
501
+ } else {
502
+
503
+ echo date($date_format, strtotime($ecwd_event['from'])) . ' ' . date($time_format, strtotime($ecwd_event['starttime']));
504
+
505
+ if ($ecwd_event['to']) {
506
+ echo ' - ' . date($date_format, strtotime($ecwd_event['to'])) . ' ' . date($time_format, strtotime($ecwd_event['endtime']));
507
+ }
508
+ }
509
+ ?>
510
+ </div>
511
+
512
+
513
+ <div
514
+ class="upcoming_events_item-content"><?php echo( $ecwd_event['post']->post_content ? $ecwd_event['post']->post_content : 'No additional details for this event.' ); ?> </div>
515
+ </div>
516
+ </li>
517
+ <?php
518
+ }
519
+ ?>
520
+ </ul>
521
+ </div>
522
+ </div>
523
+
524
+ <?php } ?>
525
+ <?php } ?>
526
+
527
+ </div>
528
+ <!-- #Related Events-->
529
+ </div> <!-- #post-x -->
530
+ <?php if (comments_open() && $post->comment_status == 'open') { ?>
531
+ <div class="ecwd-comments">
532
+
533
+ <?php echo comments_template(); ?>
534
+ </div>
535
+ <?php } ?>
536
+ <?php endwhile; ?>
 
 
 
537
 
538
  </div>
539