public final function generate_attendees_PDF($tickets_list) { $this->load_pdf_libraries(); $pdf = new FPDF(); $ecp = TribeEvents::instance(); $pdf->AddFont('OpenSans', '', 'opensans.php'); $pdf->AddFont('SteelFish', '', 'steelfish.php'); $pdf->SetTitle('EventTicket'); $pdf->SetAuthor('The Events Calendar'); $pdf->SetCreator('The Events Calendar'); $defaults = array('event_id' => 0, 'ticket_name' => '', 'holder_name' => '', 'order_id' => '', 'ticket_id' => '', 'security_code' => ''); foreach ($tickets_list as $ticket) { $ticket = wp_parse_args($ticket, $defaults); $event = get_post($ticket['event_id']); $venue_id = tribe_get_venue_id($event->ID); $venue = !empty($venue_id) ? get_post($venue_id)->post_title : ''; $address = tribe_get_address($event->ID); $zip = tribe_get_zip($event->ID); $state = tribe_get_stateprovince($event->ID); $city = tribe_get_city($event->ID); $pdf->AddPage(); $pdf->SetDrawColor(28, 166, 205); $pdf->SetFillColor(28, 166, 205); $pdf->Rect(15, 10, 180, 34, 'F'); $pdf->SetTextColor(255); $pdf->SetFont('OpenSans', '', 10); $pdf->SetXY(30, 15); $pdf->Write(5, __('EVENT NAME:', 'tribe-events-calendar')); $pdf->SetXY(30, 28); $pdf->SetFont('SteelFish', '', 53); $title = strtoupper(utf8_decode($event->post_title)); $size = 53; while ($pdf->GetStringWidth($title) > 151) { $size--; $pdf->SetFontSize($size); } $pdf->Write(5, $title); $pdf->SetTextColor(41); $pdf->SetFont('OpenSans', '', 10); $pdf->SetXY(30, 50); $pdf->Write(5, __('TICKET HOLDER:', 'tribe-events-calendar')); $pdf->SetXY(104, 50); $pdf->Write(5, __('LOCATION:', 'tribe-events-calendar')); $pdf->SetFont('SteelFish', '', 30); $pdf->SetXY(30, 59); $holder = strtoupper(utf8_decode($ticket['holder_name'])); $size = 30; while ($pdf->GetStringWidth($holder) > 70) { $size--; $pdf->SetFontSize($size); } $pdf->Write(5, $holder); $pdf->SetXY(104, 59); $venue = strtoupper(utf8_decode($venue)); $size = 30; while ($pdf->GetStringWidth($venue) > 70) { $size--; $pdf->SetFontSize($size); } $pdf->Write(5, $venue); $pdf->SetXY(104, 71); $address = strtoupper(utf8_decode($address)); $size = 30; while ($pdf->GetStringWidth($address) > 70) { $size--; $pdf->SetFontSize($size); } $pdf->Write(5, $address); $pdf->SetXY(104, 83); $address2 = array($city, $state, $zip); $address2 = array_filter($address2); $address2 = join(', ', $address2); $address2 = strtoupper(utf8_decode($address2)); $size = 30; while ($pdf->GetStringWidth($address2) > 70) { $size--; $pdf->SetFontSize($size); } $pdf->Write(5, $address2); $pdf->Line(15, 97, 195, 97); $pdf->SetFont('OpenSans', '', 10); $pdf->SetXY(30, 105); $pdf->Write(5, __('ORDER:', 'tribe-events-calendar')); $pdf->SetXY(80, 105); $pdf->Write(5, __('TICKET:', 'tribe-events-calendar')); $pdf->SetXY(120, 105); $pdf->Write(5, __('VERIFICATION:', 'tribe-events-calendar')); $pdf->SetFont('SteelFish', '', 53); $pdf->SetXY(30, 118); $pdf->Write(5, $ticket['order_id']); $pdf->SetXY(80, 118); $pdf->Write(5, $ticket['ticket_id']); $pdf->SetXY(120, 118); $pdf->Write(5, $ticket['security_code']); $pdf->Rect(15, 135, 180, 15, 'F'); $pdf->SetTextColor(255); $pdf->SetFont('OpenSans', '', 10); $pdf->SetXY(30, 140); $pdf->Write(5, get_bloginfo('name')); $pdf->SetXY(104, 140); $pdf->Write(5, get_home_url()); } $upload_path = wp_upload_dir(); $upload_url = $upload_path['url']; $upload_path = $upload_path['path']; $filename = wp_unique_filename($upload_path, sanitize_file_name(md5(time())) . '.pdf'); $upload_path = trailingslashit($upload_path) . $filename; $upload_url = trailingslashit($upload_url) . $filename; $pdf->Output($upload_path, 'F'); return array($upload_path, $upload_url); }
echo tribe_get_event_link(); ?> "><?php the_post_thumbnail('homepage-thumb', array('class' => "img-responsive")); ?> </a> <?php } ?> <?php $sep = ""; if (tribe_get_city() && tribe_get_stateprovince()) { $sep = ", "; } ?> <h2><a href="<?php echo tribe_get_event_link(); ?> "><?php the_title(); ?> </a></h2> <?php echo tribe_events_event_schedule_details($event_id, '<span class="date small">', '</span>'); ?> <h3><?php echo tribe_get_city() . $sep . tribe_get_stateprovince(); ?> </h3> <?php the_excerpt();
/** * @deprecated */ function sp_get_stateprovince($postId = null) { _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_stateprovince()'); return tribe_get_stateprovince($postId); }
echo hatch_tribe_event_featured_image(); ?> ');"></div> <h1 class="hatching-title"><?php the_title(); ?> </h1> <span class="hatching-date"><?php echo tribe_get_start_date(); ?> </span> <span class="hatching-location"><?php echo tribe_get_city(); ?> , <?php echo tribe_get_stateprovince(); ?> </span> </div> </a> <?php } ?> </div> </section> <!-- Partners --> <?php get_template_part('includes/partners-block'); ?>
/** * Process event calendar tags */ private function process_the_events_calendar_tags($content) { if (!function_exists('tribe_get_start_date')) { return $content; } // The Events Calendar $event_date_format = get_option('date_format'); $event_time_format = get_option('time_format'); $event_all_day = get_post_meta(get_the_ID(), '_EventAllDay', true); $event_start_date = tribe_get_start_date(get_the_ID(), false, $event_date_format); $event_start_time = tribe_get_start_date(get_the_ID(), false, $event_time_format); $event_end_date = tribe_get_end_date(get_the_ID(), false, $event_date_format); $event_end_time = tribe_get_end_date(get_the_ID(), false, $event_time_format); $separator = apply_filters("metaslider_tribe_separator", " - "); if ($event_all_day) { if ($event_start_date == $event_end_date) { $event_string = $event_start_date; } else { $event_string = $event_start_date . $separator . $event_end_date; } } else { if ($event_start_date == $event_end_date) { $event_string = $event_start_date . " " . $event_start_time . $separator . $event_end_time; } else { $event_string = $event_start_date . $separator . $event_end_date; } } $content = str_replace("{event_date}", $event_string, $content); $content = str_replace("{event_start_date}", $event_start_date, $content); $content = str_replace("{event_start_time}", $event_start_time, $content); $content = str_replace("{event_end_time}", $event_end_time, $content); $content = str_replace("{event_end_date}", $event_end_date, $content); $content = str_replace("{event_address}", tribe_get_address(get_the_ID()), $content); $content = str_replace("{event_city}", tribe_get_city(get_the_ID()), $content); $content = str_replace("{event_country}", tribe_get_country(get_the_ID()), $content); $content = str_replace("{event_full_address}", tribe_get_full_address(get_the_ID()), $content); $content = str_replace("{event_phone}", tribe_get_phone(get_the_ID()), $content); $content = str_replace("{event_province}", tribe_get_province(get_the_ID()), $content); $content = str_replace("{event_region}", tribe_get_region(get_the_ID()), $content); $content = str_replace("{event_state}", tribe_get_state(get_the_ID()), $content); $content = str_replace("{event_stateprovince}", tribe_get_stateprovince(get_the_ID()), $content); $content = str_replace("{event_venue}", tribe_get_venue(get_the_ID()), $content); $content = str_replace("{event_venue_id}", tribe_get_venue_id(get_the_ID()), $content); $content = str_replace("{event_venue_link}", tribe_get_venue_link(get_the_ID(), false), $content); $content = str_replace("{event_zip}", tribe_get_zip(get_the_ID()), $content); return $content; }
/** * Gets the venue name and address on a single line * * @param int $event_id Event ID * @param boolean $link Whether or not to wrap the text in a venue link * * @return string */ function tribe_get_venue_single_line_address($event_id, $link = true) { $venue = null; if (tribe_has_venue($event_id)) { $venue_id = tribe_get_venue_id($event_id); $venue_name = tribe_get_venue($event_id); $venue_url = tribe_get_venue_link($event_id, false); $venue_address = array('city' => tribe_get_city($event_id), 'stateprovince' => tribe_get_stateprovince($event_id), 'zip' => tribe_get_zip($event_id)); /** * Filters the parts of a venue address * * @var array Array of address parts * @var int Event ID */ $venue_address = apply_filters('tribe_events_venue_single_line_address_parts', $venue_address, $event_id); // get rid of blank elements $venue_address = array_filter($venue_address); $venue = $venue_name; $separator = _x(', ', 'Address separator', 'the-events-calendar'); if ($venue_address) { $venue .= $separator . implode($separator, $venue_address); } if ($link && $venue_url) { $attr_title = the_title_attribute(array('post' => $venue_id, 'echo' => false)); $venue = '<a href="' . esc_url($venue_url) . '" title="' . $attr_title . '">' . $venue . '</a>'; } } /** * Filters the venue single-line address * * @var string Venue address line * @var int Event ID * @var boolean Whether or not the venue should be linked */ return apply_filters('tribe_events_get_venue_single_line_address', $venue, $event_id, $link); }
the_title(); ?> " rel="bookmark"> <?php the_title(); ?> </a> </h2> <div class="date"><?php echo tribe_get_start_date() . " — " . tribe_get_end_date(); ?> </div> <h3><?php echo tribe_get_city() . ", " . tribe_get_stateprovince(); ?> </h3> <?php do_action('tribe_events_after_the_event_title'); ?> <?php the_excerpt(); ?> <a href="<?php echo tribe_get_event_link(); ?> " class="btn btn-info btn-sm" rel="bookmark"><?php _e('Find out more', 'tribe-events-calendar'); ?>