Posts filed under 'Documentation'

Importing FFLM Data into MFLHistory

This was originally posted by bonscott in the old MFLAddons forums, but I think it deserves a re-post here:

So I was pretty suprised to see the MFLHistory app had the ability to manually create back seasons. In working with the guys I figured out how you can take your FLM history and import them into the historical app. Click the link to my history pages to the left to see what it looks like.

Like many of you vets this is my first year with MFL but I have many seasons worth of data in FLM. To import the game data into the history app you need to create just one CSV report per season in FLM, do some minor edits and then import.

This was done with the last 2004 version which was released in April 05 or so. 2005 beta is out and it should work in there as well.

NOTE: You really need Excel of other spreadsheet editor (check out OpenOffice for a free one if you don’t have Excel) otherwise you’ll have a lot of manual editing ahead of you.

First, lets make the report. Create a custom Fantasy Schedule report. Below are listed all the settings you need *CHECKED*. If it ain’t listed don’t check it.

Setup Tab
———————-
Items to Include:
Fantasy Team Format – Set to “Team Name”
Weekly Scores
Playoff Weeks

Players and Positions:
Nothing here to see

Layout, Group, Sort:
Number of Columns – 1
Space between Columns – 2
Exclude Titles
Exclude Column Headers
Exclude Column Footers

Delivery Tab
————————-
Choose where you want the report to go.
Check the CSV file option. Leave the name as default.
Check the Season option next to it.

Now Click OK.

You’ll probably get the report to come up on screen if you left that option checked, just close it.

You should now have a dialog box and click OK. Go to the location where you saved the report and open it in Notepad. You should see some output similar to below:

Week #1
Argues Army,125.98,at,Stephayn Doppelgangers,138.10
Air Force,94.10,at,Shetland Ponies,115.51
Canadian Geese,176.80,at,Amish Rakefighters,131.00
Portage Enforcers,127.85,at,Capital Punishment,151.61
Polish Avengers,151.50,at,Killer BBs,149.92
Lakeshore Fighting Cocks,151.85,at,Cowgirls,121.90
Week #2
Shetland Ponies,101.05,at,Argues Army,110.05
Stephayn Doppelgangers,141.15,at,Air Force,125.32

If you don’t then you didn’t do it right, try again.
NOTE: The second team will be assumed to be the home team, this is how FLM creates the report.

Assuming everything looks right then in FLM go to your earliest season and your last week of the season (so for me it was 1999 Week 16). Run the report.
Now move forward to the last week of each season and run the report.

When done you should now have one report per season.

You will now need to edit each one in Excel.
First thing, delete Column C, the one with the “at” in it.
Now insert a new column before column A. This should now be the first column and blank. What you need to do is enter in the week number before each machup (all of them). You should see each week broken up by section and labled. This will make it very each to do this so you’ll know what weeks are what.
Once completed, delete each row with the “Week #X” in it.
Save, close and let’s check your work in notepad. You should now see something like this:

1,Argues Army,125.98,Stephayn Doppelgangers,138.1
1,Air Force,94.1,Shetland Ponies,115.51
1,Canadian Geese,176.8,Amish Rakefighters,131
1,Portage Enforcers,127.85,Capital Punishment,151.61
1,Polish Avengers,151.5,Killer BBs,149.92
1,Lakeshore Fighting Cocks,151.85,Cowgirls,121.9
2,Shetland Ponies,101.05,Argues Army,110.05
2,Stephayn Doppelgangers,141.15,Air Force,125.32

Now edit each report for each season.

And that is it, you are now ready to import your historical data from FLM into the MFLHistory app!

Any questions FLM related I can try to answer them. Any other questions should be directed to the MFLHistory guys.

6 comments June 7th, 2006

League History CSS Primer

Two disclaimers to start off with:

  1. I’m very much a beginner at working with CSS, but I can copy other people’s work with the best of ‘em, so I’m learning :)
  2. This is not going to be a complete tutorial on everything you can do with CSS for the League History app because (a) see #1 and (b)this would be a really really long post

If you do come up with a clever CSS trick while modifying your league’s history setup (or you just want to brag about how cool your site looks), feel free to share the details with others in the Support section!

Modifying the Page Header
There are four key CSS tags in the header of each page (default values shown here):
/* The header of all league pages. */
.leaguehistorypageheader {
width: 100%;
}
/* The site branding logo inside the page header. */
.leaguehistorybrandlogo {
width: 15%;
vertical-align: top;
}
/* The page title inside the page header. */
.leaguehistorypagetitle {
width: 70%;
}
/* The "welcome" message inside the page header. */
.leaguehistorywelcome {
vertical-align: top;
text-align: right;
width: 15%;
}

To insert your league banner (or any image) into the header, you could do something like this:
.leaguehistorypageheader {
background-repeat:no-repeat;
background-image: url(http://LINK TO YOUR IMAGE);
height: 150px;
width: 100%;
}

This would add a background image with a height of 150 pixels to your header, and make sure it doesn’t repeat if it’s not as wide as your screen. There are a bunch of other styles that you can work with here as well if you want to do other things with this banner.

The default text color for the page titles is black which might not show up very well in front of your banner. If you’d like to change the color or weight of the page titles, you can certainly do that. For example:
.leaguehistorypagetitle {
width: 70%;
color:white;
font-weight:bold;
}

This makes the title white and bold.

Modifying record tables
If you look at the source of the page, you’ll see all of the various ids and classes associated with the various record tables. Here’s a quick overview of some of the basic stuff you might want to modify.

Row formats
/* All even-numbered rows inside a table. */
.eventablerow {
background-color: #BBBBFF;
}
/* All odd-numbered rows inside a table. */
.oddtablerow {
background-color: #FFFFFF;
}

These entries control the background color of the odd and even rows in each table. If you’d like to use different colors, enter them here!

Record Titles
.homepagemodule CAPTION {
padding-top: 5px;
padding-bottom: 5px;
color: #FFFFFF;
background-color: #000034;
}

Captions are used to display the titles of each record (e.g., “Most Points Scored – Single Game”) and the colors, text style, padding, etc can all be modified by changing the values in the above CSS style.

Record headings and entries
The following CSS styles control the header rows (TH) and table entries (TD) for each record table:
.homepagemodule TD {
border: 1px solid gray;
}
.homepagemodule TH {
border: 1px solid gray;
}

Attributes like background-color (to change the background color) and color (to change the font color) could be helpful additions here.

I know this is a very high level overview, but hopefully this can get some of you who are at least slightly versed in CSS started on working with your League History pages.

9 comments September 1st, 2005

How-To: Import Season

There are two options for importing previous season data into League History:

For additional information on importing from FFLM, please see this post

from MyFantasyLeague

  1. Select a year and enter your MyFantasyLeague ID from that year (typically this is 5-digits, but I believe 4 digits were used at one point with FFLM transfers) — click Continue
  2. If that is a valid league, the next screen will display all team names from that season. The application will attempt to find matching names in existing data (2005 the first time you run it, all seasons later).
    • If a match cannot be found, “*** NEW TEAM ***” will appear in the drop-down next to the team
    • IMPORTANT — review this in detail!
    • If a match isn’t found, it might be because a team name changed (maybe even by just one letter or a space) OR it might be because the team actually changed entirely
    • If it is a name change situation, select the appropriate team to map to
    • If it is a team that does not yet exist in League History, select the *** NEW TEAM *** option — this will add a new team to the database
  3. That’s it! Your league data will be imported! Note: This is not currently importing individual player data for previous seasons — it’s simply too time-consuming. I’ll likely create a batch process to do this in the future, but for now there are ways to get the data in (there are just no records for it to show up in ;) )

Import Manually (for those non-MFL seasons of data)

  1. Enter the season year and click continue
  2. This screen will show the league settings from the closest season already in the database. Review these to make sure they are correct for the year you are importing, change any that need changing and continue.
  3. The next screen gives you the option to edit your conference and/or division names for that season
  4. Then, you will select which teams were active in that season, and align them to the appropriate division/conference
    • If a “current” team had a different name in the season you are importing, enter the previous season name in the input text box
    • If you have a NEW TEAM, select *** NEW TEAM *** and enter the team name in the input box
  5. The following screen will instruct you on how to format a spreadsheet (CSV) file to import the game-by-game scores from this season.
    • Basically, you get 6 columns to work with (1) Week number (2) Team 1 Name/ID (3) Score for Team 1 (4) Team 2 Name/ID (5) Score for Team 2 (6) Home Team Name/ID
    • You can use team names or team ID numbers in the spreadsheet
    • Make sure to save the spreadsheet in .csv format using commas as the seperator
  6. After clicking continue, assuming the file was ok, you’ll see the first five rows of data and a number of records. Use this to make sure your file was ok. On top of that, there is a section for mapping teams (if for some reason it wasn’t able to find matches for every team name/id entry). Double check all of this mapping. When you’re satisfied, click continue
  7. You’re done! The games are imported!

An additional note on importing season data from older myfantasyleague seasons, especially those that occurred before MFL introduced Playoff Brackets:

Games MUST be scheduled in your MFL league in order to properly import.

I’ve noticed that some leagues from the late 90’s/early 00’s handled the playoffs very manually in MFL – simply using the lineup scores to manually determine weekly playoff winners. Unfortunately, from a League History perspective, this looks like there were no games played in those weeks.

To fix this for League History purposes, please log in to your previous MFL season and schedule the playoff games. Then, import the season into League History (and edit the Season Settings if needed). If you’ve already imported the season, you can use the “Refresh Games Data” option after adding the games to your MFL schedule.

4 comments August 6th, 2005

How-To: Maintain Season

This is an option you’ll definitely want to use to make sure your postseason data is correct.

Note: One of the limitations of the import from MyFantasyLeague is that we can’t identify which playoff week games are “official” playoff matchups. Therefore, you need to manually make that setting here. Hopefully we can work with MFL to improve this in the future!

There are a number of options you can access from this page (and it’s also a great place to go to view all of the seasons currently in your database):

Edit Season Settings
BE VERY CAREFUL WITH THIS ONE!

  • This is where you would go if for some reason the import didn’t understand your playoff week setup correctly. For example, I’ve seen a situation or two where the import thought that the regular season went from leagues 1-17, when in fact, the playoffs started in week 13.
  • You can edit the start week, number of regular season weeks, number of playoff weeks, league name, and names of conferences/divisions here

Rebuild Season Summary
This will rebuild your season summary if for any reason something doesn’t look right

Edit Matchups

  • This will display every game that occurred during your playoff weeks
  • You can identify each game as one of three types:
    • Playoff – Your official championship bracket games — these are included in your postseason records
    • Toilet Bowl – These games will have their own records as Toilet Bowl matchups
    • Other – Other postseason games (week 17 free-for-all, 7th place games, etc) — these are currently NOT included in any records. Essentially, this is the setting to use to tell League History to ignore these games.

Edit Qualifiers/Champs
Another IMPORTANT one (at least for some records) – this is where you identify Division and League champs, Toilet Bowl champs and playoff seeds

  • Division Champ, Conference Champ, League Champ and Toilet Champ are simply check boxes — make sure you click only the ones needed
  • Playoff seed will impact some records, and must be a number
  • Note: There is currently no validation that you say, only have one league champ or only have one #1 seed. Hopefully soon, but it’s not validated now — so be careful!

Import Player Stats
This brings up a screen showing each week in the selected season and allows you to manually trigger an import of the player stats for that week. This will supplement the future batch import process for Individual Player records.

Delete Season
This option will, ummm, delete that season. This is a way to just clear out one year of data if something goes wrong and you just want to start from scratch

Refresh Games Data
This option (only available for years when you used MyFantasyLeague) will delete all of the games data and re-import from MFL. This will be useful for 2005 if you change your schedule between now and the start of the season, or for previous years if you need to refresh the games data for some reason.

Note: The Refresh Games option does not allow re-mapping of teams for that year. If this is something you need to do, you currently need to delete the season and re-import from scratch.

Add comment August 4th, 2005

How-To: Showing your League History on your MyFantasyLeague site

If you are interested in displaying the League History records on your MyFantasyLeague site, one option is to paste the following code into the large text entry box for additional league history located under For Commissioners/League History Setup:

<iframe src="http://www.mflhistory.com/leaguehistory.php?id=ID" width=600px height=600px></iframe>

where ID is the unique ID assigned to your league history.

Feel free to adjust the width and height pixel settings to whatever looks best on your site.

3 comments August 4th, 2005

How-To: Layout Options

From this section of options, you can do a number of things that directly impact what you and your league owners will see when they view your League History:

First off, you can enter a URL to a custom CSS page to format your League History to your specifications (similar to the feature introduced this year by MyFantasyLeague). One option for this is to use the same CSS as your league page at MFL, so your history is formatted the same as your league pages.

In addition, you can modify several settings for each set of records:

  • Display Toggle — you can decide to show/not show each record type individually using this checkbox
  • Description — Don’t like the generic record name? No problem, create your own here.
  • How Many? — this setting determines how many values to show on each record list (ties will also be shown)
  • To Qualify — a few records have a setting which determines the minimum number of games needed to qualify for inclusion (e.g., the career winning pct would be skewed heavily to brand new teams who start out 2-0)
  • Sequence — this determines the order in which the record will be shown in that particular record section. The order is across, then down. Note that records will start in the next row if the screen width won’t allow them to stay in the current row.

Add comment August 4th, 2005


Calendar

September 2010
M T W T F S S
« Nov    
 12345
6789101112
13141516171819
20212223242526
27282930  

Posts by Month

Posts by Category