Jump to content


Photo

MFL History


41 replies to this topic

#1 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,776 posts
  • Gender:Male
  • Location:Leamington ON, Canada

  • 2020 MFL: 55681
  • , 18835

Posted 06 January 2020 - 11:06 AM

TheeOhiostate and I have been working on a league history script over the last 6 weeks or so and we are ready to share.

 

Here is the report on one of my sites: https://www81.myfant...&O=247&SEQNO=19

 

MFL does have it's own history reports under menu item REPORTS>RECORDS which links to several different pages.  Our report is an all-in-one package that uses tabs and popups to show everything that MFL has and more but all in one page load.

 

We do not use the information from these reports as generated by MFL but rather crunch all our own data from the API and store it on TOS's server.

 

IMPLEMENTATION

 

1. Be sure to have a copy of jQuery library and font awesome in your header message. If already using other scripts created , you may already have this. But double check....

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="//use.fontawesome.com/6ccd97559b.js"></script>

 

2. Copy and Paste the following CSS to a regular HPM (not a header or footer).  Change colors to suit your site.  Note we are using CSS variables.  

<style>
/**********************************************/
/*              CSS VARIABLES                 */
/**********************************************/
.hs_tabs_wrap,.ls-history-modal {

	/*color settings and cog wheel*/
	--color-settings:#000;
    
	/*color of input checkbox when "checked"*/
	--checkbox-check:green;
		
	/*color of input checkbox when "unchecked"*/
	--checkbox-box:red;
		
	/*popup box - text color or wins "W"*/
	--popup-win:green;
		
	/*popup box - text color or losses "L"*/
	--popup-loss:red;
		
	/*popup box - text color or ties "T"*/
	--popup-tie:orange;
		
	/*popup bg color for the title text of Season and Playoffs*/
	--popup-th-bg:#eee;
		
	/*color text for loggeed in user franchise name and info*/
	--my-franchise:#000;
		
	/*logged in user tablerow bg color*/
	--my-franchise-bg:#FFFBCC;
		
	/*border below each stats table to show separation of table - Team Points Tables*/
	--table-separate:2px solid #ddd;
		
	/*color the font awesome (---) and (x) shown in tables*/
	--dash-x-boxes:#999;
		
	/*set bg color of the table header (th)*/
	--table-header-bg:#006db0;
	/*if above background color is set to transparent you must set the following to a solid color
	so that when table is scrolled the fixed leftside th content is not transparent and will not
	show table data underneath it - if above is set to solid color just set this to same color*/
	--table-header-bg-fixed:#006db0;

	/* set text color for defunct franchises */
	--defunct-bg-text:#fff;
	/* set bg color for defunct franchises */
	--defunct-bg:#f94c56;
	/*if above background color is set to transparent you must set this to a solid color
	so that when table is scrolled the fixed leftside content is not transparent and will not
	show table data underneath it - if above is set to solid color just set this to same color*/
	--defunct-bg-fixed:#f94c56;

	/*when user franchise has multiple table rows highlighted in succession , then put border to show separation*/
	--highlight-separate: 1px solid #eee;
} 
</style>

 

3. Copy and Paste the following to the same HPM as above.

<!-- DIV BELOW IS THE ONLY REQUIRED HTML -->
<div id="league-history-wrapper" class="mobile-wrap" style="margin-top:20px"></div>

<script>
//LEAGUE HISTORY OPTIONAL SETTINGS
var lh_commish_franchise_id = '0001'; //ASSIGN COMMISSIONER FRANCHISE FOR MY_FRANCHISE HIGHLIGHTS
var lh_abbrev_max_length = 3;         //IF MFL FRANCHISE ABBREV IS MISSING THEN SCRIPT WILL CREATE, YOU CAN SET MAX LENGTH
var lh_name_icon_logo = 0;            //0=name; 1=icon; 2=logo; 3=icon+name;4=logo+name; (active franchises only: 5=icon; 6=logo; 7=icon+name; 8=logo+name)
var lh_abbrev_icon_logo = 0;          //0=abbrev; 1=icon; 2=logo; 3=icon+abbrev;4=logo+abbrev; (active franchises only: 5=icon; 6=logo; 7=icon+name; 8=logo+name)

var lh_fname_override = new Array();  //ONLY USE TO RE-NAME DEFUNCT FRANCHISES; USAGE 'YEAR_FID' = 'NAME'
//lh_fname_override['2005_0005'] = 'Dawgs';

var historicalAwards = new Array();   //ASSIGN LEAGUE AWARDS - SPELLING OF AWARDS MUST MATCH IN ORDER TO BE INCORPORATED
historicalAwards["League Champion"] = '<i class="fa fa-trophy ls-league-award"   style="color:goldenrod" aria-hidden="true"></i>';
historicalAwards["Second Place Overall"] = '<i class="fa fa-trophy ls-league-award"   style="color:darkgray" aria-hidden="true"></i>';
historicalAwards["Highest Scorer"] = '<i class="fa fa-bookmark ls-league-award" style="color:blue" aria-hidden="true"></i>';
</script>

<script src="//nitrografixx.com/MFLHistory/history.js"></script>

 

Most of the customization vars are self-explanatory but here is an explanation on the ones that are not.

 

lh_fname_override is an array that renames historical franchises. Some leagues have the same franchise/owner changing the name from one season to another.  For active franchises this is not an issue because the script automatically syncs historical franchise names to the current season.  The issue is with defunct franchises.  There is no way to link defunct franchises other than by having an identical name.  If you want your defunct franchises linked and they have had name changes over their history then use this var to rename the franchise.  In the example above lh_fname_override['2005_0005'] = 'Dawgs' means that in 2005 franchise id 0005 will be given the name Dawgs.

 

historicalAwards is an array that will assign a font awesome image to a defined award. You are not restricted to font-awesome but you can use any image or any other notation. MFL has a few default award names and the option to create custom awards.  Simply use the name of the award (spelling matters) to incorporate these awards into the table.

 

 

Once you have saved the script to an HPM there will be an admin tab visible to commissioner only.  In that tab there is an explanation on how to implement the script.  If you have any problems then please ask as a reply to this post and be sure to include your league id.

 

You can incorporate the script in a tab on the home page or a separate page gotten to via a link.  Our preference is always a separate page as the home page should be reserved for items that are looked at regularly.

 

EDITED JANUARY 10:

- most were not including CSS so I have changed the order of implementation so that it makes it obvious that CSS is required

- not applicable for contest type leagues since there are no head to head matchups

- if any of your historical leagues are set to private then the script will not pull in data for those years.  If you want to use this report you can temporarily change historical seasons to public then once processed change them back to private.


My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#2 BobA

BobA

    Veteran

  • Members
  • PipPipPip
  • 822 posts
  • Gender:Male
  • Location:Houston, Texas

  • 2020 MFL: 44355

Posted 06 January 2020 - 05:31 PM

Really nice. I added it to my league site and will poke around a bit. Thanks again for all you guys do for the community.


2020 League Home

 

The Ed Hughes Football League, Since 1980
2020...Our 41st Season!! 


----------
"Yes, well, everybody in Casablanca has problems. Yours may work out." -Rick Blaine


#3 Despondence

Despondence

    Veteran

  • Members
  • PipPipPip
  • 34 posts
  • Gender:Male

Posted 07 January 2020 - 09:26 AM

This is awesome thank you! I know nothing about coding or script but plugged this and no problems.

http://www68.myfanta...19/home/66831#0

I was wondering if someone could help me implement the 2020 paid teams box found on this site above that I'm in. I've tried myself and no luck. I would be trying to integrate into my one league I host.

http://www60.myfanta...19/home/20663#0

Thanks

#4 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,607 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 09 January 2020 - 07:12 AM

habman,

 

Great add-on!.  You might have put MFL History out of business  :ph34r:

 

Since I drastically changed many of the parameters for PROgnosticators this year I deleted all historical franchises.

 

But in doing so, no league records were generated for the League for the 1st week of this Playoff League.

 

I'm still checking to see if its really because there are no historical leagues (I've added back the 2017 site - at least temporarily) to see if not having any historical leagues loaded is the reason nothing is populating.  I'm currently waiting the records/history to update (24 hours).

 

FYI  - MFL's League Records do populate with just 2019 data.

 

I let you know tomorrow what / if anything changes, but I thought you should be aware of this. 


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#5 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,564 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 09 January 2020 - 07:23 AM

Mitch

 

THIS is NOT for use with leagues like that , far too many turnovers each season , you will have 100s of teams , not practical use for this script


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#6 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,607 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 09 January 2020 - 07:36 AM

Ahh, makes sense, even though I wasn't going to change any franchise names.  

 

I guess I'll delete the script for this league.


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#7 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,564 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 09 January 2020 - 09:18 AM

Ahh, makes sense, even though I wasn't going to change any franchise names.  

 

I guess I'll delete the script for this league.

 

 

This is designed for H2H leagues , cause most of the data is schedule , players assigned to single rosters , combined points of matchups etc....

 

This will not work properly for contest or all play leagues


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#8 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,564 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 09 January 2020 - 10:05 AM

Here are 2 of my personal leagues with history script installed. The variable css is adjusted for each skin

 

https://www63.myfant...MODULE=MESSAGE6

 

https://www57.myfant...MODULE=MESSAGE6


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#9 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,564 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 09 January 2020 - 10:12 AM

script edited to work on MFL Addons template


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#10 Despondence

Despondence

    Veteran

  • Members
  • PipPipPip
  • 34 posts
  • Gender:Male

Posted 09 January 2020 - 10:37 AM

My pop-up box colors don't match. I don't know enough about this stuff to really be messing with it. Any recommendations?

#11 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,564 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 09 January 2020 - 01:46 PM

My pop-up box colors don't match. I don't know enough about this stuff to really be messing with it. Any recommendations?

 


Did you include the css in your homepage message mentioned in initial post ? And then change the coloring to match your site

 

When posting for help , include a direct link to the page where your showing the script

 

 

<style>
/**********************************************/
/*              CSS VARIABLES                 */
/**********************************************/
.hs_tabs_wrap,.ls-history-modal {

	/*color settings and cog wheel*/
	--color-settings:#000;
    
	/*color of input checkbox when "checked"*/
	--checkbox-check:green;
		
	/*color of input checkbox when "unchecked"*/
	--checkbox-box:red;
		
	/*popup box - text color or wins "W"*/
	--popup-win:green;
		
	/*popup box - text color or losses "L"*/
	--popup-loss:red;
		
	/*popup box - text color or ties "T"*/
	--popup-tie:orange;
		
	/*popup bg color for the title text of Season and Playoffs*/
	--popup-th-bg:#eee;
		
	/*color text for loggeed in user franchise name and info*/
	--my-franchise:#000;
		
	/*logged in user tablerow bg color*/
	--my-franchise-bg:#FFFBCC;
		
	/*border below each stats table to show separation of table - Team Points Tables*/
	--table-separate:2px solid #ddd;
		
	/*color the font awesome (---) and (x) shown in tables*/
	--dash-x-boxes:#999;
		
	/*set bg color of the table header (th)*/
	--table-header-bg:#006db0;
	/*if above background color is set to transparent you must set the following to a solid color
	so that when table is scrolled the fixed leftside th content is not transparent and will not
	show table data underneath it - if above is set to solid color just set this to same color*/
	--table-header-bg-fixed:#006db0;

	/* set text color for defunct franchises */
	--defunct-bg-text:#fff;
	/* set bg color for defunct franchises */
	--defunct-bg:#f94c56;
	/*if above background color is set to transparent you must set this to a solid color
	so that when table is scrolled the fixed leftside content is not transparent and will not
	show table data underneath it - if above is set to solid color just set this to same color*/
	--defunct-bg-fixed:#f94c56;

	/*when user franchise has multiple table rows highlighted in succession , then put border to show separation*/
	--highlight-separate: 1px solid #eee;
} 
</style>

FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#12 Despondence

Despondence

    Veteran

  • Members
  • PipPipPip
  • 34 posts
  • Gender:Male

Posted 09 January 2020 - 02:31 PM

http://www60.myfanta...19/home/20663#0

I did and tried finding my colors. Like I said I don't know anything about this stuff. Got pretty close but the pop up is unaffected.

#13 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,564 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 09 January 2020 - 02:39 PM

http://www60.myfanta...19/home/20663#0

I did and tried finding my colors. Like I said I don't know anything about this stuff. Got pretty close but the pop up is unaffected.

 

 

Here is the css edited for your site - i removed all the descriptive css so its condensed , but you can add that back if you want

 

<style>
.hs_tabs_wrap, .ls-history-modal {
    --color-settings: #fff;
    --checkbox-check: lime;
    --checkbox-box: red;
    --popup-win: lime;
    --popup-loss: red;
    --popup-tie: orange;
    --popup-th-bg: #111;
    --my-franchise: #000;
    --my-franchise-bg: #FFFBCC;
    --table-separate: 2px solid #444;
    --dash-x-boxes: #999;
    --table-header-bg: #111;
    --table-header-bg-fixed: #111;
    --defunct-bg-text: #000;
    --defunct-bg: red;
    --defunct-bg-fixed: red;
    --highlight-separate: 1px solid #444;
}
.ls-modal-content {
    background-color: #111;
}
</style>

FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#14 Despondence

Despondence

    Veteran

  • Members
  • PipPipPip
  • 34 posts
  • Gender:Male

Posted 09 January 2020 - 05:52 PM

Thanks a lot for the assistance. Where could I find my css color scheme in case I need it for future use?

#15 UFFLCommish

UFFLCommish

    Veteran

  • Members
  • PipPipPip
  • 436 posts
  • Gender:Male
  • Location:Green Bay, WI

Posted 11 January 2020 - 02:31 AM

Very nice work. Looks like everything shows up for the 2019 season except for the awards. Will those appear when the 2020 sites are setup?





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users