/**
  * Output the player list shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     if (!isset($atts['id']) && isset($atts[0]) && is_numeric($atts[0])) {
         $atts['id'] = $atts[0];
     }
     sp_get_template('player-list.php', $atts);
 }
 function widget($args, $instance)
 {
     extract($args);
     $id = empty($instance['id']) ? 0 : $instance['id'];
     if ($id <= 0) {
         return;
     }
     if ('yes' == get_option('sportspress_widget_unique', 'no') && get_the_ID() === $id) {
         $format = get_post_meta($id, 'sp_format', true);
         if ('gallery' == $format) {
             return;
         }
     }
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $caption = empty($instance['caption']) ? null : $instance['caption'];
     $number = empty($instance['number']) ? null : $instance['number'];
     $columns = empty($instance['columns']) ? null : $instance['columns'];
     $orderby = empty($instance['orderby']) ? 'default' : $instance['orderby'];
     $order = empty($instance['order']) ? 'ASC' : $instance['order'];
     $show_all_players_link = empty($instance['show_all_players_link']) ? false : $instance['show_all_players_link'];
     do_action('sportspress_before_widget', $args, $instance, 'player-gallery');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('sportspress_before_widget_template', $args, $instance, 'player-gallery');
     sp_get_template('player-gallery.php', array('id' => $id, 'title' => $caption, 'number' => $number, 'columns' => $columns, 'orderby' => $orderby, 'order' => $order, 'grouping' => 0, 'show_all_players_link' => $show_all_players_link));
     // Action to hook into
     do_action('sportspress_after_widget_template', $args, $instance, 'player-gallery');
     echo $after_widget;
     do_action('sportspress_after_widget', $args, $instance, 'player-gallery');
 }
 function widget($args, $instance)
 {
     extract($args);
     $id = empty($instance['id']) ? null : $instance['id'];
     if ($id && 'yes' == get_option('sportspress_widget_unique', 'no') && get_the_ID() === $id) {
         $format = get_post_meta($id, 'sp_format', true);
         if ('blocks' == $format) {
             return;
         }
     }
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $caption = empty($instance['caption']) ? null : $instance['caption'];
     $status = empty($instance['status']) ? 'default' : $instance['status'];
     $date = empty($instance['date']) ? 'default' : $instance['date'];
     $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
     $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
     $day = empty($instance['day']) ? 'default' : $instance['day'];
     $number = empty($instance['number']) ? null : $instance['number'];
     $order = empty($instance['order']) ? 'default' : $instance['order'];
     $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link'];
     do_action('sportspress_before_widget', $args, $instance, 'event-blocks');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('sportspress_before_widget_template', $args, $instance, 'event-blocks');
     sp_get_template('event-blocks.php', array('id' => $id, 'title' => $caption, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'day' => $day, 'number' => $number, 'order' => $order, 'show_all_events_link' => $show_all_events_link));
     // Action to hook into
     do_action('sportspress_after_widget_template', $args, $instance, 'event-blocks');
     echo $after_widget;
     do_action('sportspress_after_widget', $args, $instance, 'event-blocks');
 }
 /**
  * Output the league table shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     if (!isset($atts['id']) && isset($atts[0]) && is_numeric($atts[0])) {
         $atts['id'] = $atts[0];
     }
     sp_get_template('league-table.php', $atts);
 }
 function widget($args, $instance)
 {
     extract($args);
     $id = empty($instance['id']) ? 0 : $instance['id'];
     if ($id <= 0) {
         return;
     }
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $caption = empty($instance['caption']) ? null : $instance['caption'];
     $number = empty($instance['number']) ? null : $instance['number'];
     $columns = empty($instance['columns']) ? array() : $instance['columns'];
     $show_team_logo = empty($instance['show_team_logo']) ? false : $instance['show_team_logo'];
     $show_full_table_link = empty($instance['show_full_table_link']) ? false : $instance['show_full_table_link'];
     do_action('sportspress_before_widget', $args, $instance, 'league-table');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('sportspress_before_widget_template', $args, $instance, 'league-table');
     sp_get_template('league-table.php', array('id' => $id, 'title' => $caption, 'number' => $number, 'columns' => $columns, 'show_full_table_link' => $show_full_table_link, 'show_team_logo' => $show_team_logo));
     // Action to hook into
     do_action('sportspress_after_widget_template', $args, $instance, 'league-table');
     echo $after_widget;
     do_action('sportspress_after_widget', $args, $instance, 'league-table');
 }
 function widget($args, $instance)
 {
     extract($args);
     $id = empty($instance['id']) ? 0 : $instance['id'];
     if ($id <= 0) {
         return;
     }
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $number = empty($instance['number']) ? null : $instance['number'];
     $columns = empty($instance['columns']) ? null : $instance['columns'];
     $orderby = empty($instance['orderby']) ? 'default' : $instance['orderby'];
     $order = empty($instance['order']) ? 'ASC' : $instance['order'];
     $show_all_players_link = empty($instance['show_all_players_link']) ? false : $instance['show_all_players_link'];
     $show_names_on_hover = empty($instance['show_names_on_hover']) ? false : $instance['show_names_on_hover'];
     do_action('sportspress_before_widget', $args, $instance, 'player-gallery');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('sportspress_before_widget_template', $args, $instance, 'player-gallery');
     sp_get_template('player-gallery.php', array('id' => $id, 'number' => $number, 'columns' => $columns, 'orderby' => $orderby, 'order' => $order, 'grouping' => 0, 'show_all_players_link' => $show_all_players_link, 'show_names_on_hover' => $show_names_on_hover));
     // Action to hook into
     do_action('sportspress_after_widget_template', $args, $instance, 'player-gallery');
     echo $after_widget;
     do_action('sportspress_after_widget', $args, $instance, 'player-gallery');
 }
 /**
  * Output the event blocks shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     if (!isset($atts['id']) && isset($atts[0]) && is_numeric($atts[0])) {
         $atts['id'] = $atts[0];
     }
     sp_get_template('event-blocks.php', $atts);
 }
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $id = empty($instance['id']) ? null : $instance['id'];
     $status = empty($instance['status']) ? 'default' : $instance['status'];
     $date = empty($instance['date']) ? 'default' : $instance['date'];
     $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
     $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
     $number = empty($instance['number']) ? null : $instance['number'];
     $columns = empty($instance['columns']) ? null : $instance['columns'];
     $order = empty($instance['order']) ? 'default' : $instance['order'];
     $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link'];
     do_action('sportspress_before_widget', $args, $instance, 'event-list');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('sportspress_before_widget_template', $args, $instance, 'event-list');
     sp_get_template('event-list.php', array('id' => $id, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'number' => $number, 'columns' => $columns, 'order' => $order, 'show_all_events_link' => $show_all_events_link));
     // Action to hook into
     do_action('sportspress_after_widget_template', $args, $instance, 'event-list');
     echo $after_widget;
     do_action('sportspress_after_widget', $args, $instance, 'event-list');
 }
 /**
  * Output the sponsors shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     ob_start();
     echo '<div class="sportspress">';
     sp_get_template('sponsors.php', $atts, '', SP_SPONSORS_DIR . 'templates/');
     echo '</div>';
     return ob_get_clean();
 }
 /**
  * Output the staff shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     if (!isset($atts['id']) && isset($atts[0]) && is_numeric($atts[0])) {
         $atts['id'] = $atts[0];
     }
     sp_get_template('staff-photo.php', $atts);
     sp_get_template('staff-details.php', $atts);
 }
 public function add_content($content, $template, $append = false)
 {
     ob_start();
     $template = sp_get_template('content-single-tournament.php', array(), 'content-single-tournament', SP_TOURNAMENTS_DIR . 'templates/');
     if ($append) {
         return $content . ob_get_clean();
     } else {
         return ob_get_clean() . $content;
     }
 }
 public function add_content($content, $template, $append = false)
 {
     ob_start();
     $template = sp_get_template('content-single-directory.php', array(), 'content-single-directory', SP_STAFF_DIRECTORIES_DIR . 'templates/');
     if ($append) {
         return $content . ob_get_clean();
     } else {
         return ob_get_clean() . $content;
     }
 }
 /**
  * Output the staff gallery shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     if (!isset($atts['id']) && isset($atts[0]) && is_numeric($atts[0])) {
         $atts['id'] = $atts[0];
     }
     ob_start();
     echo '<div class="prosports">';
     sp_get_template('staff-gallery.php', $atts, 'staff-gallery', SP_STAFF_DIRECTORIES_DIR . 'templates/');
     echo '</div>';
     return ob_get_clean();
 }
 /**
  * Output the tournament_bracket shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     if (!isset($atts['id']) && isset($atts[0]) && is_numeric($atts[0])) {
         $atts['id'] = $atts[0];
     }
     ob_start();
     echo '<div class="sportspress">';
     sp_get_template('tournament-bracket.php', $atts, '', SP_TOURNAMENTS_DIR . 'templates/');
     echo '</div>';
     return ob_get_clean();
 }
Esempio n. 15
0
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? null : $instance['title'], $instance, $this->id_base);
     $id = empty($instance['id']) ? null : $instance['id'];
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('prosports_before_widget_template', $args, $instance, 'staff');
     sp_get_template('staff-photo.php', array('id' => $id));
     sp_get_template('staff-details.php', array('id' => $id));
     // Action to hook into
     do_action('prosports_after_widget_template', $args, $instance, 'staff');
     echo $after_widget;
 }
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $date = empty($instance['date']) ? 'day' : strip_tags($instance['date']);
     do_action('sportspress_before_widget', $args, $instance, 'birthdays');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('sportspress_before_widget_template', $args, $instance, 'birthdays');
     sp_get_template('birthdays.php', array('date' => $date), '', SP_BIRTHDAYS_DIR . 'templates/');
     // Action to hook into
     do_action('sportspress_after_widget_template', $args, $instance, 'birthdays');
     echo $after_widget;
     do_action('sportspress_after_widget', $args, $instance, 'birthdays');
 }
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? null : $instance['title'], $instance, $this->id_base);
     $team = empty($instance['team']) ? null : $instance['team'];
     $id = empty($instance['id']) ? null : $instance['id'];
     $show_venue = empty($instance['show_venue']) ? false : $instance['show_venue'];
     $show_league = empty($instance['show_league']) ? false : $instance['show_league'];
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('prosports_before_widget_template', $args, $instance, 'countdown');
     sp_get_template('countdown.php', array('team' => $team, 'id' => $id, 'show_venue' => $show_venue, 'show_league' => $show_league));
     // Action to hook into
     do_action('prosports_after_widget_template', $args, $instance, 'countdown');
     echo $after_widget;
 }
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $limit = empty($instance['limit']) ? null : $instance['limit'];
     $width = empty($instance['width']) ? null : $instance['width'];
     $height = empty($instance['height']) ? null : $instance['height'];
     $orderby = empty($instance['orderby']) ? 'default' : $instance['orderby'];
     $order = empty($instance['order']) ? 'ASC' : $instance['order'];
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('prosports_before_widget_template', $args, $instance, 'sponsors');
     sp_get_template('sponsors.php', array('limit' => $limit, 'width' => $width, 'height' => $height, 'orderby' => $orderby, 'order' => $order), 'sponsors', SP_SPONSORS_DIR . 'templates/');
     // Action to hook into
     do_action('prosports_after_widget_template', $args, $instance, 'sponsors');
     echo $after_widget;
 }
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? null : $instance['title'], $instance, $this->id_base);
     $id = empty($instance['id']) ? null : $instance['id'];
     do_action('sportspress_before_widget', $args, $instance, 'staff');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('sportspress_before_widget_template', $args, $instance, 'staff');
     echo '<h4 class="sp-table-caption">' . get_the_title($id) . '</h4>';
     sp_get_template('staff-photo.php', array('id' => $id));
     sp_get_template('staff-details.php', array('id' => $id));
     // Action to hook into
     do_action('sportspress_after_widget_template', $args, $instance, 'staff');
     echo $after_widget;
     do_action('sportspress_after_widget', $args, $instance, 'staff');
 }
 function widget($args, $instance)
 {
     extract($args);
     $id = empty($instance['id']) ? 0 : $instance['id'];
     if ($id <= 0) {
         return;
     }
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $number = empty($instance['number']) ? null : $instance['number'];
     $show_all_staff_link = empty($instance['show_all_staff_link']) ? false : $instance['show_all_staff_link'];
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('prosports_before_widget_template', $args, $instance, 'staff-list');
     sp_get_template('staff-list.php', array('id' => $id, 'number' => $number, 'show_all_staff_link' => $show_all_staff_link), 'staff-list', SP_STAFF_DIRECTORIES_DIR . 'templates/');
     // Action to hook into
     do_action('prosports_after_widget_template', $args, $instance, 'staff-list');
     echo $after_widget;
 }
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     $id = empty($instance['id']) ? null : $instance['id'];
     $status = empty($instance['status']) ? 'default' : $instance['status'];
     $date = empty($instance['date']) ? 'default' : $instance['date'];
     $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
     $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
     $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link'];
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // Action to hook into
     do_action('prosports_before_widget_template', $args, $instance, 'event-calendar');
     sp_get_template('event-calendar.php', array('id' => $id, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'caption_tag' => 'caption', 'show_all_events_link' => $show_all_events_link));
     // Action to hook into
     do_action('prosports_after_widget_template', $args, $instance, 'event-calendar');
     echo $after_widget;
 }
Esempio n. 22
0
 * @package 	ProSports_Staff_Directories
 * @version     1.0
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
if (!isset($id)) {
    $id = get_the_ID();
}
$args = array('post_type' => 'sp_directory', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_key' => 'sp_team', 'meta_value' => $id);
$directories = get_posts($args);
$checked = (array) get_post_meta($id, 'sp_directory');
foreach ($directories as $directory) {
    $id = $directory->ID;
    if (!in_array($id, $checked)) {
        continue;
    }
    ?>
	<h4 class="sp-table-caption"><?php 
    echo $directory->post_title;
    ?>
</h4>
	<?php 
    $format = get_post_meta($id, 'sp_format', true);
    if (array_key_exists($format, SP()->formats->directory)) {
        sp_get_template('staff-' . $format . '.php', array('id' => $id), 'staff-' . $format, SP_STAFF_DIRECTORIES_DIR . 'templates/');
    } else {
        sp_get_template('staff-list.php', array('id' => $id), 'staff-list', SP_STAFF_DIRECTORIES_DIR . 'templates/');
    }
}
function sp_venue_map($term = 0)
{
    $meta = get_option("taxonomy_{$term}");
    sp_get_template('venue-map.php', array('meta' => $meta));
}
function simple_profile_content_wrapper_end()
{
    sp_get_template("global/wrapper-end.php");
}
Esempio n. 25
0
<?php

/**
 * Team League Tables
 *
 * @author 		ThemeBoy
 * @package 	SportsPress/Templates
 * @version     1.8.7
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
if (!isset($id)) {
    $id = get_the_ID();
}
$team = new SP_Team($id);
$tables = $team->tables();
foreach ($tables as $table) {
    if (!$table) {
        continue;
    }
    sp_get_template('league-table.php', array('id' => $table->ID, 'highlight' => $id));
}
Esempio n. 26
0
			</thead>
			<?php 
    if ($address != null || $show_maps && $latitude != null && $longitude != null) {
        ?>
				<tbody>
					<tr class="sp-event-venue-address-row">
						<td><?php 
        echo $address;
        ?>
</td>
					</tr>
					<?php 
        if ($show_maps && $latitude != null && $longitude != null) {
            ?>
						<tr class="sp-event-venue-map-row">
							<td><?php 
            sp_get_template('venue-map.php', array('meta' => $meta));
            ?>
</td>
						</tr>
					<?php 
        }
        ?>
				</tbody>
			<?php 
    }
    ?>
		</table>
	</div>
	<?php 
}
/** Venue Archive ********************************************************/
function sportspress_output_venue_map($query)
{
    if (!is_tax('sp_venue')) {
        return;
    }
    $slug = sp_array_value($query->query, 'sp_venue', null);
    if (!$slug) {
        return;
    }
    $venue = get_term_by('slug', $slug, 'sp_venue');
    $t_id = $venue->term_id;
    $meta = get_option("taxonomy_{$t_id}");
    sp_get_template('venue-map.php', array('meta' => $meta));
}
Esempio n. 28
0
 * @author 		ProSports
 * @package 	ProSports/Templates
 * @version     1.1
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
if (!isset($id)) {
    $id = get_the_ID();
}
$team = new SP_Team($id);
$lists = $team->lists();
foreach ($lists as $list) {
    $id = $list->ID;
    $grouping = get_post_meta($id, 'sp_grouping', true);
    if ($grouping == 0 && sizeof($lists) > 1) {
        ?>
		<h4 class="sp-table-caption"><?php 
        echo $list->post_title;
        ?>
</h4>
		<?php 
    }
    $format = get_post_meta($id, 'sp_format', true);
    if (array_key_exists($format, SP()->formats->list)) {
        sp_get_template('player-' . $format . '.php', array('id' => $id));
    } else {
        sp_get_template('player-list.php', array('id' => $id));
    }
}
 /**
  * Output template.
  *
  * @access public
  * @return void
  */
 public function template()
 {
     sp_get_template('event-statistics.php', array(), '', SP_MATCH_STATS_DIR . 'templates/');
 }
    $groups = array($group);
}
foreach ($groups as $group) {
    $i = 0;
    if (!empty($group->name)) {
        echo '<a name="group-' . $group->slug . '" id="group-' . $group->slug . '"></a>';
        echo '<' . $grouptag . ' class="player-group-name player-gallery-group-name">' . $group->name . '</' . $grouptag . '>';
    }
    foreach ($data as $player_id => $performance) {
        if (empty($group->term_id) || has_term($group->term_id, 'sp_position', $player_id)) {
            if (isset($limit) && $i >= $limit) {
                continue;
            }
            $caption = get_the_title($player_id);
            $caption = trim($caption);
            sp_get_template('player-gallery-thumbnail.php', array('id' => $player_id, 'performance' => $performance, 'itemtag' => $itemtag, 'icontag' => $icontag, 'captiontag' => $captiontag, 'caption' => $caption, 'size' => $size, 'link_posts' => $link_posts));
            $i++;
        }
    }
    if (!$html5 && $columns > 0 && ++$i % $columns == 0) {
        echo '<br style="clear: both" />';
    }
}
if (!$html5 && $columns > 0 && ++$i % $columns == 0) {
    echo '<br style="clear: both" />';
}
if ($show_all_players_link) {
    echo '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink($id) . '">' . __('View all players', 'sportspress') . '</a>';
}
echo "</div>\n";
?>