Apply event and player settings

This commit is contained in:
Brian Miyaji
2014-03-28 22:40:59 +11:00
parent cf6ea96da0
commit acb4dd373b
5 changed files with 26 additions and 16 deletions

View File

@@ -4,7 +4,8 @@ if ( ! isset( $id ) )
$venues = get_the_terms( $id, 'sp_venue' );
$show_map = get_option( 'sportspress_event_show_map', 'yes' ) == 'yes' ? true : false;
$show_maps = get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' ? true : false;
$link_venues = get_option( 'sportspress_event_link_venues', 'no' ) == 'yes' ? true : false;
if ( ! $venues )
return $output;
@@ -13,6 +14,10 @@ foreach( $venues as $venue ):
$t_id = $venue->term_id;
$term_meta = get_option( "taxonomy_$t_id" );
$name = $venue->name;
if ( $link_venues )
$name = '<a href="' . get_term_link( $t_id, 'sp_venue' ) . '">' . $name . '</a>';
$address = sp_array_value( $term_meta, 'sp_address', '' );
$latitude = sp_array_value( $term_meta, 'sp_latitude', 0 );
$longitude = sp_array_value( $term_meta, 'sp_longitude', 0 );
@@ -21,14 +26,14 @@ foreach( $venues as $venue ):
<table class="sp-data-table sp-event-venue">
<thead>
<tr>
<th><a href="<?php echo get_term_link( $t_id, 'sp_venue' ); ?>"><?php echo $venue->name; ?></a></th>
<th><?php echo $name; ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $address; ?></td>
</tr>
<?php if ( $show_map && $latitude != null && $longitude != null ): ?>
<?php if ( $show_maps && $latitude != null && $longitude != null ): ?>
<tr>
<td><div class="sp-google-map" data-address="<?php echo $address; ?>" data-latitude="<?php echo $latitude; ?>" data-longitude="<?php echo $longitude; ?>"></div></td>
</tr>