Jump to content


Photo

External History - MFL Scripts


1 reply to this topic

#1 theeohiostate

theeohiostate

    Veteran

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

Posted 22 December 2020 - 09:27 AM

Please use this thread to post all questions related to the External 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.

 

ATTENTION: This script is no longer being supported. It has been replaced with the Integrated History Script

 

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"; 

 

 

 

 

 

EXTERNAL HISTORY SCRIPT INSTALLATION

Place the script in any homepagemessage and link to it (do NOT mark as a header or footer). This script is only for those who have purchased MFLHistory.com addon and want to embed it within their MFL page. The script uses custom tabs which also must be installed, you can find that script here

<script>
 var mflHistoryId = 430;  // CHANGE 3 DIGIT HISTORY ID TO MATCH YOUR MFL HISTORY URL
</script>

<!--  HISTORY TABS HTML -->
<div id="mflhistory">
    <div id="admin"></div>

    <div id="myfantasyleague_tabs" class="mobile-wrap">
        <table class="homepagemodule report" id="tab_mflHistory" cellspacing="1" align="center">
            <caption><span>MFL History</span>
            </caption>
            <tbody></tbody>
        </table>
        <div class="toggle_tabs">
            <table class="report">
                <tbody>
                    <tr>
                        <td>
                            <div class="myfantasyleague_tabmenu">
                                <span id="tab_title_2000">2000</span>
                                <input id="sub2000" type="checkbox">
                                <label for="sub2000"><span></span>
                                </label>
                                <ul id="homepagetabs">
                                    <li id="tab2000" onclick="javascript:show_custom_tab('2000');"><a class="no-sub">Single Game<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2001" onclick="javascript:show_custom_tab('2001');"><a class="no-sub">Single Season<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2002" onclick="javascript:show_custom_tab('2002');"><a class="no-sub">Career<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2003" onclick="javascript:show_custom_tab('2003');"><a class="no-sub">PostSeason<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2004" onclick="javascript:show_custom_tab('2004');"><a class="no-sub">Milestones<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2005" onclick="javascript:show_custom_tab('2005');"><a class="no-sub">Players<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2006" onclick="javascript:show_custom_tab('2006');"><a class="no-sub">Standings<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2007" onclick="javascript:show_custom_tab('2007');"><a class="no-sub">Team Pages<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                    <li id="tab2008" onclick="javascript:show_custom_tab('2008');"><a class="no-sub">Game Center<input id="sub2000" type="checkbox"><label for="sub2000"></label></a>
                                    </li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="tabs_scroll">
                <div id="tabcontent2000" class="homepagetabcontent">
                    <div id="mfl-singlegame"></div>
                </div>
                <div id="tabcontent2001" class="homepagetabcontent">
                    <div id="mfl-singleseason"></div>
                </div>
                <div id="tabcontent2002" class="homepagetabcontent">
                    <div id="mfl-career"></div>
                </div>
                <div id="tabcontent2003" class="homepagetabcontent">
                    <div id="mfl-postseason"></div>
                </div>
                <div id="tabcontent2004" class="homepagetabcontent">
                    <div id="mfl-milestones"></div>
                </div>
                <div id="tabcontent2005" class="homepagetabcontent">
                    <div id="mfl-players"></div>
                </div>
                <div id="tabcontent2006" class="homepagetabcontent">
                    <div id="mfl-standings"></div>
                </div>
                <div id="tabcontent2007" class="homepagetabcontent">
                    <div id="mfl-teampages"></div>
                </div>
                <div id="tabcontent2008" class="homepagetabcontent">
                    <div id="mfl-gamecenter"></div>
                </div>
            </div>
        </div>
    </div>
    <script>
        show_custom_tab(2000);
    </script>
</div>

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

 

 

 

 

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 reddog25

reddog25

    Veteran

  • Members
  • PipPipPip
  • 152 posts
  • Gender:Male
  • Location:Alabama

Posted 23 February 2021 - 10:59 AM

I believe the script above is incorrect. <script src="https://www.mflscrip...ernal/script.js"></script>  When I removed the second /mflscripts.com the script worked and my history displayed.


Thanks,

Reddog




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users