Kilg.us – Fantasy Stat Tracker …Tracker

A blog about the development of Kilg.us – The Fantasy Baseball Stat Tracker

Posts Tagged ‘bench’

Order of Players on Team Pages

Sunday, April 18th, 2010

There has been an unforeseen development since adding drag-and-drop to Team pages on Kilg.us. The purpose of drag-and-drop was to easily move players on an off the bench. Drag-and-drop also lets you change the order in which players are listed on your team page. A number of people have noticed that, after they re-order their players, that order isn’t maintained when they reload the page.

Kilg.us does not keep a record of the order you place your players in–it only tracks whether they are on or off the bench. When you load your team page, your players will always display in scorecard order–Catcher, 1st Base, 2nd Base, 3rd Base, Shortstop, Left Field, Center Field, Right Field. If you have multiple players at a position, they will be in alphabetical order based on last name, then first name. The position for a player is based on what MLB lists as the player’s primary position. This may or may not match up with the position qualifications for players in your league.

MLB doesn’t differentiate relief and starting pitchers, so they are all listed alphabetically–again by last name, then first name.

As time allows, I will look into letting Kilg.us monitor the order players are dragged into. For the immediate future, other features are priority.

Bump #2

Thursday, March 18th, 2010

I received an email notifying me of a second repercussion of the 2010 re-launch. When players were moved on or off the bench, the change was not being saved. Upon re-visiting the team page, the bench would revert to its previous state.

After review, the script that is intended save the bench changes to the database was trying to access a User class that wasn’t available to it. I’ve fixed the issue so you should now see the normal, expected behavior from benching and activating players.

This is the second issue that has occurred in a non-visible script where a class was not properly referenced. This is caused by the re-architecture of the objects in Kilg.us and is a bit frustrating. I’ll be reviewing all similar scripts this evening in hopes of catching any other situations where this is occurring.

Add Players to your Team

Wednesday, March 17th, 2010

Players are added and removed individually from each of your teams. Kilg.us doesn’t try to enforce any specific league rules for when players can be added or removed from teams. You can do so at any time.

Find a Player

To find a player to add to your roster, you must first navigate to your team page. Across just below your team’s name there is a series of links including “Add Player”. Clicking this link will take you to the page to search for and add a player.

On the Add Player screen you will see a group of search fields in the right column. As their labels describe, you can search for players based on first name, last name, and position.

Kilg.us doesn’t use Lucene search for player searching yet (it does for friend searching), but this functionality will be added later in 2010.

Add Player page with result for a search on "Young"

Add Player page with result for a search on "Young"

All of the search fields you direct string matches. This means they will find sub-strings within longer names, but won’t find variations on the terms you entered. So, a last-name search for “you” will return “Young” and “Youkilis” but not “Lyon”. If your search doesn’t return the player you were expecting, trying using a shorter string of characters.

Review a Player’s Stats

After you have some search results returned, you can check out the stats of the players in the list. Clicking on a player’s name will open a layer that shows the player’s picture, total season stats, and a link to the player’s MLB.com profile page.

Add Player page displaying Michael Young player layer

Add Player page displaying Michael Young player layer

Add a Player

To add a player to your team, click on the green “plus” sign (+) next to his name. This will bring up a prompt to confirm that you wish to add the player to your team. If you accept, the player will be added to your team. This is handled by an AJAX request which means the page won’t need to reload. A new prompt will appear once the player has been added.

You can add as many players to your team as you would like in this session.

Activating your Player

After being added to your team, your new player will be placed on your bench. This means his stats won’t be counted when your team’s stats are calculated. To activate the player, click the gray-bars handle to the left of the player’s name on your team page and drag him above the “Bench” bar. To return him to the bench, just drag and drop him below the “Bench” bar.

Players riding the pine on a Team page

Players riding the pine on a Team page

Remove a Player

If you have added a player to your team accidentally or just want to remove someone, you can do so at any time. On your team page, there is a red “X” icon on the right end of each player’s stat line. Clicking this icon will prompt you to confirm that you wish to remove the player from the team. If you confirm, the page will reload and the player will be removed.

You can always add a player back to your team by using the same process described above for adding a player.

2010 Updates

Saturday, March 6th, 2010

I’m in the process of implementing a series of updates to Kilg.us for the 2010 season. The biggest noticeable difference will be an entire new look and feel. The new layout will allow for 1, 2, and 3-column pages that should let Kilg.us more efficiently use space.

Other changes in progress include:

  • Integrated log-in/sign-up function
  • User-defined backgrounds
  • More flexibility in the “invite friends” functionality
  • Updated log-in flow
  • Drag-and-drop bench
  • Integration with Zend framework

Among the other items I’m planning to get to before opening day:

  • Add OPS to statistics available for tracking
  • Implement Lucene search for “Find Friends”
  • SSL for log-in flow

If you have other suggestions, please add a comment or drop me a long at admin@kilg.us

I’ll go into more detail about the updated features over the coming weeks. In the mean time, I’m just trying to get things done before the season kicks-off!

Benching Players in Internet Explorer

Tuesday, April 14th, 2009

I received reports that some Users were unable to Bench players. No surprise, those Users are using Internet Explorer (7 and 8). Why “No surprise”? For those who don’t know, Internet Explorer has long been a pathetic attempt for a web browser. The rendering engine is miserable (although, admittedly better in IE7 and better yet in IE8) and the JavaScript engine is slow and broken. As such, Kilg.us is never tested on IE. Development occurs with Firefox. If I need to test multiple accounts, I’ll use Chrome or Safari as well. So, if something doesn’t work in Kilg.us, try a real browser and you’ll likely have better luck.

Because I’d rather have more people use Kilg.us, though, if you experience issues in IE and let me know about them, I’ll try to get them fixed. I’ve had two reports this Spring and both have been fixed within 24 hours. I can’t promise that speed all the time, but I try.

Today’s issue specifically had to do with the “class” attribute. See, with every real browser, you can access the “class” attribute by using the name “class” (just like you access the “href” attribute with “href” or the “style” attribute with “style”). So this is how Kilg.us was referencing the “class” attribute value to determine if a player was benched or not. In IE, though, you reference the “href” attribute with the word “href” and the “style” attribute with the word “style”…but the “class” attribute is accessed with the word “className”. It’s the only attribute like that. Thank you Internet Explorer.

To fix the problem immediately, I had to implement a standard check to see if the browser was IE and if so use “className” instead of “class”. That fixed the problem, but further confused what was already an unelegant function. So the long-term solution was to rewrite the entire function utilizing some JQuery class-manipulation functions to perform the desired action.

Long story short, you should be able to bench players in Internet Explorer now.

Though I would strongly recommend you try any browser but…

Two Days of Updates

Thursday, April 2nd, 2009

I quit working too late last night to post about the updates, so I’ll cover a couple days’ work now.

The biggest visible change was an update to the top site navigation. Previously, after logging-in, if you visited the home page or Tracker blog, there was no way to return to the system without logging-in again. Obviously, that was inconvenient. The home page and blog now both recognize an authenticated session and will display a new navigation link (that exists throughout the site now) to visit the Dashboard. This will get you back “into” Kilg.us without needing to log-in again.

The other big functional change is on the Add Player page. After receiving a report that adding a player was causing an alert in Firefox, I dug in to see what was happening. Unfortunately the alert was simply a slow script notice, not an actual error. What I ultimately determined was that the cumulative stat bubbles that I added the other day were causing an odd JQuery loop when the page is unloaded. Rather than trying to dig into JQuery to see what the problem was, I determined it could be alleviated by reducing the number of instances of the stat bubbles on the page. So the Add Player page now features pagination! Search results will be displayed 50 at a time with pagination links at the bottom of the page. This leads to quicker load times of the page, as well, so it seems like an improvement all-round.

Complicating the new Add Player pagination is the position filter. That filter literally filters down the players shown on the page, based on position.  All it really does is turn off the display of players that don’t match the filter. So, previously, changing the filter to a specific position would cause a display of all players at that position. Now, changing the filter will only show the players among the currently displayed 50 that match. This seems confusing to me, so I think I will need to re-write how it works.

On a non-visible vein, I’ve incorporated the functionality to allow Users to view other Users’ teams. This is a precursor to the social-stat-tracking concept I’ve been discussing. There is no interface to share your teams with other Users yet–the relationship has to be manually set in the database. There is a new relationship type, though. Originally a team only had one User related to it: the Owner who had total control to do anything with the team they wished. Now there is a Viewer User type. This User type can only view the team. They cannot change the team name, delete the team, add players, remove players, bench players, or change the team’s stats. I’m hoping to waste a good chunk of time this weekend working on social-stat-tracking. With a lot of luck, I’ll have something working by opening day.

On a reality-strikes front: the iPhone web app won’t be ready for opening day. Once life settles down a bit, I’ll try to get back to it later this Spring or Summer.

Retained Bench

Wednesday, June 25th, 2008

It’s been a little while since I’ve made any changes to the Fantasy Stat Tracker, but I had a few minutes today and thought of a great improvement. Previously, when viewing your team you could identify which players were on the “bench” for a given day. Unfortunately, that designation as a “bench” player was specific to the current, loaded instance of the Team page. When you reloaded the page (to see updated stats), you lost your bench designations and needed to re-check your bench players.

As of today, that is no longer the case. When you tag a player as being on the bench, they will stay on the bench until you explicitly remove them. After benching a player, when you reload the page they will still be on the bench. If you log-out and log back in tomorrow, they’ll still be on the bench. Until you un-check the little “bench” box next to the player’s name, their stats won’t count in your calculated totals.

This, for me, is probably the biggest annoyance I’ve had with the Stat Tracker, so I’m quite pleased it is resolved. Hopefully this will be helpful to everyone else using the tool as well.

As an added bonus, when a player is on the bench they will automatically be dropped to the bottom of the player list so their stats are easily ignored as you scroll through your other players.