League Standings 1.3 Released

Version 1.3 of the MSTW League Standings plugin was just released to address two bugs:

1. Under certain circumstances, standings could be incorrect due to a sorting error. For example, when sorting by rank, 1, 2, 04, 4, 16, 21 could sort incorrectly (alphabetically instead of numerically) as 04, 1, 16, 2, 21, 4.

2. A perfect win percentage would display as 1. It now displays as 1.000.

Team Rosters v4.0.1 Released

Version 4.0.1 addresses the following issues:

  1. The CSV Import function was incorrectly importing Bats/Throws.
      
  2. The display of ‘B’ for bats was incorrect after import. (This was not related to the import problem above.)

    Note: There has been a request to change switch hitters from Bats – ‘B’ (both) to ‘S’ (switch). I do not plan to tail chase this terminology as sites such as MLB.com change it. The ‘B’ for bats both is translation ready. You can simply create a en_US translation with one entry ‘B’ -> ‘S’, and you’ve got it.

  3. In some scenarios, the front end shortcodes generated WordPress WARNINGS. There are several ways to fix this on your site, but it is now corrected in v4.0.1.

Team Rosters 4.0 – New FAQs

Based on feedback from some of you, here are a couple of new FAQs:

I installed version 4.0 (without reading the fine manual) and all my data is gone! @*?*$^&#!! Please tell me I did not lose 3 years of data!
No, you did not lose your data, you just can’t see it via version 4.0 of the plugin. Deactivate version 4.0 (I don’t believe you have to uninstall it.) and reinstall version 3.1.2, which is available on wordpress.org. You will have to download the zip file and install it as a zip file. Then follow the upgrade instructions in the users manual.

Why do I get the message “Cheatin’ huh?” when I try to access some admin screens after installing version 4.0?
This problem is related to the WP Roles & Capabilities system and the MSTW roles & capabilities that control access to the Team Rosters admin screens. The appropriate MSTW capabilities are assigned to the Administrator role when the plugin is activated (and only then). So assuming you are logged in as an administrator, de-activating and re-activating the plugin usually does the trick.

Why do I get the following message on some front-end displays, e.g., Player Galleries?

Warning: array_key_exists() expects parameter 2 to be array, string given in /home/mdorum/public_html/wordpress/wp-content/plugins/team-rosters/includes/mstw-tr-utility-functions.php on line 755

I believe this only occurs when viewing the front end displays BEFORE accessing the back end Team Roster admin screens AND MSTW Schedules & Scoreboards is active. I believe simply visiting the Team Roster admin pages (any page) fixes this problem. (Please let me know if it doesn’t.)

I have patched this issue. If you pull the includes/mstw-tr-utility-functions.php file from the development tree, this problem is corrected there.

Finally, these messages were WARNINGS, not ERRORS (which “white screen” the site). While I work hard to eliminate such messages, they should not harm your site, because they should be disabled completely or directed to the debug.log file on a live site. Information on managing these messages is readily available on the web, including on shoalsummitsolutions.com.

Team Rosters 4.0 Now Available

Team Rosters 4.0 is now available. Cool new features include:

  • Improved customization options for team colors and logos.
  • Improved options for customizing both the colors (CSS sytlesheets)
  • Improved options for customizing the player gallery and single player bio templates.
  • Increased integration with MSTW Schedules & Scoreboards plugin. Team logos and colors may now be pulled from that plugin’s data tables.
  • Re-organized the admin (Display) Settings screen into several tabs.

THE DATA STRUCTURES FOR PLAYERS AND TEAMS HAVE CHANGED. So if you plan to upgrade from version 3.1.2, PLEASE READ THE USERS MANUAL BEFORE UPGRADING. There are steps you will have to take in order to preserve your existing data via the MSTW CSV Exporter plugin.

The man pages are up to date. If you are upgrading, you might want to start with the Upgrading to Team Rosters 4.0 man page. Five video tutorials are available to MSTW Gold Members. They cover upgrading from version 3.1.2 and the associated data migration, AND new ways to customize the plugin’s displays – roster tables, player galleries, and player profiles.

Upgrading from 3.1.2 to 4.0
Migrating Data from v3.1.2
Customizing Colors in v4.0
Customizing Team Logos in v4.0
Customizing the Single Player and Player Gallery Templates

SF Giants Roster Table

SF Giants Player Gallery

Buster Posey

MSTW CSV Exporter 1.2 Released

MSTW CSV Exporter 1.2 is now available. It is CRITICAL to upgrading Team Rosters from version 3.1.2 to version 4.0. New features include:

  • Version 1.2 provides the ability to export the MSTW Team Rosters (v3.2.1) data structures – Players and Teams – for import to MSTW Team Rosters v4.0. It allows player photos to be moved from site to site automagically in the import/export process (or not if you are upgrading Team Rosters on one site). See [the Team Rosters CSV Import man page](https://shoalsummitsolutions.com/tr-loading-csv-files/) for more information.
  • Exports MSTW Team Rosters v4.0 data for backup and data migration across websites.

NOTE: THE TEAM ROSTERS DATA STRUCTURES FOR PLAYERS AND TEAMS HAVE CHANGED IN VERSION 4.0. So if you plan to upgrade from version 3.1.2, PLEASE READ THE USERS MANUAL BEFORE UPGRADING. There are steps you will have to take in order to preserve your existing data.

Please see the MSTW CSV Exporter users manual at ShoalSummitSolutions.com for more information.

Team Rosters Update

Team Rosters version 4.0 is on schedule for a late spring release. This update has a few front end enhancements, but the focus is on ‘admin issues’, specifically integration other MSTW plugins and increased customization options.

The tutorials listed below are available on the the shoalsummitsolutions.com Support -> Tutorials page.

Customizing Team Colors

There are three ways to customize the colors in the Team Rosters v4.0 plugin: the colors tab on the Settings admin page, writing custom CSS rules where the stylesheet can now be in the theme/child theme directory, and a new setting to automatically set the table colors from the MSTW Schedules & Scoreboards teams database. [Video Tutorial]

Cal Roster Table

Customizing Team Logos

There are three ways to customize the team logos (and default images when no player photo is found) in Team Rosters v4.0: use the logos in the MSTW Schedules & Scoreboards database, set the default logos in the plugin’s /images/default-images/ directory, or set the default logos in the theme or child theme’s /mstw-team-rosters-images/ directory (which you create). [Video Tutorial]

Buster Posey

Customizing the Single Player & Player Gallery Templates

The default Single Player and Player Gallery templates are located in the plugin’s /theme-templates/ directory. Usually, only some CSS modifications are required to make these templates “fit” in a theme. Occasionally, these templates require code modifications to meet a sites requirements. In version 4.0, the plugin’s default templates never need to be modified. Rather, one should create custom templates in the theme’s (or child theme’s) main directory. By doing so, the customizations are not overwritten when a plugin update is loaded. If a child theme is used, they are not overwritten by a theme update either. [Video Tutorial]

MSTW Schedules & Scoreboards 1.3 Patch

There was a bug in Schedules & Scoreboards v1.3 that generates a fatal error when you access your dashboard. (You will NOT see if you have the MSTW CSV Exporter plugin installed.) It has been patched in version 1.3 WITHOUT a version change, and in the development trunk. If you have already installed version 1.3, simply delete it and re-install it. If you want to load the patch without deleting and re-installing the entire plugin, simply update the plugin’s mstw-ss-admin.php file in the /includes directory with the same file from the development trunk or the new version 1.3. Sorry for the inconvenience.

MSTW Schedules & Scoreboard v1.3

Single Game SliderVersion 1.3 of the Schedules & Scoreboards plugin was released today. It is largely a maintenance build, but it also provides a cool new feature for users/admins who write custom CSS rules for their site, and better control of home game styling.

  • The CSS stylesheet loading logic changed, so customizations can be loaded from a file separate from the plugin’s /css/mstw-ss-styles.css stylesheet. So your site’s custom styles can be stored separately from the plugin’s stylesheet, simplifying the plugin upgrade process. Learn how to utilize this new feature here.
  • Added CSS elements for home games to all widgets & shortcodes, which provide improved ability to customize the display of home games.
  • Schedule sliders displaying only one game now “slide” correctly. Fixed bug in the related JavaScript.
  • Added four team color settings on the Edit Team admin screen, which will be used in the next release of Team Rosters. (More to follow on this one.)
  • The Settings link on the Plugins screen now links to the correct location.
  • Removed some annoying PHP notices from the CDT widget. Please let me know if you come across PHP notices or warnings in the plugin.
  • HEY, wait a minute! I thought you were working on a really cool new Team Rosters release? Yup, I sure am. I reached the point where I needed to add the team color data fields, so I fixed the other issues ‘on the list’ while I was in there. Team Rosters is moving along with lots of cool new features, not to mention maybe one bug fix :). I’m still shooting for an early summer release. Look for a progress update in the next week or two.

    Upgrading to Schedules & Scoreboards

    This article explains the steps required to upgrade from Game Locations and/or Game Schedules to the new MSTW Schedules & Scoreboards plugin, which replaces both of them. Two video tutorials on this subject (exporting to and importing from CSV files) are available to Gold Support members.

    So first, why can’t I just upgrade the plugins or install the new plugin, just like I normally do? The primary driver behind this upgrade was to support migration of data across websites, specifically the links between data tables. The secondary goal was to create a platform for better integration of MSTW features – teams, schedules, leagues and standings, coaching staffs, venues, sports – in sports site themes. Unfortunately, significant changes to the underlying data tables (the structure of the custom post types, for you techies) were necessary. Two design decisions were made to (a) combine the Locations and Schedules plugins, and (b) support the data changes via export to & import from CSV files, since this functionality would be required going forward anyway.

    The steps are a bit involved, but straightforward. These steps assume you are upgrading/migration both Game Locations and Game Schedules.

    1. Install and activate the MSTW CSV Exporter plugin.
    2. Export Game Locations – Locations, Game Schedules-Schedules, Game Schedules-Teams, and Game Schedules-Games.
    3. MSTW CSV Exporter Settings Screen

    4. Check that your CSV files look okay (probably using Excel). Examples of properly formatted CSV export files are located in the /mstw-schedules-scoreboards/csv-examples directory. Note for Mac users: files must be saved in Windows CSV format, not the native Mac CSV format.
    5. If you are upgrading the same site, deactivate the Game Locations and Game Schedules plugin.
    6. Install and activate the MSTW Schedules & Scoreboards plugin.
    7. From the admin screen, go to the Schedules & Scoreboards -> CSV Import screen.
    8. MSTW Schedules & Scoreboards CSV Import Settings Screen

    9. Import your CSV files in the following order: Venues, Teams, Schedules, Games.

    That’s it. All your data should now be in Schedules & Scoreboards. Check it out carefully in the various admin screens.

    Finally, you will now have to edit your shortcodes to those for Schedules & Scoreboards, and probably reset your permalinks.

    Note 1: When importing the teams table, there is an option to specify the new directory where you want the team logos stored. Unfortunately, WordPress stores links to images as full path names, so if you are moving the data between sites/servers you will need to translate all the image paths. You will also have to download and upload your logo files. The exporter/importer functions will not do this for you. If you are staying on the same site, the logo images can stay in place, and no changes should be necessary.

    Note 2: All the venues, schedules, teams, and games will be exported and imported. If there’s data you don’t want to migrate, you can either remove it from the Game Locations and Game Schedules plugins before exporting the data, or after exporting the data edit the CSV files and delete the data you don’t want prior to importing.

    How to change the “Item updated” message for a custom taxonomy

    This is the first in a series of posts on some more technical (read ‘developer’) issues that I have come across. I’m documenting them here primarily so I can remember them, but hopefully some other developer will find hem useful someday. I’ll focus on challenges for which I have trouble finding solutions on the Internet, not solutions that are readily available in many tutorials.

    Today I was working on a “Teams” custom taxonomy for the next MSTW Team Rosters release. This is a custom taxonomy ( think category or tag ) that links a group of “Players” ( a custom post type ) together as a team. I added a metadata field to the taxonomy in order to link the Team Rosters plugin “Teams” together with the Schedules & Scoreboards plugin’s “Teams”. The data for each “Team” – items like home venue, logos, colors – will live in the Schedules & Scoreboards data tables, but be accessible to the Team Rosters plugin. Those readers who use the MSTW plugins will learn more about this cool new feature later.

    As I completed this code, I noticed that when updating a Team, the update message looked like this:

    Item Update Message

    Hummm, what’s with this “Item” stuff? That should read “Team”. It seemed like that fix should be a simple WP filter (and it was). I do essentially the same thing for custom post types (see below).

    Game Update Message

    But this was a bit different, it was a taxonomy. After Goggling my brains out with little success (ergo, this post), I decided to dig into the WordPress core code, and found the filter I needed in /wp-admin/edit-tags.php. The filter is “term_updated_messages“, but (of course) it doesn’t work quite the same as the “post_updated_messages” used for CPTs. It’s a bit simpler, and there is no “bulk_term_updated_messages” like there is for CPTs ( “bulk_post_updated_messages” ). I assume because there is no trash can for terms ( items in a taxonomy ) like there is for posts.

    So the code is pretty simple once you find it. First add the filter.

    add_filter('term_updated_messages', 'mstw_tr_updated_term_messages');
    

    Then write the callback.

     function mstw_tr_updated_term_messages( $messages ) {
    
         //mstw_tr_team is the custom taxonomy	
         $messages['mstw_tr_team'] = array(
    		0 => '',
    		1 => __( 'Team added.', 'mstw-team-rosters' ),
    		2 => __( 'Team deleted.', 'mstw-team-rosters' ),
    		3 => __( 'Team updated.', 'mstw-team-rosters' ),
    		4 => __( 'Team not added.', 'mstw-team-rosters' ),
    		5 => __( 'Team not updated.', 'mstw-team-rosters' ),
    		6 => __( 'Teams deleted.', 'mstw-team-rosters' ),
    		);
    									
         return $messages;
    		
     } //End: mstw_tr_updated_term_messages( )
    

    And there you have it.

    Team Update Message

    I hope that helps somebody someday. I’m sure I’ll end up looking for it eventually. If you have an questions, send me an e-mail.