/** * Set up the self::week_days array * * @return void * @see $this->setup_view() */ private function setup_days() { global $wp_query; $week_days = array(); $day = $wp_query->get('start_date'); // Array used for calculation of php strtotime relative dates $weekday_array = array(0 => 'Sunday', 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday'); // build an array with the "day" elements, // each "day" is an array that contains the date and the associated all day / hourly events // $day_number corresponds to the day of the week in $weekday_array foreach (self::$day_range as $i => $day_number) { // figure out the $date that we're currently looking at if ($day_number >= self::$day_range[0]) { // usually we can just get the date for the next day $date = date('Y-m-d', strtotime($day . "+{$i} days")); } else { // fringe case - someone starts their week in the middle of the week // in this case, the "day number" will be less than the first day of the week once the week has looped around // so we use a relative strtotime() calc $date = date('Y-m-d', strtotime("Next {$weekday_array[$day_number]}", strtotime($day))); } $hourly_events = array(); $all_day_events = array(); if ($wp_query->have_posts()) { // loop through all the wordpress posts and sort them into all day vs hourly for the current $date foreach ($wp_query->posts as $j => $event) { if (tribe_event_is_on_date($date, $event)) { $event->days_between = tribe_get_days_between($event->EventStartDate, $event->EventEndDate, true); if (tribe_event_is_all_day($event)) { $all_day_events[] = $event; } else { // if the event starts after the end of the hour range we're displaying, or ends before the start, skip it $start_hour_today = $date . ' ' . tribe_events_week_get_hours('first-hour'); $end_hour_today = tribe_end_of_day($date, 'Y-m-d ') . tribe_events_week_get_hours('last-hour'); if (tribe_get_start_time($event, 'U') > strtotime($end_hour_today) || tribe_get_end_time($event, 'U') < strtotime($start_hour_today)) { continue; } $hourly_events[] = $event; } } } } $display_format = apply_filters('tribe_events_pro_week_header_date_format', tribe_get_date_option('weekDayFormat', 'D jS')); $formatted_date = date_i18n($display_format, strtotime($date)); $timestamp_date = strtotime($date); $timestamp_today = strtotime(current_time('Y-m-d')); // create the "day" element $week_days[] = array('date' => $date, 'day_number' => $day_number, 'formatted_date' => $formatted_date, 'is_today' => $timestamp_date == $timestamp_today ? true : false, 'is_past' => $timestamp_date < $timestamp_today ? true : false, 'is_future' => $timestamp_date > $timestamp_today ? true : false, 'hourly_events' => $hourly_events, 'all_day_events' => $all_day_events, 'has_events' => $hourly_events || $all_day_events); } self::$week_days = $week_days; }
<span class="bg-image-mask"></span> <div class="item-content"> <div class="date"> <span class="num"><?php echo tribe_get_start_date( $event, false, 'd' ); ?></span> <?php echo tribe_get_start_date( $event, false, 'F' ); ?> </div> <?php $term_color = get_term_meta( array_pop( tribe_get_event_cat_ids( $event ) ) , '_events_category_color', true ); $term_color = implode(',', sscanf($term_color, "#%02x%02x%02x")) ; ?> <div class="title-wrap" style="background-color: rgba(<?php echo $term_color; ?>, .7);" > <strong> <?php if( tribe_event_is_all_day($event) ): ?> All Day <?php else: ?> <?php printf('%s - %s', tribe_get_start_time( $event, 'ga' ), tribe_get_end_time( $event, 'ga' ) ); ?> <?php endif; ?> </strong> <h3 class="item-title"><?php echo get_the_title( $event ); ?></h3> </div> </div> </a> </li> <?php endforeach; ?> </ul>
<h6 style="color:#909090 !important; margin:0 0 10px 0; font-family: 'Helvetica Neue', Helvetica, sans-serif; text-transform:uppercase; font-size:13px; font-weight:700 !important; margin-top:20px!important;"><?php esc_html_e('Date', 'event-tickets'); ?> </h6> <span style="color:#0a0a0e !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:15px;"><?php echo tribe_get_start_date($event_id, false, 'l, F j'); ?> </span> </td> <td class="class-details" valign="top" align="left" width="150" style="padding: 0; width:150px; margin:0 !important; border-top:1px solid #ddd !important;"> <h6 style="color:#909090 !important; margin:0 0 10px 0; font-family: 'Helvetica Neue', Helvetica, sans-serif; text-transform:uppercase; font-size:13px; font-weight:700 !important; margin-top:20px!important;"><?php esc_html_e('Time', 'event-tickets'); ?> </h6> <span style="color:#0a0a0e !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:15px;"><?php echo tribe_get_start_time($event_id, 'g:i A'); ?> - <?php echo tribe_get_end_time($event_id, 'g:i A'); ?> </span> </td> <td class="class-details" valign="top" align="left" width="150" style="padding: 0 !important; width:150px; margin:0 !important; border-top:1px solid #ddd !important;"> <h6 style="color:#909090 !important; margin:0 0 10px 0; font-family: 'Helvetica Neue', Helvetica, sans-serif; text-transform:uppercase; font-size:13px; font-weight:700 !important; margin-top:20px!important;"><?php esc_html_e('Student Cost', 'event-tickets'); ?> </h6> <span style="color:#0a0a0e !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:15px;"><?php echo tribe_get_cost($event_id, true); ?> </span>
/** * Adds start time to event titles in Month view */ function tribe_add_start_time_to_event_title($post_title, $post_id) { if (!tribe_is_event($post_id)) { return $post_title; } // Checks if it is the month view, modify this line to apply to more views //if ( !tribe_is_month() ) return $post_title; //--- if (tribe_is_past() || tribe_is_upcoming() && !is_tax()) { $event_start_time = tribe_get_start_time($post_id); if (!empty($event_start_time)) { // $post_title = $post_title . ' | ' . $event_start_time; } return $post_title; } else { return $post_title; } }
die('-1'); } global $post; /** * We build and gather information specific to the individual event prior to * the tribe_events_template_data() call to reduce the opportunities for 3rd * party code to call wp_reset_postdata() or similar, which can result in the * $post global referencing something other than the event we're interested * in. */ $day = tribe_events_get_current_month_day(); $event_id = "{$post->ID}-{$day['daynum']}"; $link = tribe_get_event_link($post); $title = get_the_title($post); $start_time = date('g:i a', strtotime($post->EventStartDate)); $start_time = tribe_get_start_time($post->ID); /** * How to Use the Javascript Templating System in this View * ======================================================== * * Month view (and week in events pro) has implemented javascript templating to power its rich tooltips and mobile views * as of Events Version 3.3. This is a guide on how to modify, extend and use this functionality. * * 1) Overview * * As of version 3.3 our tooltips and mobile views use a custom javascript templating solution. * * How it works: event data for each event - such as title, start and end time, excerpt etc - is stored on a data * attribute tagged "data-tribejson" in the markup. This particular json works with simple single level key value pairs. * The key is used in the javascript template to call our value output. *
<div class="col-md-8 event-details"> <a href="<?php echo get_permalink($ID); ?> "><h4 class="event-title"><?php echo get_the_title($ID); ?> </h4></a> <span class="event-detail"><?php echo tribe_get_venue($event->ID); ?> </span> <span class="event-detail"><?php echo tribe_get_start_time($event->ID); ?> </span> </div> </div> <?php } } ?> <a class="more-info" href="<?php echo site_url(); ?> /events">See All Events</a>
echo $has_venue_address; ?> "> <!-- Schedule & Recurrence Details --> <div class="updated published time-details"> <?php if (get_field('dias_do_curso')) { echo '<p clas="date_view">' . get_field('dias_do_curso') . '</p>'; } else { echo tribe_events_event_schedule_details(); } ?> <!-- <?php echo tribe_get_start_time(); ?> --> </div> <?php if ($venue_details) { ?> <!-- Venue Display Info --> <div class="tribe-events-venue-details"> <?php echo implode(', ', $venue_details); ?> </div> <!-- .tribe-events-venue-details --> <?php }