/**
     * Output the metabox
     */
    public static function output($post)
    {
        $team = new SP_Team($post);
        $leagues = get_the_terms($post->ID, 'sp_league');
        $league_num = sizeof($leagues);
        // Loop through columns for each league
        if ($leagues) {
            foreach ($leagues as $league) {
                $league_id = $league->term_id;
                ?>
			<p><strong><?php 
                echo $league->name;
                ?>
</strong></p>
			<?php 
                list($columns, $data, $placeholders) = $team->columns($league_id);
                self::table($league_id, $columns, $data, $placeholders);
            }
        }
        ?>
		<p><strong><?php 
        _e('Total', 'prosports');
        ?>
</strong></p>
		<?php 
        list($columns, $data, $placeholders) = $team->columns(0);
        self::table(0, $columns, $data, $placeholders);
    }
 /**
  * Output the metabox
  */
 public static function output($post)
 {
     global $pagenow;
     if ($pagenow != 'post-new.php') {
         $team = new SP_Team($post);
         list($data, $checked) = $team->staff(true);
         self::table($data, $checked);
     } else {
         printf(__('No results found.', 'sportspress'));
     }
 }
 function sp_get_team_columns_data($post_id, $league_id, $admin = false)
 {
     $team = new SP_Team($post_id);
     return $team->data($league_id, $admin);
 }
<?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));
}
示例#5
0
/**
 * Team Player Lists
 *
 * @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));
示例#6
0
/**
 * Team Staff
 *
 * @author 		ThemeBoy
 * @package 	SportsPress/Templates
 * @version     1.9.13
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
if (!isset($id)) {
    $id = get_the_ID();
}
$team = new SP_Team($id);
$members = $team->staff();
foreach ($members as $staff) {
    $id = $staff->ID;
    $name = $staff->post_title;
    $staff = new SP_Staff($id);
    $role = $staff->role();
    if ($role) {
        $name = '<span class="sp-staff-role">' . $role->name . '</span> ' . $name;
    }
    ?>
	<h4 class="sp-staff-name"><?php 
    echo $name;
    ?>
</h4>
	<?php