diff --git a/admin/hooks/admin-enqueue-scripts.php b/admin/hooks/admin-enqueue-scripts.php
index 413f5dac..d1407d30 100644
--- a/admin/hooks/admin-enqueue-scripts.php
+++ b/admin/hooks/admin-enqueue-scripts.php
@@ -10,6 +10,7 @@ function sportspress_admin_enqueue_scripts( $hook ) {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-chosen', SPORTSPRESS_PLUGIN_URL .'assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
+ wp_enqueue_script( 'jquery-tiptip', SPORTSPRESS_PLUGIN_URL .'assets/js/jquery.tipTip.min.js', array( 'jquery' ), '1.3', true );
wp_enqueue_script( 'jquery-caret', SPORTSPRESS_PLUGIN_URL .'assets/js/jquery.caret.min.js', array( 'jquery' ), '1.02', true );
wp_enqueue_script( 'jquery-countdown', SPORTSPRESS_PLUGIN_URL .'assets/js/jquery.countdown.min.js', array( 'jquery' ), '2.0.2', true );
diff --git a/admin/post-types/player.php b/admin/post-types/player.php
index 2693b8bb..218575b0 100644
--- a/admin/post-types/player.php
+++ b/admin/post-types/player.php
@@ -32,7 +32,7 @@ add_action( 'init', 'sportspress_player_post_init' );
function sportspress_player_edit_columns() {
$columns = array(
'cb' => '',
- 'sp_number' => '',
+ 'sp_number' => '',
'title' => __( 'Player', 'sportspress' ),
'sp_position' => __( 'Positions', 'sportspress' ),
'sp_team' => __( 'Teams', 'sportspress' ),
diff --git a/admin/post-types/team.php b/admin/post-types/team.php
index 32cf43d7..51798605 100644
--- a/admin/post-types/team.php
+++ b/admin/post-types/team.php
@@ -40,7 +40,7 @@ function sportspress_team_meta_init( $post ) {
function sportspress_team_edit_columns() {
$columns = array(
'cb' => '',
- 'sp_icon' => '',
+ 'sp_icon' => '',
'title' => __( 'Team', 'sportspress' ),
'sp_league' => __( 'Leagues', 'sportspress' ),
'sp_season' => __( 'Seasons', 'sportspress' ),
diff --git a/admin/templates/player-gallery.php b/admin/templates/player-gallery.php
new file mode 100644
index 00000000..d6a98aad
--- /dev/null
+++ b/admin/templates/player-gallery.php
@@ -0,0 +1,93 @@
+ null,
+ 'orderby' => 'default',
+ 'order' => 'ASC',
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+
+ $output = '
' .
+ '
' . '' . '';
+
+ $data = sportspress_get_player_list_data( $id );
+
+ // The first row should be column labels
+ $labels = $data[0];
+
+ // Remove the first row to leave us with the actual data
+ unset( $data[0] );
+
+ $statistics = sportspress_array_value( $r, 'statistics', null );
+
+ if ( $r['orderby'] == 'default' ):
+ $r['orderby'] = get_post_meta( $id, 'sp_orderby', true );
+ $r['order'] = get_post_meta( $id, 'sp_order', true );
+ else:
+ global $sportspress_statistic_priorities;
+ $sportspress_statistic_priorities = array(
+ array(
+ 'statistic' => $r['orderby'],
+ 'order' => $r['order'],
+ ),
+ );
+ uasort( $data, 'sportspress_sort_list_players' );
+ endif;
+
+ if ( in_array( $r['orderby'], array( 'number', 'name' ) ) ):
+ $output .= '| # | ';
+ else:
+ $output .= '' . __( 'Rank', 'sportspress' ) . ' | ';
+ endif;
+
+ foreach( $labels as $key => $label ):
+ if ( ! is_array( $statistics ) || $key == 'name' || in_array( $key, $statistics ) )
+ $output .= ''. $label . ' | ';
+ endforeach;
+
+ $output .= '
' . '' . '';
+
+ $i = 0;
+
+ foreach( $data as $player_id => $row ):
+
+ $output .= '';
+
+ // Rank or number
+ if ( isset( $r['orderby'] ) && $r['orderby'] != 'number' ):
+ $output .= '| ' . ( $i + 1 ) . ' | ';
+ else:
+ $number = get_post_meta( $player_id, 'sp_number', true );
+ $output .= '' . ( $number ? $number : ' ' ) . ' | ';
+ endif;
+
+ // Name as link
+ $permalink = get_post_permalink( $player_id );
+ $name = sportspress_array_value( $row, 'name', sportspress_array_value( $row, 'name', ' ' ) );
+ $output .= '' . '' . $name . ' | ';
+
+ foreach( $labels as $key => $value ):
+ if ( $key == 'name' )
+ continue;
+ if ( ! is_array( $statistics ) || in_array( $key, $statistics ) )
+ $output .= '' . sportspress_array_value( $row, $key, '—' ) . ' | ';
+ endforeach;
+
+ $output .= '
';
+
+ $i++;
+
+ endforeach;
+
+ $output .= '' . '
' . '
';
+
+ return apply_filters( 'sportspress_player_list', $output );
+
+ }
+}
diff --git a/assets/js/admin.js b/assets/js/admin.js
index 9b389644..f4032a6b 100644
--- a/assets/js/admin.js
+++ b/assets/js/admin.js
@@ -9,6 +9,13 @@ jQuery(document).ready(function($){
$target.hide();
});
+ // Tiptip
+ $(".tips").tipTip({
+ delay: 200,
+ fadeIn: 100,
+ fadeOut: 100
+ });
+
// Chosen select
$(".chosen-select").chosen({
allow_single_deselect: true,
diff --git a/assets/js/jquery.tipTip.min.js b/assets/js/jquery.tipTip.min.js
new file mode 100644
index 00000000..8de2e72b
--- /dev/null
+++ b/assets/js/jquery.tipTip.min.js
@@ -0,0 +1,20 @@
+/*
+ * TipTip
+ * Copyright 2010 Drew Wilson
+ * www.drewwilson.com
+ * code.drewwilson.com/entry/tiptip-jquery-plugin
+ *
+ * Version 1.3 - Updated: Mar. 23, 2010
+ *
+ * This Plug-In will create a custom tooltip to replace the default
+ * browser tooltip. It is extremely lightweight and very smart in
+ * that it detects the edges of the browser window and will make sure
+ * the tooltip stays within the current window size. As a result the
+ * tooltip will adjust itself to be displayed above, below, to the left
+ * or to the right depending on what is necessary to stay within the
+ * browser window. It is completely customizable as well via CSS.
+ *
+ * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */(function(e){e.fn.tipTip=function(t){var n={activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},r=e.extend(n,t);if(e("#tiptip_holder").length<=0){var i=e(''),s=e(''),o=e('');e("body").append(i.html(s).prepend(o.html('')))}else var i=e("#tiptip_holder"),s=e("#tiptip_content"),o=e("#tiptip_arrow");return this.each(function(){var t=e(this);if(r.content)var n=r.content;else var n=t.attr(r.attribute);if(n!=""){r.content||t.removeAttr(r.attribute);var u=!1;if(r.activation=="hover"){t.hover(function(){a()},function(){r.keepAlive||f()});r.keepAlive&&i.hover(function(){},function(){f()})}else if(r.activation=="focus")t.focus(function(){a()}).blur(function(){f()});else if(r.activation=="click"){t.click(function(){a();return!1}).hover(function(){},function(){r.keepAlive||f()});r.keepAlive&&i.hover(function(){},function(){f()})}function a(){r.enter.call(this);s.html(n);i.hide().removeAttr("class").css("margin","0");o.removeAttr("style");var a=parseInt(t.offset().top),f=parseInt(t.offset().left),l=parseInt(t.outerWidth()),c=parseInt(t.outerHeight()),h=i.outerWidth(),p=i.outerHeight(),d=Math.round((l-h)/2),v=Math.round((c-p)/2),m=Math.round(f+d),g=Math.round(a+c+r.edgeOffset),y="",b="",w=Math.round(h-12)/2;r.defaultPosition=="bottom"?y="_bottom":r.defaultPosition=="top"?y="_top":r.defaultPosition=="left"?y="_left":r.defaultPosition=="right"&&(y="_right");var E=d+fparseInt(e(window).width());if(E&&d<0||y=="_right"&&!S||y=="_left"&&fparseInt(e(window).height()+e(window).scrollTop()),T=a+c-(r.edgeOffset+p+8)<0;if(x||y=="_bottom"&&x||y=="_top"&&!T){y=="_top"||y=="_bottom"?y="_top":y+="_top";b=p;g=Math.round(a-(p+5+r.edgeOffset))}else if(T|(y=="_top"&&T)||y=="_bottom"&&!x){y=="_top"||y=="_bottom"?y="_bottom":y+="_bottom";b=-12;g=Math.round(a+c+r.edgeOffset)}if(y=="_right_top"||y=="_left_top")g+=5;else if(y=="_right_bottom"||y=="_left_bottom")g-=5;if(y=="_left_top"||y=="_left_bottom")m+=5;o.css({"margin-left":w+"px","margin-top":b+"px"});i.css({"margin-left":m+"px","margin-top":g+"px"}).attr("class","tip"+y);u&&clearTimeout(u);u=setTimeout(function(){i.stop(!0,!0).fadeIn(r.fadeIn)},r.delay)}function f(){r.exit.call(this);u&&clearTimeout(u);i.fadeOut(r.fadeOut)}}})}})(jQuery);
\ No newline at end of file
diff --git a/functions.php b/functions.php
index 2c7985c2..b972b575 100644
--- a/functions.php
+++ b/functions.php
@@ -187,16 +187,9 @@ if ( !function_exists( 'sportspress_set_post_views' ) ) {
if ( !function_exists( 'sportspress_get_post_datetime' ) ) {
function sportspress_get_post_datetime( $post ) {
- if ( $post->post_status == 'future' ):
- $status = __( 'Scheduled', 'sportspress' );
- elseif( $post->post_status == 'publish' ):
- $status = __( 'Published', 'sportspress' );
- elseif( $post->post_status == 'draft' ):
- $status = __( 'Draft', 'sportspress' );
- else:
- $status = __( 'Pending Review', 'sportspress' );
- endif;
- return $status . '
' . date_i18n( __( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) );
+ $date = get_post_time( 'Y/m/d', false, $post );
+ $time = get_post_time( '@ H:i', false, $post );
+ return $date . '
' . $time;
}
}