Jump to content


Photo

Integrated History - MFL Scripts


205 replies to this topic

#1 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 18 December 2020 - 11:22 AM

Please use this thread to post all questions related to the Integrated History script.

 

ATTENTION - ANY AND ALL SCRIPTS REQUIRE TO HAVE THIS GLOBAL CACHE SCRIPT PLACED AS THE FIRST ITEM IN YOUR HEADER MESSAGE !!! The script builds a cache for local storage and indexedDB storage in your browser to limit the API call to the MFL Server.

You only need a single copy of this  ,do not add multiple times if using multiple scripts.

<script src="https://www.mflscripts.com/mfl-apps/global/cache.js"></script>

 

See troubleshooting section at very bottom of this post before submitting a question.

 

Before installing any scripts - please review this video tutorial on how to prepare your MyFantasyLeague site for customizations.

 

Access ALL of MFLScripts here.

 

example.jpg

 

 

Most if not all of our custom scripts require the addition of a font awesome library to be loaded into a homepage message that is marked as a "Header"  OR you can import the font awesome stylesheet into your main css file , it must be the very first line in your css file. Its likely if your using any of our scripts you already have a copy loaded, so please disregard and move onto the main script installation section.

 

 

Example 1 - inserting font awesome js file into a header message

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css"/>

 

 

Example 2 - inserting font awesome into your main css file as first line in the stylesheet

@import "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css";  

 

 

 

 

INTEGRATED HISTORY SCRIPT INSTALLATION

Pace the following into any homepage message (Do not mark as a header or footer). Its recommended to create a link and link directly to the message. We recommend linking to all scripts so they don't slow down the load time for your league mates accessing the homepage. Load within your homepage tabs at your risk of slow site loading times

 

The Integrated History script uses the MFL data to create a full history of your league. This is a modified FREE version of the more comprehensive MFLHistory.com. There are a few settings to adjust for your league and you can copy the css and edit to match your site.

 

IMPORTANT !! - The history script can only be installed and ran on the current years league , so when MFL updates the sites for the previous seasons , you can not install this on the prior season.

<script>
// LEAGUE HISTORY SETTINGS
var lh_commish_franchise_id = '0004';
var lh_abbrev_max_length = 3;         	//IF MFL FRANCHISE ABBREV IS MISSING THEN SCRIPT WILL CREATE, YOU CAN SET MAX LENGTH
var lh_first_player_season = '';  	//SET TO '' OR OMIT IF ALL HISTORICAL SEASONS HAVE PLAYER STATS
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 historicalAwards = new Array();
historicalAwards["League Champion"] = '<i class="fa fa-trophy ls-league-award"   style="color:#d4af37" aria-hidden="true"></i>';
historicalAwards["Second Place Overall"] = '<i class="fa fa-bookmark ls-league-award" style="color:blue" aria-hidden="true"></i>';
historicalAwards["Highest Scorer"] = '<i class="fa fa-bookmark ls-league-award" style="color:green" aria-hidden="true"></i>';
//var lh_fname_override = new Array();

// DRAFT HISTORY SETTINGS
var load_draftHistory_script = true; 	//set to true to load the draft history script
var dh_Mobile = false;                	//set to true to display responsive css for draft table for stacked tablerows
var dh_Comments = true;               	//set to true to display the "Comments" column
var dh_sortArrow = 'white';           	//set to white or black for color of the sorting arrows in the table header - no other colors - white or black only
var dh_accumulatePts = false;         	//set to true to display accumulated pts from draft season selected and all future seasons (typically only useful for rookie drafts)
var dh_Ovr = false;                   	//set to true to display the "Ovr" column 	(default is turned off dont see need for this column)
var dh_Date = false;                  	//set to true to display the "Date/Time" column (default is turned off dont see need for this column)
var dh_Elapse = false;                	//set to true to display the "Elapsed" column 	(default is turned off dont see need for this column)

// STANDINGS HISTORY SETTINGS
var load_standingsHistory_script = true; //set to true to load the standings history script

// CONTRACT HISTORY SETTINGS
var load_contractHistory_script = true; //set to true to load the contract/salary history script
var ch_Injury = false;            	//set to true to display the "Injury" column     (default is turned off dont see need for this column)
var ch_Salary = true;            	//set to true to display the "Salary" column
var ch_Year = true;            		//set to true to display the "Year" column
var ch_Status = true;            	//set to true to display the "Status" column
var ch_Info = true;           	 	//set to true to display the "Info" column
var ch_sortArrow = 'white';        	//set to white or black for color of the sorting arrows in the table header - no other colors - white or black only
var ch_salaryDecimal = 1;           	//set the number of decimals for salary if applicable

// PLAYOFFS HISTORY SETTINGS
var load_playoffsHistory_script = true; //set to true to load the playoffs history script

// TOPS PLAYERS HISTORY SETTINGS
var load_topsHistory_script = true; 	//set to true to load the top players history script
var top_show = '250';			//set how many players you want to show - default shows 250 players
var th_sortArrow = 'white';        	//set to white or black for color of the sorting arrows in the table header - no other colors - white or black only

// TRADES HISTORY SETTINGS
var load_tradesHistory_script = true;
</script>

<!-- MFL HISTORY SCRIPT HTML -->
<div id="league-history-wrapper" class="mobile-wrap"></div>

<!-- DRAFT HISTORY HTML -->
<div id="draft-history-wrapper" class="mobile-wrap"></div>

<!-- CONTRACTS HISTORY HTML -->
<div id="contract-history-wrapper" class="mobile-wrap"></div>

<!-- PLAYOFFS HISTORY HTML -->
<div id="playoffs-history-wrapper" class="mobile-wrap"></div>

<!-- TOP PLAYERS HISTORY HTML -->
<div id="tops-history-wrapper" class="mobile-wrap"></div>

<!-- TRADES HISTORY HTML -->
<div id="trades-history-wrapper" class="mobile-wrap"></div>

<!-- MFL HISTORY SCRIPT JS FILE -->
<script src="https://www.mflscripts.com/mfl-apps/history/integrated/script.js"></script>

 

CSS

<!-- MFL HISTORY CSS -->
<style>
.hs_tabs_wrap,.ls-history-modal {

	/*color settings and cog wheel*/
	--color-settings:inherit;
    
	/*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:#e9ebf0;
	/*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:#e9ebf0;

	/* 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;
} 

/*LIGHT SKIN DRAFT HISTORY*/
.dh_comments_cell{background:#fff;border: 1px solid #ccc;color:#000}
.dh-control-setting,.th-control-setting,.trh-control-setting{color: #000}

/*DARK SKIN DRAFT HISTORY*/
.dh_comments_cell{background:#000;border: 1px solid #333;color:#fff}
.dh-control-setting,.dh-control-setting,.trh-control-setting{color: #fff}

/*LIGHT SKIN PLAYOFF HISTORY*/
.ph_tabs_scroll caption{color:#000}

/*DARK SKIN PLAYOFF HISTORY*/
.ph_tabs_scroll caption{color:#ccc}
</style>

 

 

 

TROUBLESHOOTING TIPS

 

1. Make sure to review the help video to check your league settings are setup so customized scripts can be used.

 

2. Recopy the code above and try again. Be sure your advanced editor is turned off.

 

3. Right click mouse on your page where script displays and click "Inspect Element" . In the browsers new popup window that displays , click on the "Console" tab. Now click on the "Errors" section. Here you will find a list of any errors that have occurred. Many errors our self explanatory and you can address yourself. If your error is showing cross site  CORS has been blocked , then you need to check every CSS, JS and IMAGE file on your site and be sure they all are using https  url and not http. Another error that appears could be "too many requests" , this happens when you refresh your site many times and MFL blocks your IP for 15 minutes for submitting too many API request. If thats the case , just wait 15-20 minutes and try again.

 

4. Check out the MFL Menu > Help section. We have added a new link here called "Manage Cache". By default we are caching the API files for our script in the browsers local storage. If you script isn't updating , you can force an update by clicking "Clear Local Storage". The next link is called "Enable IndexedDB" , this link is only meant to be used for owner that are getting the "Too Many Requests" error because there are using several scripts on several different MFL leagues that use the same serverID. Click this if needed more storage.

 

5. If the above wasn't any help , then post a question and we will do our best to help when the time allows.


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#2 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 18 December 2020 - 03:12 PM

there were a few forum members that had issues with their initial install of this script. That error has been fixed , so please load the script and run your updates and it should be working for you now


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#3 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 23 December 2020 - 10:02 AM

History updated - what previously took 4-8 minutes per season to update or install in a league , now takes 10-15 seconds per season.

 

MFL updated API so we can make single calls , Habman updating scripts to make them faster.


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#4 StevenB14

StevenB14

    Veteran

  • Members
  • PipPipPip
  • 76 posts

Posted 05 January 2021 - 07:54 AM

This may not be a script issue but would be grateful for any help.

 

After browsing around my league's stats I've noticed that Davante Adams is listed under 'Most Points - Non Roster' for week 16 2020.  He was started by a team in that game week so I don't think he should be shown.

 

Another issue I've come across is that the non roster report is also showing players who, although didn't play in that week, were on rosters.

 

I've hunted high and low around my settings across both of my leagues but don't seem to be able to figure out what's went wrong.

 

League Link Here

Script under History tab.



#5 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 05 January 2021 - 08:29 AM

your regular season was over in week 13 so i think thats why its showing those players were not on a roster 

 

all 3 players in question were in week 16 , when the franchises had no lineups and no matchups , and essentially season over


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#6 StevenB14

StevenB14

    Veteran

  • Members
  • PipPipPip
  • 76 posts

Posted 05 January 2021 - 08:37 AM

My other league is the same in that the regular season was over by then however Adams scored enough points to make it onto that ranking but for some reason he doesn't show.

 

League link

 

Seems to have slightly different behaviour.  In one league he shows and in another he doesn't.  Same set up with regular season weeks 1-13 then post season weeks 14-16.

 

Again, I doubt this is a script issue but just trying to get my head around how MFL is classing the entries.



#7 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 05 January 2021 - 08:53 AM

League 51427

 

i deleted your 2020 players and history files , try running the update for 2020 for player and history and see if problem fixes itself and let us know


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#8 StevenB14

StevenB14

    Veteran

  • Members
  • PipPipPip
  • 76 posts

Posted 05 January 2021 - 09:05 AM

Hi. I ran the update but it's still showing the same with Adams and also players who were on rosters.

 

Compared settings etc across both leagues as well and I can't see why one shows Adams in the non roster standings and the other doesn't.



#9 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 05 January 2021 - 09:22 AM

i will have to wait for Habman to review , i see all the correct data in the API , roster status and points are there , but in the generated 2020.js file we create it has Adams as a Free Agent , and others for Week 16 , i checked all my leagues and Adams is on a roster and showing correctly


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#10 StevenB14

StevenB14

    Veteran

  • Members
  • PipPipPip
  • 76 posts

Posted 05 January 2021 - 09:24 AM

Thanks for looking into that.  I guess that's going to be the same issue for all of the players showing in that report that are not free agents across both of my leagues.

 

It's not just 2020 for some.  I've got a player in 2016 showing as a FA in the standing but he is rostered in that league year and week.



#11 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 05 January 2021 - 09:36 AM

leagueID 51427

 

i removed all files from my server , rerun full history and players update and let me know


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#12 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 05 January 2021 - 09:42 AM

that didnt work 2020.js file still has Adams as "NS" non starter and "FA" free agent in new file generated

 

Let me rerun my league and see if there is an issue with file generated

 

"wk_16":{"score":"43.20","fid":[{"sts":"NS","fid":"FA"}]} 

All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#13 StevenB14

StevenB14

    Veteran

  • Members
  • PipPipPip
  • 76 posts

Posted 05 January 2021 - 09:43 AM

Ran that again but no change. Strange one this.

Edit:

 

Saw your post above after I posted this.



#14 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,313 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 05 January 2021 - 09:50 AM

ok one last thing to check out , then i'm at a loss

 

working fine on all my leagues and checked some others and all fine as well , files are being generated correctly

 

Go to For Commissioners , locate the section called "SCORING AND STANDINGS SETUP" and click on the "General Scoring Setup" link

 

What week do you have this ending ?  "Calculate Fantasy Results Ending on Week:

 

regardless of league or when season stops , this should be set to week 17 


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#15 StevenB14

StevenB14

    Veteran

  • Members
  • PipPipPip
  • 76 posts

Posted 05 January 2021 - 09:52 AM

I have that at 16. Always have done.  I never knew it should be set to 17.

 

I'll update that now and rerun the updates.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users