Jump to content


Photo

Offseason Script Removal


1 reply to this topic

#1 theeohiostate

theeohiostate

    Veteran

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

Posted 14 January 2022 - 07:23 AM

During the offseason you may want to remove some scripts from running on your site. This may be a good idea for dynasty leagues with activity in the offseason or regular leagues to clean up the site when not being used.

 

Place the following in your header marked script , directly above the cache.js file (for MFL Scripts template users place above the header.js file in HPM#1)

 

We are defining the NFL offseason as the day after the superbowl each season until the day prior to the kickoff of the first preseason game.

 

In the following script , you may define your own time frame if our default one does not align with your needs. To do so set these vars

 

var setCustomDates = true;  // set this to true to run your own custom dates
var nflStartWk = "08/04/2021";     // define a date 1 day prior to when you want offseason script to start
var nflEndWk = "02/14/2022";     // define a date 1 day after you want offseason scripts to be removed 

 

 

 

if you are ok with the offseason dates we define by default , then remove the section above from the full code you find below. Just delete them all in their entirety. 

 

The next section of the full code pertains to individual scripts you can deactivate for the offseason. Currently we have 12 scripts we feel should be deactivated during the offseason months. You can set them to true or false.

// Hide these scripts in offseason
var ir_offseason_hide = true;       	//set to true to hide the ir report during the offseason
var live_offseason_hide = true;        	//set to true to hide the mfl live during the offseason
var marq_offseason_hide = true;        	//set to true to hide the marquee during the offseason
var mini_offseason_hide = true;        	//set to true to hide the mini boxscores during the offseason
var schedule_offseason_hide = true;   	//set to true to hide the NFL Schedule during the offseason
var overview_offseason_hide = true;    	//set to true to hide the Overview Script during the offseason 
var playoff_offseason_hide = true;	//set to true to hide the Playoff Script during the offseason
var allPlay_offseason_hide = true;	//set to true to hide the All Play Script during the offseason
var mondayNight_offseason_hide = true;	//set to true to hide the Monday Night Script during the offseason
var lineupAlert_offseason_hide = true;	//set to true to hide the Lineup Alert Script during the offseason
var irAlert_offseason_hide = true;	//set to true to hide the IR Alert Script during the offseason
var survivor_offseason_hide = true;     //set to true to hide the Survivor Script during the offseason

 

 

 

Lastly we give a variable to remove individual elements in the offseason , these can be tabs , reports , tables.  List each uiniqueID or className separated by a comma (,) and the script will hide those elements from displaying in the defined offseason months. If your not wanting to hide anything , then just remove that variable , in the example below , i'm hiding several tabs , and a class for some elements

// optional var to hide individual elements during the offseason
var hide_extra = ".offseason-hide,#tab7,#tab8"; // use id(#) or class(.) element name to hide any item during NFL offseason 

 

 

 

 

 

Here is the full code , be sure to remove the "var"s you don't want to use and just leave the ones you are using.

<!-- HIDE IN OFFSEASON -->
<script>
// Below is example of the 2021 season - start date 1 day prior to preseason game 1 , end date 1 day after Superbowl
var setCustomDates = true;
var nflStartWk = "08/04/2021";  	// define a date 1 day prior to when you want offseason script to start
var nflEndWk   = "02/14/2022";  	// define a date 1 day after you want offseason scripts to be removed

// Hide these scripts in offseason
var ir_offseason_hide = true;		//set to true to hide the ir report during the offseason
var live_offseason_hide = true;		//set to true to hide the mfl live during the offseason
var marq_offseason_hide = true;	    	//set to true to hide the marquee during the offseason
var mini_offseason_hide = true;		//set to true to hide the mini boxscores during the offseason
var schedule_offseason_hide = true;	//set to true to hide the NFL Schedule during the offseason
var overview_offseason_hide = true;	//set to true to hide the Overview Script during the offseason
var playoff_offseason_hide = true;	//set to true to hide the Playoff Script during the offseason
var allPlay_offseason_hide = true;	//set to true to hide the All Play Script during the offseason
var mondayNight_offseason_hide = true;	//set to true to hide the Monday Night Script during the offseason
var lineupAlert_offseason_hide = true;	//set to true to hide the Lineup Alert Script during the offseason
var irAlert_offseason_hide = true;	//set to true to hide the IR Alert Script during the offseason
var survivor_offseason_hide = true;     //set to true to hide the Survivor Script during the offseason

// optional var to hide individual elements during the offseason - example below
var hide_extra = ".offseason-hide,#tab7,#tab8"; // use id(#) or class(.) element name to hide any item during NFL offseason
</script>

 

 

 

If you want to deactivate all eligible scripts in the offseason , then instead of setting each individually as shown above , you can use this var instead and deactivate them all "deactivate_all_offseason"

<!-- HIDE IN OFFSEASON -->
<script>
// Below is example of the 2021 season - start date 1 day prior to preseason game 1 , end date 1 day after Superbowl
var setCustomDates = true;
var nflStartWk = "08/04/2021";  	// define a date 1 day prior to when you want offseason script to start
var nflEndWk   = "02/14/2022";  	// define a date 1 day after you want offseason scripts to be removed

// Hide these scripts in offseason
var deactivate_all_offseason = true;     //set to true to deactivate ALL eligible scripts during the offseason

// optional var to hide individual elements during the offseason - example below
var hide_extra = ".offseason-hide,#tab7,#tab8"; // use id(#) or class(.) element name to hide any item during NFL offseason
</script>

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,394 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 16 January 2022 - 09:06 AM

12 scripts are added for offseason deactivation , I'm not seeing any others that would need added


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 !!




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users