Version Description
Added: Show the repeat rate in event page option
Download this release
Release Info
| Developer | webdorado |
| Plugin | |
| Version | 1.0.16 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.15 to 1.0.16
- ecwd.php +1 -1
- ecwd_admin_class.php +1 -1
- ecwd_class.php +1 -1
- includes/ecwd-functions.php +2 -2
- includes/register-settings.php +6 -0
- readme.txt +4 -1
- views/single-event.php +479 -467
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.
|
| 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.
|
| 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.
|
| 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 |
-
|
| 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.
|
| 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 (
|
| 6 |
-
|
| 7 |
}
|
| 8 |
|
| 9 |
global $post;
|
|
@@ -12,516 +12,528 @@ global $ecwd_options;
|
|
| 12 |
global $wp_query;
|
| 13 |
|
| 14 |
$post_id = $post->ID;
|
| 15 |
-
$meta
|
| 16 |
|
| 17 |
-
$date_format
|
| 18 |
-
$time_format
|
| 19 |
$ecwd_social_icons = false;
|
| 20 |
-
if (
|
| 21 |
-
|
| 22 |
}
|
| 23 |
-
if (
|
| 24 |
-
|
| 25 |
}
|
| 26 |
-
$time_format .= (isset(
|
| 27 |
-
if(isset($ecwd_options['time_type']) && $ecwd_options['time_type'] !=''){
|
| 28 |
$time_format = str_replace('H', 'h', $time_format);
|
| 29 |
}
|
| 30 |
|
| 31 |
-
if (
|
| 32 |
-
|
| 33 |
}
|
| 34 |
// Load up all post meta data
|
| 35 |
|
| 36 |
|
| 37 |
-
$ecwd_event
|
| 38 |
-
$ecwd_event_metas
|
| 39 |
-
$ecwd_event_date_from
|
| 40 |
-
$ecwd_event_date_to
|
| 41 |
-
$ecwd_event_metas[
|
| 42 |
-
if (
|
| 43 |
-
|
| 44 |
}
|
| 45 |
-
if (
|
| 46 |
-
|
| 47 |
}
|
| 48 |
-
if (
|
| 49 |
-
|
| 50 |
}
|
| 51 |
-
if (
|
| 52 |
-
|
| 53 |
}
|
| 54 |
|
| 55 |
$permalink = get_the_permalink($ecwd_event->ID);
|
| 56 |
-
$this_event = $events[
|
| 57 |
-
$d
|
| 58 |
-
if (
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
}
|
| 69 |
|
| 70 |
|
| 71 |
-
$ecwd_event_location = isset($ecwd_event_metas[
|
| 72 |
-
$ecwd_event_latlong
|
| 73 |
-
$ecwd_event_zoom
|
| 74 |
-
$ecwd_event_show_map = isset($ecwd_event_metas[
|
| 75 |
-
if (
|
| 76 |
-
|
| 77 |
}
|
| 78 |
-
if (
|
| 79 |
-
|
| 80 |
}
|
| 81 |
|
| 82 |
-
$ecwd_event_organizers = isset($ecwd_event_metas[
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
-
$ecwd_event_url
|
| 87 |
-
$ecwd_event_video
|
| 88 |
-
$ecwd_all_day_event = isset($ecwd_event_metas[
|
| 89 |
-
$venue
|
| 90 |
-
$venue_permalink
|
| 91 |
-
$venue_post_id
|
| 92 |
-
if (
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
}
|
| 99 |
|
| 100 |
$organizers = array();
|
| 101 |
|
| 102 |
-
if (
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
}
|
| 107 |
$featured_image = '';
|
| 108 |
-
if (
|
| 109 |
-
|
| 110 |
}
|
| 111 |
|
| 112 |
$category_and_tags = false;
|
| 113 |
|
| 114 |
-
if (
|
| 115 |
-
|
| 116 |
}
|
| 117 |
-
$args
|
| 118 |
-
$event_tags
|
| 119 |
-
$event_categories = wp_get_post_terms(
|
| 120 |
|
| 121 |
get_header();
|
| 122 |
?>
|
| 123 |
<div id="ecwd-events-content" class="ecwd-events-single hentry">
|
| 124 |
|
| 125 |
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
</div>';
|
| 258 |
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 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&byline=0&portrait=0&badge=0&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 |
|
