Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- get_template_part('templates/page', 'header');
- $queried_object = get_queried_object();
- $term_id = $queried_object->term_id;
- $EM_Tag = em_get_tag($term_id);
- $home_url = home_url();
- if ( current_user_can('manage_options') ) {
- echo "\n<!-- taxonomy-event-tags-idf.php -->\n\n";
- }
- if (class_exists('EM_Events')) {
- $format_header = '<table class="table table--events">
- <thead>
- <tr>
- <th class="event-date">Start - End</th>
- <th class="event-name">Event</th>
- <th class="event-country">Country</th>
- <th class="event-type">Type</th>
- </tr>
- </thead>
- <tbody>';
- $format = '<tr>
- <td class="event-date">{not_long}#d/#m/#y{/not_long}{is_long}#d/#m #@_{ \- d/m/y} {/is_long}</td>
- <td class="event-name">#_ADMINEDIT #_EVENTLINK</td>
- <td class="event-country">{has_location}#_COUNTRYFLAG #_LOCATIONCOUNTRY{/has_location}</td>
- <td class="idf-type">{has_tag_idf-wc}<a href="'. $home_url .'/events/tags/idf-wc" title="Click to see all IDF World Cup events">WC</a>{/has_tag_idf-wc}{has_tag_idf-wqs}<a href="'. $home_url .'/events/tags/idf-wqs" title="Click to see all IDF World Qualifier events">WQS</a>{/has_tag_idf-wqs}</td>
- </tr>';
- echo "<div class=\"tag-header\"><img src=\"". get_stylesheet_directory_uri() ."/assets/images/logo-". $EM_Tag->slug .".png\" alt=\"All ". $EM_Tag->slug ." races\" /><h2 class=\"tag-description\">" . $EM_Tag->description . "</h2></div>";
- $scope = 'future';
- $order = 'ASC';
- echo '<div class="entry-content">';
- if ( empty($_REQUEST['pno']) ) {
- $coming_args = array(
- 'order' => $order,
- 'limit' => 30,
- 'pagination' => 1,
- 'scope' => $scope,
- 'tag' => $term_id,
- 'format_header' => $format_header,
- 'format' => $format,
- 'format_footer' => '</tbody></table>',
- );
- $coming_events = em_get_events( $coming_args );
- if ( strlen($coming_events) > 125 ) {
- echo '<h2>Coming</h2>';
- echo $coming_events;
- } else {
- echo '<p>We have no coming events for this federation.</p>';
- }
- }
- $past_args = array(
- 'order' => 'DESC',
- 'limit' => 30,
- 'mode' => 'yearly',
- 'pagination' => 1,
- 'scope' => 'past',
- 'tag' => $term_id,
- 'format_header' => $format_header,
- 'format' => $format,
- 'format_footer' => '</tbody></table>',
- );
- // $past_events = em_get_events( $past_args );
- $past_events = EM_Events::output_grouped($past_args);
- if ( strlen($past_events) > 125 ) {
- echo '<h2>Past</h2>';
- echo $past_events;
- } else {
- echo '<p>We have no past events for this federation.</p>';
- }
- echo '</div>';
- } else {
- echo "<p>Our events list is offline shortly due to maintenance.</p>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement