Jump to content

The Official MVPSavReader Thread


Trues

Recommended Posts

i have a couple things i've noticed in my own dynasty. i don't know if this is because of statistical errors in the roster set i'm using or bugs in reading the .sav but here goes:

1. SB's for Edgar Renteria off - the overall total is correct but the individual season totals are off. If this were a roster issue i would think the whole total would be off as well.

2. Curt Schilling IP for 2001/2002 incorrect, thus ERA way off - again, career ERA is correct. also notice that Schilling pitched in Pawtucket in 2005 before the MLB squad and his MLB stats are reflected in the upper left side of the page, underneath were his picture should be. this brings me to the third 'bug', if you will...

3. David Wells' AAA stats displayed instead of MLB stats - in the upper left hand corner where normally the MLB stats should be displayed as i only created pages for MLB, the stats for AAA Pawtucket are displayed. if you notcied the career lines, Wells was in AAA after starting on the major league squad, unlike Schilling, therefore the line for AAA was created second and thus displayed. is there a way that you can call say MLB only stats to be displayed instead of the last league that the player has played in?

edit: i almost for got to thank you again for this app. you and rglass pretty much define my MVP experience with your work and i dont think i, or many people for that matter, would be as interested in this game without these two applications. thanks again.

Link to comment
Share on other sites

  • Replies 703
  • Created
  • Last Reply

Thanks Rich. I hate to make another request, especially since you haven't even released 1.5 yet. But in a future version, is there any chance of setting it up, so, when you click "create all players", only the players for the highlighted league (the box at left side of the program -- MLB, AAA, AA, A) would generate?

Updates sounds great though. Especially sortable stats. Awesome work and thank you.

i'm just guessing but i think you could make player pages for only MLB by making only team pages for selected league (MLB) and then selecting create all players pages, then make team pages for every league but just dont create anymore player pages. the html will stay there no matter, unless you go specifically to your directory and delete each page. the sav, again guessing, is decompressed into a local database which the pages are created/recreated off of.

Link to comment
Share on other sites

Tried it out...cant get it to generate league leaders page in owner mode. It just hangs....anyone else try this out yet?

Other than that its lookin like a big step up from the last one! Thanks again Rich for all the work!

EDIT: Nevermind, i just deleted all the other pages i generates using the old version and it works fine now! :lol:

Link to comment
Share on other sites

Regarding sortable stats. I'm just guessing here, as I havent tried it yet. But are you using the new css files from the fresh install? If youre uploading to a web page, make sure you upload those files as well, overwriting the old ones.

edit: nevermind. Just tried and they aren't working for me either. Hopefully it's an easy fix :)

Link to comment
Share on other sites

Regarding sortable stats. I'm just guessing here, as I havent tried it yet. But are you using the new css files from the fresh install? If youre uploading to a web page, make sure you upload those files as well, overwriting the old ones.

edit: nevermind. Just tried and they aren't working for me either. Hopefully it's an easy fix :)

I was just creating pages on the Local Output source, and it still doesn't work. I could be missing something, but yeah, hopefully it's nothing big.

Link to comment
Share on other sites

One thing I noticed Rich....

I think you have the team colors for the Devil Rays and the Marlins switched. The Marlins have a greenish color, and the Devil Rays have a turquoise color.

Or, could you just tone the Devil Rays color down (make it darker)? It is really hard to look at and read the way it is.

Link to comment
Share on other sites

good catch. that did the trick http://www.efick.com/mvp/Rosters/MLB_stats.html

______

nice. where did you get that? i ganked it off your site and voila

http://www.alitdom.com/MVP/dynasty/Rosters/MLB_stats.html

edit: lol there you go...glad it looks okay now. thought i was gonna have to suffer with that shitty font with no js in there. do your pages look a little offset tho?

Link to comment
Share on other sites

nice. where did you get that? i ganked it off your site and voila

http://www.alitdom.com/MVP/dynasty/Rosters/MLB_stats.html

edit: lol there you go...glad it looks okay now. thought i was gonna have to suffer with that [naughty word] font with no js in there. do your pages look a little offset tho?

hehe.

Offset how? the pitching area is a little bunched together, but everything lines up ok. Also, it looks a tiny bit cleaner in IE.

I absolutely love this. This was the first thing that really bothered my about mvp. I mean, its 2005 and a game doesnt have sortable teams standings page??? Well, at least it didn't, until now :) Again, a huge thanks to Rich

Link to comment
Share on other sites

for those that don't know...







1


2


3


4


5


6


7


8


9


10


11


12


13


14


15


16


17


18


19


20


21


22


23


24


25


26


27


28


29


30


31


32


33


34


35


36


37


38


39


40


41


42


43


44


45


46


47


48


49


50


51


52


53


54


55


56


57


58


59


60


61


62


63


64


65


66


67


68


69


70


71


72


73


74


75


76


77


78


79


80


81


82


83


84


85


86


87


88


89


90


91


92


93


94


95


96


97


98


99


100


101


102


103


104


105


106


107


108


109


110


111


112


113


114


115


116


117


118


119


120


121


122


123


124


125


126


127


128


129


130


131


132


133


134


135


136


137


138


139


140


141


142


143


144


145


146


147


148


149


150


151


152


153


154


155


156


157


158


159


160


161


162


163


164


165


166


167


168


169


170


171


172


173


174


175


176


177


178


179


180


181


182


183


184


185


186


187


188


189


190


191


192


193


194


195


196


197


198


199


200


201


202


203


204


205


206


207


208


209


210


211


212


213


214


215


216


217


218


219


220


221


222


223


224


225


226


227


228


229


230


231


232


233


234


235


236


237


238


239








// From: http://www.kryogenix.org/code/browser/sorttable/


// By:   Stuart Langridge




// Modified by Ian Bicking, 3 Nov 2003


// Changes:


//   * Use a sortval="val" attribute in TD tags to override sorting by


//	 the cell contents.


//   * Use sortsuppress="1" attribute in the column header to suppress


//	 sorting by that column.




// Modified on Nov. 29th, 2004


// By: Dan Mills <thunder@ximian.com>


// Changes:


//   * Only sort rows in the TBODY element (i.e., not the header or


//	 footer).






addEvent(window, "load", sortables_init);




var SORT_COLUMN_INDEX;




function sortables_init() {


	// Find all tables with class sortable and make them sortable


	if (!document.getElementsByTagName) return;


	tbls = document.getElementsByTagName("table");


	for (ti=0;ti<tbls.length;ti++) {


		thisTbl = tbls[ti];


		if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) {


			//initTable(thisTbl.id);


			ts_makeSortable(thisTbl);


		}


	}


}




function ts_makeSortable(table) {


	if (table.rows && table.rows.length > 0) {


		var firstRow = table.rows[0];


	}


	if (!firstRow) return;




	// We have a first row: assume it's the header, and make its contents clickable links


	for (var i=0;i<firstRow.cells.length;i++) {


		var cell = firstRow.cells[i];


		var txt = ts_getInnerText(cell);


		if (cell.getAttribute('sortsuppress')) {


		  continue;


		}


		cell.innerHTML = '<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'+txt+'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a>';


	}


}




function ts_getInnerText(el) {


	if (typeof el == "string") return el;


	if (typeof el == "undefined") { return el };


	if (el.innerText) return el.innerText;	//Not needed but it is faster


	var str = "";




	var cs = el.childNodes;


	var l = cs.length;


	for (var i = 0; i < l; i++) {


		switch (cs[i].nodeType) {


			case 1: //ELEMENT_NODE


				str += ts_getInnerText(cs[i]);


				break;


			case 3:	//TEXT_NODE


				str += cs[i].nodeValue;


				break;


		}


	}


	return str;


}




function ts_resortTable(lnk) {


	// get the span


	var span;


	for (var ci=0;ci<lnk.childNodes.length;ci++) {


		if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci];


	}


	var spantext = ts_getInnerText(span);


	var td = lnk.parentNode;


	var column = td.cellIndex;


	var table = getParent(td,'TABLE');


	var row_count = 0;


	var test_row = 1;	


	var i, el;




	var sortval = table.rows[test_row].cells[column].getAttribute('sortval');




	// Work out a type for the column


	if (table.rows.length <= 1) return;


	for (i=1; i<table.rows.length; i++) {


	  if (table.rows[i].id.indexOf('section_row') == -1) {


		test_row = i;


		break;


	  }


	}




	if (typeof(sortval) !='undefined' && sortval)


	{


	  sortfn = ts_sort_sortval;


	} else {


	  var itm = ts_getInnerText(table.rows[test_row].cells[column]);


	  sortfn = ts_sort_caseinsensitive;


	  if (itm.match(/^dd[/-]dd[/-]dddd$/)) sortfn = ts_sort_date;


	  if (itm.match(/^dd[/-]dd[/-]dd$/)) sortfn = ts_sort_date;


	  if (itm.match(/^[$]/)) sortfn = ts_sort_currency;


	  if (itm.match(/^[d.]+$/)) sortfn = ts_sort_numeric;


	}


	SORT_COLUMN_INDEX = column;


	var firstRow = new Array();


	var newRows = new Array();


	for (i=0;i<table.rows[0].length;i++) { 


	  firstRow[i] = table.rows[0][i];


	}


	for (j=1;j<table.rows.length;j++) { 


	  // We don't sort section/folder rows, so we skip them here:


	  if ((table.rows[j].parentNode.nodeName == 'TBODY')


		  && (table.rows[j].id.indexOf("section_row") == -1)) {


		newRows[row_count] = table.rows[j]; 


		row_count++;


	  }


	}




	newRows.sort(sortfn);




	if (span.getAttribute("sortdir") == 'down') {


		ARROW = '&nbsp;&nbsp;&uarr;';


		newRows.reverse();


		span.setAttribute('sortdir','up');


	} else {


		ARROW = '&nbsp;&nbsp;&darr;';


		span.setAttribute('sortdir','down');


	}




	// We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones


	// don't do sortbottom rows


	for (i=0;i<newRows.length;i++) { if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) table.tBodies[0].appendChild(newRows[i]);}


	// do sortbottom rows only


	for (i=0;i<newRows.length;i++) { if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) table.tBodies[0].appendChild(newRows[i]);}




	// Delete any other arrows there may be showing


	var allspans = document.getElementsByTagName("span");


	for (var ci=0;ci<allspans.length;ci++) {


		if (allspans[ci].className == 'sortarrow') {


			if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us?


				allspans[ci].innerHTML = '&nbsp;&nbsp;&nbsp;';


			}


		}


	}




	span.innerHTML = ARROW;


}




function getParent(el, pTagName) {


	if (el == null) return null;


	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())	// Gecko bug, supposed to be uppercase


		return el;


	else


		return getParent(el.parentNode, pTagName);


}


function ts_sort_date(a,b) {


	// y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX


	aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);


	bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);


	if (aa.length == 10) {


		dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);


	} else {


		yr = aa.substr(6,2);


		if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }


		dt1 = yr+aa.substr(3,2)+aa.substr(0,2);


	}


	if (bb.length == 10) {


		dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);


	} else {


		yr = bb.substr(6,2);


		if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }


		dt2 = yr+bb.substr(3,2)+bb.substr(0,2);


	}


	if (dt1==dt2) return 0;


	if (dt1<dt2) return -1;


	return 1;


}




function ts_sort_currency(a,b) { 


	aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');


	bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');


	return parseFloat(aa) - parseFloat(bb);


}




function ts_sort_numeric(a,b) { 


	aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));


	if (isNaN(aa)) aa = 0;


	bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); 


	if (isNaN(bb)) bb = 0;


	return aa-bb;


}




function ts_sort_caseinsensitive(a,b) {


	aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();


	bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();


	if (aa==bb) return 0;


	if (aa == '') return 1;


	if (bb == '') return -1;


	if (aa<bb) return -1;


	return 1;


}




function ts_sort_sortval(a,b) {


	aa = a.cells[SORT_COLUMN_INDEX].getAttribute('sortval');


	bb = b.cells[SORT_COLUMN_INDEX].getAttribute('sortval');


	if (aa==bb) return 0;


	if (aa<bb) return -1;


	return 1;


}




function ts_sort_default(a,b) {


	aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);


	bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);


	if (aa==bb) return 0;


	if (aa<bb) return -1;


	return 1;


}






function addEvent(elm, evType, fn, useCapture)


// addEvent and removeEvent


// cross-browser event handling for IE5+,  NS6 and Mozilla


// By Scott Andrew


{


  if (elm.addEventListener){


	elm.addEventListener(evType, fn, useCapture);


	return true;


  } else if (elm.attachEvent){


	var r = elm.attachEvent("on"+evType, fn);


	return r;


  } else {


	alert("Handler could not be removed");


  }


}

just copy the text in the code box and make a new txt file. then paste that text in the file and save as sorttable.js. now put that script in your install (or root for online host) directory.

Link to comment
Share on other sites

You can remove all those numbers from the top also. I didnt even realize I pasted those into the file. Not that they'll bother anything, but I removed them and it's still ok.

Link to comment
Share on other sites

hehe.

Offset how? the pitching area is a little bunched together, but everything lines up ok. Also, it looks a tiny bit cleaner in IE.

I absolutely love this. This was the first thing that really bothered my about mvp. I mean, its 2005 and a game doesnt have sortable teams standings page??? Well, at least it didn't, until now :) Again, a huge thanks to Rich

i guess it's not, just overlapping tables but it looks how it's supposed to be.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...