Jump to content


dejesusofnazareth

Member Since 18 Dec 2012
Offline Last Active May 24 2020 09:57 PM

Posts I've Made

In Topic: Complete list of modules

24 May 2020 - 09:59 PM

Make the banner in photoshop and load it via commissioner tools. Youd only need to add css if you are making a different banner for mobile and you dont need javascript for this.

In Topic: Weekly MVP Report Module

08 October 2019 - 01:52 AM

Different version of this for team defense leagues that will display offensive player and rookie of the week.  Make sure a jQuery library is in your header. 

 

<div id="players_of_the_week">
<script type="text/javascript" src="//www03.myfantasyleague.com/fflnet%YEAR%/mfl_player_database.js"></script> 
<script>
var html='<div id="myfantasyleague_tabs"><table class="report"><caption><span>Weekly Awards</span></caption><tbody></tbody></table>';
html+='<div class="toggle_tabs"><table class="report"><tbody><td><div class="myfantasyleague_tabmenu">';
html+="<span id='tab_title_8000'>8000</span>";
html+='<input id="sub8000" type="checkbox"><label for="sub8000"><span></span></label><ul id="homepagetabs">';
var listLength = 5; //CHANGE THIS TO THE NUMBER OF LEADERS YOU WANT TO SHOW
var rookieStart = 14055; //PUT THIS NUMBER TO EQUAL THE FIRST ROOKIE ID IN mfl_player_database.js MINUS ONE
var maxWeek = 13; //PUT THE FINAL WEEK YOU WANT TO DISPLAY HERE
var count = 500;
var tabcount = 8000;
var useYear = year;
if (completedWeek < maxWeek) {
	maxWeek = completedWeek;
} 
for (var i = 0; i < maxWeek; i++){
	var useWeek = i + 1;
	html+='<li id="tab' + tabcount + '" onclick="javascript:show_custom_tab(' + "'" + tabcount + "'" + ');"><a class="no-sub">Week ' + useWeek + '<input id="sub' + tabcount + '" type="checkbox"><label for="sub' + tabcount + '"></label></a></li>';
    tabcount++;	
}
tabcount = 8000;
html+='</ul></div></td></tr></tbody></table><div class="tabs_scroll">';
for (var j = 0; j < maxWeek; j++){
	var useWeek = j + 1;
	html += '<div id="tabcontent' + tabcount + '" class="homepagetabcontent">'
	html += '<table align="center" cellpadding="0" cellspacing="0" id="homepagecolumns"><tbody><tr>'	
	
	var htmlOne = '<td class="pow" width="50%" class="homepagecolumn" id="homepagecolumn1">';
	htmlOne +='<div style="position: relative;">'
	var htmldiv = '<div class="mobile-wrap">'
	var htmlTwo = '<td class="pow" width="50%" class="homepagecolumn" id="homepagecolumn2">';
	htmlTwo +='<div style="position: relative;">'
	
	var htmlopow = '<table align="center" cellspacing="1" class="homepagemodule report" id="off_pow"><caption><span>Offensive Player of the Week</span><tbody>';	
	var htmlorow = '<table align="center" cellspacing="1" class="homepagemodule report" id="off_row"><caption><span>Offensive Rookie of the Week</span><tbody>';	
	
	htmlopow += '<tr><th class="rank">#</th><th class="player">Player</th><th class="points">Pts</th></tr>';		
	htmlorow += '<tr><th class="rank">#</th><th class="player">Player</th><th class="points">Pts</th></tr>';	
	
	
	var url = baseURLDynamic + "/" + useYear + "/export?TYPE=playerScores&L="+ league_id +"&W=" + useWeek + "&COUNT=" + count + "&JSON=1"; 
    console.log(url);   	
	$.ajax({type: 'GET',url: url, async:false}).done(function (topWeeklyScorers) {
		var offenseList = [];		
		var offensiveRookieList = [];		
		var offenseScoreList = [];		
		var offensiveRookieScoreList = [];		
		var opowcount = 0;		
		var orowcount = 0;		
		for (var i = 0; i < topWeeklyScorers.playerScores.playerScore.length;i++) {			
			var pid = topWeeklyScorers.playerScores.playerScore[i].id;
			var pos = playerDatabase['pid_' + pid].position;			
			if (pos !== "Def"){				
				offenseList[opowcount] = pid;
				offenseScoreList[opowcount] = topWeeklyScorers.playerScores.playerScore[i].score;
				opowcount ++;
				if (parseInt(pid) > rookieStart){
					offensiveRookieList[orowcount] = pid;
					offensiveRookieScoreList[orowcount] = topWeeklyScorers.playerScores.playerScore[i].score;
					orowcount ++;
				}
			}					
		}
		var name, team, rank;
		for (var k = 0; k < listLength; k++){
			if (k%2 == 1){
				var oddEven = "odd";
			}
			else {
				var oddEven = "even";
			}
			rank = k + 1;			
			pid = offenseList[k];
			name = playerDatabase['pid_' + pid].name;			
			team = playerDatabase['pid_' + pid].team;	
			pos = playerDatabase['pid_' + pid].position;			
			htmlopow += '<tr class="' + oddEven + 'tablerow'
			if (k == 0) {
				htmlopow += ' toprank'
			}
			htmlopow += '"><td class = "rank">' +  rank  + '.</td><td class = "player"><a href = "' + baseURLDynamic + "/" + useYear + '/player?L=' + league_id + '&P=' + pid + '">' + name + ' ' + team + ' ' + pos + '</td><td class = "points">'  + offenseScoreList[k] + '</td></tr>';			
					
			pid = offensiveRookieList[k];
			name = playerDatabase['pid_' + pid].name;			
			team = playerDatabase['pid_' + pid].team;
			pos = playerDatabase['pid_' + pid].position;			
			htmlorow += '<tr class="' + oddEven + 'tablerow'
			if (k == 0) {
				htmlorow += ' toprank'
			}
			htmlorow += '"><td class = "rank">' +  rank  + '.</td><td class = "player"><a href = "' + baseURLDynamic + "/" + useYear + '/player?L=' + league_id + '&P=' + pid + '">' + name + ' ' + team + ' ' + pos + '</td><td class = "points">'  + offensiveRookieScoreList[k] + '</td></tr>';
			
		}
		var htmlend = "</tbody></table></div>";		
		html += htmlOne + htmldiv + htmlopow + htmlend + '</div></td>' + htmlTwo + htmldiv + htmlorow + htmlend + '</div></td></tr></tbody></table></div>';		
	});    
    tabcount++;		
}
html +="</div></div></div>";
$('#players_of_the_week').append(html);	
</script>
<script>
show_custom_tab(8000+maxWeek-1);
</script>
</div>

<style>
#players_of_the_week #off_pow caption, #players_of_the_week #off_row caption {display:table-caption!important;}
table#off_pow {padding-right:0.313rem;}
table#off_row {padding-left:0.313rem;}
table#off_pow, table#off_row {margin-bottom:0.313rem;}
.toprank {font-style:bold; font-size:135%;}
td.rank,th.rank,td.points,th.points {text-align:center;}
</style>            

In Topic: Weekly MVP Update

04 September 2019 - 04:04 PM

If you want to edit this yourself for future years, enter the API call https://www64.myfant...ETAILS=1&JSON=1 - where baseURLDynamic (the www64.myfantasyleague.com part) is specific to your league site and the year is whatever year it is. 

 

Then search the page for "draft_year":"2019" or "draft_year":"2020" or whatever, find the first instance in the database, subtract 1 (the script is looking for a greater than value) and put that in the two spots in the code.


In Topic: Weekly MVP Update

04 September 2019 - 03:57 PM

Change 13112 from the above code to 14055 in both instances and it'll work for 2019 rookies.  Player ID 14056 (Kyler Murray) is the starting point for 2019 drafted players IDs in MFL's system. 

 

<div id="players_of_the_week">
<script type="text/javascript" src="//www03.myfantasyleague.com/fflnet%YEAR%/mfl_player_database.js"></script> 
<script>
var html='<div id="myfantasyleague_tabs"><table class="report"><caption><span>Weekly Awards</span></caption><tbody></tbody></table>';html+='<div class="toggle_tabs"><table class="report"><tbody><td><div class="myfantasyleague_tabmenu">',html+="<span id='tab_title_8000'>8000</span>",html+='<input id="sub8000" type="checkbox"><label for="sub8000"><span></span></label><ul id="homepagetabs">';for(var count=300,tabcount=8e3,useYear=year,i=0;i<completedWeek;i++)html+='<li id="tab'+tabcount+'" onclick="javascript:show_custom_tab(\''+tabcount+'\');"><a class="no-sub">Week '+(useWeek=i+1)+'<input id="sub'+tabcount+'" type="checkbox"><label for="sub'+tabcount+'"></label></a></li>',tabcount++;tabcount=8e3,html+='</ul></div></td></tr></tbody></table><div class="tabs_scroll">';for(var j=0;j<completedWeek;j++){var useWeek=j+1;html+='<div id="tabcontent'+tabcount+'" class="homepagetabcontent">',html+='<table align="center" cellpadding="0" cellspacing="0" id="homepagecolumns"><tbody><tr>';var htmlOne='<td class="pow" width="50%" class="homepagecolumn" id="homepagecolumn1">';htmlOne+='<div style="position: relative;">';var htmldiv='<div class="mobile-wrap">',htmlTwo='<td class="pow" width="50%" class="homepagecolumn" id="homepagecolumn2">';htmlTwo+='<div style="position: relative;">';var htmlopow='<table align="center" cellspacing="1" class="homepagemodule report" id="off_pow"><caption><span>Offensive Player of the Week</span><tbody>',htmldpow='<table align="center" cellspacing="1" class="homepagemodule report" id="def_pow"><caption><span>Defensive Player of the Week</span><tbody>',htmlorow='<table align="center" cellspacing="1" class="homepagemodule report" id="off_row"><caption><span>Offensive Rookie of the Week</span><tbody>',htmldrow='<table align="center" cellspacing="1" class="homepagemodule report" id="def_pow"><caption><span>Defensive Rookie of the Week</span><tbody>';htmlopow+='<tr><th class="rank">#</th><th class="player">Player</th><th class="points">Pts</th></tr>',htmldpow+='<tr><th class="rank">#</th><th class="player">Player</th><th class="points">Pts</th></tr>',htmlorow+='<tr><th class="rank">#</th><th class="player">Player</th><th class="points">Pts</th></tr>',htmldrow+='<tr><th class="rank">#</th><th class="player">Player</th><th class="points">Pts</th></tr>';var url=baseURLDynamic+"/"+useYear+"/export?TYPE=playerScores&L="+league_id+"&W="+useWeek+"&COUNT="+count+"&JSON=1";$.ajax({type:"GET",url:url,async:!1}).done(function(a){for(var e=[],t=[],l=[],s=[],o=[],r=[],p=[],d=[],i=0,c=0,n=0,h=0,m=0;m<a.playerScores.playerScore.length;m++){var b=a.playerScores.playerScore[m].id,y=playerDatabase["pid_"+b].position;"DE"==y||"DT"==y||"LB"==y||"CB"==y||"S"==y?(t[c]=b,r[c]=a.playerScores.playerScore[m].score,c++,parseInt(b)>14055&&(s[h]=b,d[h]=a.playerScores.playerScore[m].score,h++)):(e[i]=b,o[i]=a.playerScores.playerScore[m].score,i++,parseInt(b)>14055&&(l[n]=b,p[n]=a.playerScores.playerScore[m].score,n++))}for(var u,w,v,_=0;_<5;_++){if(_%2==1)g="odd";else var g="even";v=_+1,b=e[_],u=playerDatabase["pid_"+b].name,w=playerDatabase["pid_"+b].team,y=playerDatabase["pid_"+b].position,htmlopow+='<tr class="'+g+"tablerow",0==_&&(htmlopow+=" toprank"),htmlopow+='"><td class = "rank">'+v+'.</td><td class = "player"><a href = "'+baseURLDynamic+"/"+useYear+"/player?L="+league_id+"&P="+b+'">'+u+" "+w+" "+y+'</td><td class = "points">'+o[_]+"</td></tr>",b=t[_],u=playerDatabase["pid_"+b].name,w=playerDatabase["pid_"+b].team,y=playerDatabase["pid_"+b].position,htmldpow+='<tr class="'+g+"tablerow",0==_&&(htmldpow+=" toprank"),htmldpow+='"><td class = "rank">'+v+'.</td><td class = "player"><a href = "'+baseURLDynamic+"/"+useYear+"/player?L="+league_id+"&P="+b+'">'+u+" "+w+" "+y+'</td><td class = "points">'+r[_]+"</td></tr>",b=l[_],u=playerDatabase["pid_"+b].name,w=playerDatabase["pid_"+b].team,y=playerDatabase["pid_"+b].position,htmlorow+='<tr class="'+g+"tablerow",0==_&&(htmlorow+=" toprank"),htmlorow+='"><td class = "rank">'+v+'.</td><td class = "player"><a href = "'+baseURLDynamic+"/"+useYear+"/player?L="+league_id+"&P="+b+'">'+u+" "+w+" "+y+'</td><td class = "points">'+p[_]+"</td></tr>",b=s[_],u=playerDatabase["pid_"+b].name,w=playerDatabase["pid_"+b].team,y=playerDatabase["pid_"+b].position,htmldrow+='<tr class="'+g+"tablerow",0==_&&(htmldrow+=" toprank"),htmldrow+='"><td class = "rank">'+v+'.</td><td class = "player"><a href = "'+baseURLDynamic+"/"+useYear+"/player?L="+league_id+"&P="+b+'">'+u+" "+w+" "+y+'</td><td class = "points">'+d[_]+"</td></tr>"}var f="</tbody></table></div>";html+=htmlOne+htmldiv+htmlopow+f+htmldiv+htmlorow+f+"</div></td>"+htmlTwo+htmldiv+htmldpow+f+htmldiv+htmldrow+f+"</div></td></tr></tbody></table></div>"}),tabcount++}html+="</div></div></div>",$("#players_of_the_week").append(html);	
</script>
<script>
var a = 8000 - 1 + completedWeek;
show_custom_tab(a);
</script>

In Topic: Message board CSS questions, help request

30 August 2019 - 01:35 PM

You can't hotlink from photobucket for free anymore - like many filehosts now.  You'd have to get all those images and store them on a site that still allows it - I've been using postimg lately but I'm sure they will switch to paid at some point in the upcoming years as well.  Then change the hotlinks in Commissioner's set up (Division and Conference Setup and Images and Other URLs) and in your css if you have other linked images on your site. 

 

But you don't even need to hotlink since it looks like its just the division logos and your league banner you can literally upload them to myfantasyleague and they host them. That's better for load time anyways.