If you or anyone else wants it I've added a fairly simple player selection popup to your site I've posted it here. I just borrowed some code from the fantasy adp site. its a popup that's linked off the 'make a pick' draft room page. I don't have the time to incorporate an actual database player list, storage and selection ect, but this at least lets you pick players from a list so you don't have to type in first name last name, position and team. Drafting can be a hectic time, I thought this would help.
I created this file in the root of the website:
select.php
<scripttype="text/javascript">
$(document).ready(function() {
$("#first_name").focus();
$('.example3demo').popupWindow({
centerScreen:1
});
});
</script><script>
(function($){
$.fn.popupWindow = function(instanceSettings){
return this.each(function(){
$(this).click(function(){
$.fn.popupWindow.defaultSettings = {
centerBrowser:0, // center window over browser window? {1 (YES) or 0 (NO)}. overrides top and left
centerScreen:0, // center window over entire screen? {1 (YES) or 0 (NO)}. overrides top and left
height:500, // sets the height in pixels of the window.
left:0, // left position when the window appears.
location:0, // determines whether the address bar is displayed {1 (YES) or 0 (NO)}.
menubar:0, // determines whether the menu bar is displayed {1 (YES) or 0 (NO)}.
resizable:0, // whether the window can be resized {1 (YES) or 0 (NO)}. Can also be overloaded using resizable.
scrollbars:0, // determines whether scrollbars appear on the window {1 (YES) or 0 (NO)}.
status:0, // whether a status line appears at the bottom of the window {1 (YES) or 0 (NO)}.
width:500, // sets the width in pixels of the window.
windowName:null, // name of window set from the name attribute of the element that invokes the click
windowURL:null, // url used for the popup
top:0, // top position when the window appears.
toolbar:0 // determines whether a toolbar (includes the forward and back buttons) is displayed {1 (YES) or 0 (NO)}.
};
settings = $.extend({}, $.fn.popupWindow.defaultSettings, instanceSettings || {});
var windowFeatures = 'height=' + settings.height +
',width=' + settings.width +
',toolbar=' + settings.toolbar +
',scrollbars=' + settings.scrollbars +
',status=' + settings.status +
',resizable=' + settings.resizable +
',location=' + settings.location +
',menuBar=' + settings.menubar;
settings.windowName = this.name || settings.windowName;
settings.windowURL = this.href || settings.windowURL;
var centeredY,centeredX;
if(settings.centerBrowser){
if ($.browser.msie) {//hacked together for IE browsers
centeredY = (window.screenTop - 120) + ((((document.documentElement.clientHeight + 120)/2) - (settings.height/2)));
centeredX = window.screenLeft + ((((document.body.offsetWidth + 20)/2) - (settings.width/2)));
}else{
centeredY = window.screenY + (((window.outerHeight/2) - (settings.height/2)));
centeredX = window.screenX + (((window.outerWidth/2) - (settings.width/2)));
}
window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
}else if(settings.centerScreen){
centeredY = (screen.height - settings.height)/2;
centeredX = (screen.width - settings.width)/2;
window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
}else{
window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + settings.left +',top=' + settings.top).focus();
}
return false;
});
});
};
})(jQuery);
</script>
Just wanted to say this is a great project. I'll be using at my offline draft this weekend. I've got it all set up!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-08-24
oops, swap out example3demo for popitlikeitshot in that last part
Nice! Hopefully others who like having that list can use your extra code there.
The issue of having a pre-defined list of players versus typing them in yourself was one I struggled with while I was still designing this app on a whiteboard. I've had a few friends try to design similar applications, and it seemed that one huge drag on the extensibility and lifespan of their apps was the amount of effort and error in getting the most up-to-date information on player names, and then getting it into their projects.
Obviously one way to solve that is just simple brute force, which a friend of mine did for the one application. Went through and copied pages upon pages of player rankings from Yahoo! Fantasy Sports website, and copied it into an Excel file… all by hand. It was error-prone (human element, obviously), but more importantly it was a terrible life-sucking experience for him.
Another way to solve that issue is to use a web scraper - cURL is the obvious choice for an app like PHPDraft. I unfortunately haven't used it much yet, so I don't know its limitations, but I feared a few things would hinder this process every year:
-One, you'd probably have to find a site that has the most up-to-date information displayed in a consistent manner. Not difficult, CBS and Yahoo are two that come to mind that fit the bill, but it could be an issue
-Two, you'd almost certainly have to deal with a change in the format of the table that the info is shown in, and the paging mechanisms used, etcetera.
As I said, I dont know cURL very well so that might not be an issue, but at the start of development I figured I'd go the easy/lazy way and just build around the assumption that the Commish would just enter everything.
If it becomes a big enough request from enough users, in one of my upcoming dev cycles I'll look into ways to do that. Most likely, it'll be more of a suggestion than just a straight drop-down (i.e. start typing "Ch" and it comes up with "Chris Johnson - RB, TEN", then you select it and it fills in all fields for you).
Thanks for the kind words on the project. Glad other people are using this project!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you or anyone else wants it I've added a fairly simple player selection popup to your site I've posted it here. I just borrowed some code from the fantasy adp site. its a popup that's linked off the 'make a pick' draft room page. I don't have the time to incorporate an actual database player list, storage and selection ect, but this at least lets you pick players from a list so you don't have to type in first name last name, position and team. Drafting can be a hectic time, I thought this would help.
I created this file in the root of the website:
select.php
from the draft room page itself, I added
and
Just wanted to say this is a great project. I'll be using at my offline draft this weekend. I've got it all set up!
oops, swap out example3demo for popitlikeitshot in that last part
Nice! Hopefully others who like having that list can use your extra code there.
The issue of having a pre-defined list of players versus typing them in yourself was one I struggled with while I was still designing this app on a whiteboard. I've had a few friends try to design similar applications, and it seemed that one huge drag on the extensibility and lifespan of their apps was the amount of effort and error in getting the most up-to-date information on player names, and then getting it into their projects.
Obviously one way to solve that is just simple brute force, which a friend of mine did for the one application. Went through and copied pages upon pages of player rankings from Yahoo! Fantasy Sports website, and copied it into an Excel file… all by hand. It was error-prone (human element, obviously), but more importantly it was a terrible life-sucking experience for him.
Another way to solve that issue is to use a web scraper - cURL is the obvious choice for an app like PHPDraft. I unfortunately haven't used it much yet, so I don't know its limitations, but I feared a few things would hinder this process every year:
-One, you'd probably have to find a site that has the most up-to-date information displayed in a consistent manner. Not difficult, CBS and Yahoo are two that come to mind that fit the bill, but it could be an issue
-Two, you'd almost certainly have to deal with a change in the format of the table that the info is shown in, and the paging mechanisms used, etcetera.
As I said, I dont know cURL very well so that might not be an issue, but at the start of development I figured I'd go the easy/lazy way and just build around the assumption that the Commish would just enter everything.
If it becomes a big enough request from enough users, in one of my upcoming dev cycles I'll look into ways to do that. Most likely, it'll be more of a suggestion than just a straight drop-down (i.e. start typing "Ch" and it comes up with "Chris Johnson - RB, TEN", then you select it and it fills in all fields for you).
Thanks for the kind words on the project. Glad other people are using this project!