Esempio n. 1
0
    if ($wp_event_url) {
        ?>
<a href="<?php 
        echo esc_url($wp_event_url);
        ?>
"><?php 
    }
    ?>
					<?php 
    echo esc_html($event->name->text);
    ?>
					<?php 
    if ($wp_event_url) {
        ?>
</a><?php 
    }
    ?>
				</h3>
                <p><?php 
    echo eventbrite_venue_get_event_excerpt($event->description->text, 20);
    ?>
</p>
            </div>
        </div>
        <?php 
    $count++;
}
?>
    </div>
</div>
Esempio n. 2
0
/**
 * Builds the calendar control for the specified month and year
 *
 * @param int $month numeric value of the month
 * @param int $year year
 * @return type
 */
function eventbrite_venue_get_calendar_of_events($month, $year)
{
    $month_events = eventbrite_venue_get_monthly_events($month, $year);
    $calendar = Calendar::factory($month, $year);
    $calendar->standard('today')->standard('prev-next');
    foreach ($month_events as $month_event) {
        $start_date = new DateTime($month_event->start->local);
        $end_date = new DateTime($month_event->end->local);
        $start_time = $start_date->format('g:ia');
        $end_time = $end_date->format('g:ia');
        $cta_text = get_eventbrite_setting('call-to-action');
        // if set to the 'Buy Tickets' option only use 'Buy' to preserve space in flyout
        $cta_text = 'Buy Tickets' === $cta_text ? 'Buy' : $cta_text;
        $eb_event_url = eventbrite_venue_get_eb_event_url($month_event, 'wpcalendar');
        $wp_event_url = eventbrite_venue_get_wp_event_url($month_event);
        $event_popover_url = $eb_event_url;
        if ($wp_event_url) {
            $event_popover_url = $wp_event_url;
        }
        $format_string = '%1$s - %2$s<a href="%3$s" data-toggle="popover"
			data-content="<a href=\'%8$s\' class=\'pull-right btn\'>%9$s</a><p><span>%1$s-%2$s</span>%5$s</p><p>%6$s</p>"
			data-original-title="%7$s">%4$s</a>';
        $output = sprintf($format_string, esc_html($start_time), esc_html($end_time), esc_url($event_popover_url), esc_html($month_event->name->text), esc_html(eventbrite_venue_get_event_ticket_price_string($month_event->ticket_classes)), esc_html(eventbrite_venue_get_event_excerpt($month_event->description->text, 20)), esc_html($month_event->name->text), esc_url($eb_event_url), __(esc_html($cta_text), 'eventbrite-venue'));
        $event = $calendar->event()->condition('timestamp', $start_date->format('U'))->title(esc_html($month_event->name->text))->output($output);
        $calendar->attach($event);
        $diff = date_diff($start_date, $end_date);
        $days_diff = (int) $diff->format('%a');
        if ($days_diff) {
            $start_day = (int) $start_date->format('Ymd');
            $event_title = sprintf(_x('%s - cont.', 'calendar', 'eventbrite-venue'), esc_html($month_event->name->text));
            $output = sprintf($format_string, esc_html($start_time), esc_html($end_time), esc_url($event_popover_url), esc_html($event_title), esc_html(eventbrite_venue_get_event_ticket_price_string($month_event->ticket_classes)), esc_html(eventbrite_venue_get_event_excerpt($month_event->description->text, 20)), esc_html($month_event->name->text), esc_url(eventbrite_venue_get_eb_event_url($month_event, 'wpcalendar')), __(esc_html($cta_text), 'eventbrite-venue'));
            $counter = 0;
            while ($counter < $days_diff) {
                $counter += 1;
                $event = $calendar->event()->condition('timestamp', strtotime($start_day + $counter))->title(esc_html($month_event->name->text))->output($output);
                $calendar->attach($event);
            }
        }
    }
    return $calendar;
}
Esempio n. 3
0
</a><?php 
        }
        ?>
					</h3>
					<p class="date">
						<span class="orange upper"><?php 
        echo esc_html(eventbrite_venue_get_event_date($event->start->local, $event->start->timezone, 'j F Y'));
        ?>
</span>
						| <span class="orange upper"><?php 
        echo esc_html(eventbrite_venue_get_event_ticket_price_string($event->ticket_classes));
        ?>
</span>
					</p>
					<p><?php 
        echo esc_html(eventbrite_venue_get_event_excerpt($event->description->text));
        ?>
</p>

					<?php 
        if ($wp_event_url) {
            ?>
						<p class="text-right"><a href="<?php 
            echo esc_url($wp_event_url);
            ?>
"><?php 
            _e('Read More', 'eventbrite-venue');
            ?>
</a></p>
					<?php 
        }