Пример #1
0
 if (isset($limit) && $i >= $limit) {
     continue;
 }
 $teams = get_post_meta($event->ID, 'sp_team');
 $video = get_post_meta($event->ID, 'sp_video', true);
 $main_results = sp_get_main_results($event);
 $teams_output = '';
 $teams_array = array();
 $team_logos = array();
 if ($teams) {
     foreach ($teams as $team) {
         $name = get_the_title($team);
         if ($name) {
             if ($show_team_logo) {
                 $name = sp_get_logo($team, 'mini') . ' ' . $name;
                 $team_logos[] = sp_get_logo($team, 'mini');
             }
             if ($link_teams) {
                 $team_output = '<a href="' . get_post_permalink($team) . '">' . $name . '</a>';
             } else {
                 $team_output = $name;
             }
             $team_result = sp_array_value($main_results, $team, null);
             if ($team_result != null) {
                 if ($usecolumns != null && !in_array('time', $usecolumns)) {
                     $team_output .= ' (' . $team_result . ')';
                 }
             }
             $teams_array[] = $team_output;
             $teams_output .= $team_output . '<br>';
         }
function sp_the_logo($post = 0, $size = 'icon', $attr = array())
{
    echo sp_get_logo($post, $size, $attr);
}
 if (sp_array_value($cell, 'type', null) === 'event') {
     echo '<td rowspan="' . sp_array_value($cell, 'rows', 1) . '" class="sp-event' . ($round === 0 ? ' sp-first-round' : '') . ($round === $rounds - 1 ? ' sp-last-round' : '') . ' ' . sp_array_value($cell, 'class', '') . '">';
     if ($event) {
         $event_name = '<span class="sp-result">' . implode('</span>-<span class="sp-result">', sp_get_main_results_or_time($event)) . '</span>';
         if ($show_logos) {
             $teams = sp_get_teams($event);
             if ($teams && sizeof($teams) >= 2) {
                 $home = reset($teams);
                 if (sp_has_logo($home)) {
                     $event_name = sp_get_logo($home, 'mini') . ' ' . $event_name;
                 } elseif (sp_get_abbreviation($home)) {
                     $event_name = sp_get_abbreviation($home) . ' ' . $event_name;
                 }
                 $away = end($teams);
                 if (sp_has_logo($away)) {
                     $event_name .= ' ' . sp_get_logo($away, 'mini');
                 } elseif (sp_get_abbreviation($away)) {
                     $event_name .= ' ' . sp_get_abbreviation($away);
                 }
             }
         }
         $event_date = '<div class="sp-event-date">' . get_the_date(get_option('date_format'), $event) . '</div>';
         $event_name = $event_date . '<div class="sp-event-main">' . $event_name . '</div>';
         if ($show_venue) {
             $venues = get_the_terms($event, 'sp_venue');
             if ($venues) {
                 $venue = array_shift($venues);
                 $event_name .= '<div class="sp-event-venue">' . $venue->name . '</div>';
             }
         }
         $video = get_post_meta($event, 'sp_video', true);