Jump to content


Photo

misc tid bits


38 replies to this topic

#31 edytwinky

edytwinky

    Veteran

  • Members
  • PipPipPip
  • 178 posts

Posted 09 August 2015 - 09:37 AM

Thanks for the tip. Do you load this into the header as well?

#32 theeohiostate

theeohiostate

    Veteran

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

Posted 09 August 2015 - 09:39 AM

yes in a header message


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


#33 theeohiostate

theeohiostate

    Veteran

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

Posted 14 August 2015 - 06:31 PM

leagues using conferences and divisions , wishing to remove all the conference names in the standings report before the " - " mark

<script type="text/javascript">
$(document).ready(function () {  
  // REMOVE CONFERENCE NAMES
  $('#standings h3').each(function() {
   var current_text = $(this).html(),
       exploded_text = current_text.split('-'),
       last_part = exploded_text.pop();
   $(this).html(last_part.trim());
  }); 
});
</script>

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


#34 theeohiostate

theeohiostate

    Veteran

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

Posted 16 August 2015 - 02:55 PM

the MFL footer offers an anchor link that is updated with each url page to get you back to the top of the page , however its not smooth and just does a page jump

 

so here is some jQuery to make the scroll to top animated , so its nice and fluid

<script type="text/javascript">
$(document).ready(function () {
        // ANIMATE BACK TO TOP OF PAGE BUTTON IN MFL FOOTER
        var $root = $('html, body');
        $('.pagefooter a').click(function() {
          var href = $.attr(this, 'href');
          $root.animate({
             scrollTop: $(href).offset().top
          }, 500, function () {
          window.location.hash = href;
        });
        return false;
        });
        $('.pagefooter a:contains(Back To Top Of Page)').addClass('button');
});
</script> 

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


#35 theeohiostate

theeohiostate

    Veteran

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

Posted 16 August 2015 - 03:24 PM

edited above post to add class to "back to top of page" link so you can style like a button

 

here is css to style like a button and position it on page where it can be useful

.pagefooter {
     position:relative;
     height:0px;
}
.pagefooter td{
     color:transparent;
     font-size:0;
}
a.button {
     cursor: pointer;
     margin: 2px;
     padding: 4px ! important;
     text-transform: uppercase;
     font-family: "Oswald",sans-serif ! important;
     font-style: normal;
     font-weight: 400;
     text-transform: uppercase;
     border-radius: 5px;
     border: 1px solid #111;
     text-decoration:none;
     position:fixed;
     bottom:5px;
     right:5px;
     font-size:9pt;
     color:#fff!important;
}
a.button:hover {
     color: #91b6ff!important;
}

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


#36 mays66

mays66

    Veteran

  • Members
  • PipPipPip
  • 94 posts
  • Gender:Male

Posted 23 August 2015 - 02:27 PM

OS, Your work on this site has been outstanding. I added the script below and now the top of my league banner has been covered up. Is there a way to lower my banner a little so the top shows?

Website is 49159

 

 

 

<!------  ONLY NEEDED IF YOUR NOT ALREADY LOADING A LOAD JQUERY LIBRARY ------>
<script src="http://www.nitrograf...query-1.11.0.js" type="text/javascript"></script>

<!--------------- Mobile and Tablet Device Detection Script ------------------>
<script src="http://nitrografixx....ce_detection.js"></script>

<!-------------------------- Add Custom Stylesheet --------------------------->
<link rel="stylesheet" href="http://nitrografixx....dynamicmenu.css" type="text/css"/>

<script type="text/javascript">
<!--

// CUSTOM LINKS FOR DYNAMIC MENU
// Initial Custom Link Array
var customPureCssLinks = new Array();

// Add links by first declaring the menu or sub-menu link
// is to be shown in.  Then add links by declaring new array
// with "url", "link name", "link position" where 0=top 1=bottom

customPureCssLinks["League"] = new Array();
customPureCssLinks["League"][0] = new Array("http://%HOST%/%YEAR%...MODULE=MESSAGE8","Live Scoreboard",0);

// -->

</script>

<!-------------------------- Load Pure Menu Script --------------------------->
<div style='text-align:center'>
<script type="text/javascript" src="http://nitrografixx....u/puremenuV3.js"></script>
</div>

<!--  ADD HOME BUTTON TO MENU REMOVE THIS IF YOU DO NOT WANT TO SHOW -->
<script type="text/javascript">
$(function(){
$("#menu ul li:eq(0)").before('<li><a href="http://%LIVESCORINGH...home/%LEAGUEID%">Home</a></li>');
});
</script>



#37 theeohiostate

theeohiostate

    Veteran

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

Posted 23 August 2015 - 06:27 PM

You just need to add some padding or margin to the banner or page header in your CSS file is all

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


#38 sackdaddy

sackdaddy

    Veteran

  • Members
  • PipPipPip
  • 70 posts
  • Gender:Male

Posted 07 May 2017 - 03:39 PM

just spinning the wheels a little , thoughts on making a popup like so....

 

if you click any franchise icon , a popup window displays (same as player popup) , and you have tabs where you can view that specific teams roster , schedule , offer a trade , and have a link to their homepage, as the MFL default does. Currently redirecting to the teams roster or homepage is just another wasted use of a link ,  but a popup with some team info might be a decent idea

This would be awesome. I thought I'd read through this whole post a number of times, but found a couple new items I need to tinker with.



#39 sackdaddy

sackdaddy

    Veteran

  • Members
  • PipPipPip
  • 70 posts
  • Gender:Male

Posted 21 October 2018 - 04:08 PM

This might be useful to some wanting to show , hide , add different style depending on if the user logged in is a commissioner / owner / guest. Add to header message

 

This will add a unique class tag to the body of each mfl page , which will allow you to use css to hide items based on user permissions.

 

All logged in owners will have a body.owners-only

Commissioner will have a body.commish-only

And guest will have a body.guest-only

<script type="text/javascript">
$(document).ready(function () {
  if((typeof franchise_id !== 'undefined') && (franchise_id >= parseInt("0000") || franchise_id<=parseInt("0096"))){
    $('body').addClass('owners-only');
      if(franchise_id=="0000") {
        $('body').addClass('commish-only').removeClass('owners-only');          
      }
  }
  else{
    $('body').addClass('guest-only');

    // REDIRECT ALL GUESTS TO THE LOGIN PAGE - NO CUSTOM HTML - CSS - SCRIPTS CAN BE SEEN BY ANY GUEST
    //var url = "http://%HOST%/%YEAR%/login?L=%LEAGUEID%&PRINTER=1";    
    //$(location).attr('href',url);
  }

// HERE YOU CAN PLACE FUNCTIONS TO REMOVE REPORTS FROM GUEST VIEW EXAMPLE BELOW
// $('.guest-only #league_chat').remove();

});
</script> 

 

 

Example of CSS to hide modules/reports using the new class added to determine login status (i prefer using the jQuery remove method in example area above , as it removes the HTML from the DOM , whereas CSS will not)

 

You don't want guest to read your chat , in your css , just add

.guest-only #league_chat {display:none;} /* ========  or use visibility:hidden;  ======== */ 

 

You want to make some notes in your homepage message and add to your homepage , but there is no need for anyone else to see it

.guest-only #your-custom-html-id ,.owners-only #your-custom-html-id {display:none;} /* ========  or use visibility:hidden;  ======== */ 

 

 

EDIT: I stumbled across %FRANCHISEID% last night, this solves my question.

 

 

I'm curious if there's possibly a variation of this that could be used to display certain modules/images that would show for the logged in user? I'm trying to create a team locker room and I used all the 'My' modules ('My Roster' 'My Trophy Case' 'My Bye Weeks') and then hoped to used the js workaround to create a module and also display their reports from All-Time Series Records. I'd like to include a few other items, specifically the...

 

REPORTS > PLAYER > STARTER PTS - PLAYER

 

...report. Is there an easy js fix for this outside of using 12 seperate modules with each franchise's id coded in?





Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users