First of all Id like to say THANKS for releasing such a nice open software!
I've tried it out and it works perfect, no problems what so ever.
The thing is that I live in Europe and me and my friends dont really watch NFL, well only the superbowl once a year. What we are thou is a group that have a big interest in European Football(Soccer). So I tried to modify your phpdraft to work with soccer players instead.
What I basically want to do is to add (or switch out one of the "NFL, MBA, NHL" ect) to a Soccer alternative. I have made a list of about 3000 players and added them in the correct format. For example:
(1, 'FTB', 'Lionel', 'Messi', 'CF', 'FCB'),
(2, 'FTB', 'Cristiano', 'Ronaldo', 'LW', 'RMD'),
And also I've made a list of all the teams in the correct format, for example:
"FCB" => "FC Barcelona"
"RMD" => "Real Madrid"
I've tried to switch out MBA to FTB and rename it "Football" and Ive also tried to just use the NFL tags everywhere instead of FTB.
Everything goes fine untill Ive created a draft, and changes its status to "In Progress"
When I want to get to the draft, the page just cant load, and I dont know where I should go on from here....
Would you have some guidelines for me what to edit to make this work?
Once again, thanks for this awesome open software!
Kind Regards,
Mathias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So I've managed to get all the players and teams inside and it works fine now :)
So I've got a new problem, managers can pick the same player over and over again, is it a possible way to make a player only pickable once? Then it cant be picked again?
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is excellent! I am so glad you were able to make this application work for your specific purpose!
If you're a developer (and thus familiar with source control - specifically Mercurial) I urge you to open your own fork of the PHP Draft repository on Bitbucket. There, you can apply the changes you've made to your PHPDraft to make it soccer-friendly, then make a few commits (smaller more granular commits are always welcome!) and make a pull request back to the main repository. I'll look it over and pull it in if there are no issues. This way, your changes will be in the main release and source code, and could potentially help other soccer fans around the world with the same issue!
If what I just described is a bit confusing for you - feel free to post the changes you made in this forum here (like the additions of the soccer positions, soccer teams, addition of the soccer league to the app itself), as well as attaching the CSV of all 3000 of the soccer players you've added (this is immensely helpful, as well. Very time consuming process!). I'll do my best to get it included in the app and make a minor release on SourceForge so the downloaded code has all of these changes as well.
Like I said before - I am very happy you were able to tweak the app to make it work for you. I'll do my part to integrate your hard work into the project to help others like you! Thanks!
As for not picking duplicate players... That's tricky. It's something a lot of others have requested, but the only fail safe way to ENSURE 100% that no one is picked twice is to have a table of players for each draft, and once they're picked, mark them as unavailable. It's a bit memory intensive, and we may go this way in the future, but I thought I'd wait it out for a better solution.
For the time being, though, since I've recently added the autocomplete, I think I can add in a nice helpful check. Here's what I was thinking:
When you click "Add Pick", the software performs an AJAX call. Given the name, position and team of the player (maybe just the name - I'll have to test with all leagues to see how many players share a first AND last name), the app will search all picks that have already been made. If there is a case insensitive match, it won't submit the pick just yet, instead it pops up saying, "Mark Texiera was already drafted in the 2nd round by Bob's Team. Are you sure you want to enter this pick?" Yes and No buttons provided. If they click Yes, the pick is submitted as-is, and No just closes the popup and lets the commish edit the pick.
I'm wary of completely 100% blocking the user in that situation, because there may be a situation where they want to enter a duplicate. Provide a warning, and let them proceed at their own risk.
What do you think of this as a possible solution? Let me know, I'd appreciate some feedback. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First of all I am not a developer and I've never really done any coding by myself. I have thou over the years edited codes alot and that way understood how most of it works :)!
To explain abit more what I've successfully done so faar, I've just switched out all the NFL players and added around 3k soccer players instead. Switched out and added all the soccer positions over the nfl positions and added around 320 teams for where each player are from. I've taken them all out from the FIFA2013 database and I've only added all players with a rating of 70+ (as European Soccer has ALOT of teams and to add all players would be like 100k+). So I havent made a CSV file with players, I've just implemented them into the SQL file directly with the correct tags.
So by this, the NFL draft now works as a Soccer draft, but it still says NFL, as I havent figured out or added another league as I am not a real coder myself.
So what I want to do from now on;
Add a selectable tab for Soccer instead of haveing to choose NFL to use my draft.
Is this something you could help me with?
How do you want me to publish all this lines of codes? Players, Teams and Positions?
As for the picking duplicate players, your suggestions seems like a good alternative!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well - that's fine that you've hacked that together - for the time being that'll work for you.
I guess what you can do for me is point me to the information that I need.
For instance, the leagues the software supports are "NFL", "MLB", "NHL", "NBA". What would the three (or four?) letter abbreviation of the league you want to add? Is it EPL? Since I don't follow soccer myself, I'm not sure of this.
What are the positions that players can hold (and what are their abbreviations). For instance, in the NHL (and hockey in general) there are Centers, Left and Right Wingers, Defensemen and Goalies. They're abbreviated C, LW, RW, D, G.
Where can I find the FIFA2013 database so that I may create a CSV with all of the soccer players?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And for the SCV file, I dont really know how to create it or how it should looke like, Ill just give you a complete .sql file with the players as they should be in the sql.
I've attached a .sql file where u will find it :)
EDIT: Also I have another question, in the draftboard it says like this:
1
Cristiano
Ronaldo
(LW - RMD)
Mathias
Where the three letter abbreviation RMD stands for Real Madrid, is it possible to have it say Real Madrid there instead of the abbreviation ??
Thanks for taking your time and helping me out, I am TRULY greatfull!!
Cheers,
Mathias
Excellent. I've done some work to start getting this into the app. What I'll need help with, though, is a list (just like the list of positions above) of all the teams with their abbreviations and their full club names.
Similarly, you'll do something like that:
"FCB" => "FC Barcelona",
so on, and so forth.
The SQL you provided is great. I think I'll try to reverse-engineer it and write some PHP to create a CSV formatted file so others can import it using the CSV tool in PHPDraft.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also, there seem to be a high number of players who have only a first or last name - the system requires both parts of the name. Here's a CSV (you can open it in MS Office or Open Office just as you would a spreadsheet) of the 439 players missing a last name:
Alright so I have already made list of all teams, there are a total of 313 teams. Where one team is named Random, where the some of the lowest players are listed in, as those teamnames were to complex to get into. But that shouldnt matter really.
I didnt have any problem what so ever with them having just a first/last name, are you sure it's really needed? If so what do you suggest me doing with them? As in soccer it is very common that a player just has a "rolename" and none really know their real name. This can be seen in "Ronaldinho" "Ronaldo" "Robinho" etc.
Ill attach the list of all the teams. (NOTE: The teams abbreviation is NOT correct as it should be in real life, as many teams has the same abbreviation, and as I noticed, there cant be more then 1 team with the same abbreviation, correct?)
I've been thinking about this - I think with some refactoring of the validation I used on the Add Pick screen, and maybe some on the draft board, I could get around the requirement of both a First AND Last name for players.
The issue of duplicate team abbreviations that you mentioned is correct - the way PHPDraft handles teams right now is that each player (pick) has a column for team that stores a three-character abbreviation. The teams are just stored in a PHP array in the application, and the abbreviations are the keys. The array value is the full team name.
Getting around this requirement will be more difficult, such as using something like an auto-assigned ID and storing teams in the database.
Using the abbreviation as the key was kind of a nice efficient work-around for the representation of teams, and I kept them (along with the positions, and the HTML colors for all positions) in PHP arrays because it was quicker. Having to load a table of 300+ teams each time they're needed (once per session, obviously once we load them make sure to cache them so we're not thrashing the table) might get less than performant.
Not sure how to proceed on this. The data being used for soccer doesn't match the assumptions PHPDraft makes about it, and I'm not sure if PHPDraft can bend to match it, at least right now.
Last edit: Matthew Orres 2013-02-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey there!
First of all Id like to say THANKS for releasing such a nice open software!
I've tried it out and it works perfect, no problems what so ever.
The thing is that I live in Europe and me and my friends dont really watch NFL, well only the superbowl once a year. What we are thou is a group that have a big interest in European Football(Soccer). So I tried to modify your phpdraft to work with soccer players instead.
What I basically want to do is to add (or switch out one of the "NFL, MBA, NHL" ect) to a Soccer alternative. I have made a list of about 3000 players and added them in the correct format. For example:
(1, 'FTB', 'Lionel', 'Messi', 'CF', 'FCB'),
(2, 'FTB', 'Cristiano', 'Ronaldo', 'LW', 'RMD'),
And also I've made a list of all the teams in the correct format, for example:
"FCB" => "FC Barcelona"
"RMD" => "Real Madrid"
I've tried to switch out MBA to FTB and rename it "Football" and Ive also tried to just use the NFL tags everywhere instead of FTB.
Everything goes fine untill Ive created a draft, and changes its status to "In Progress"
When I want to get to the draft, the page just cant load, and I dont know where I should go on from here....
Would you have some guidelines for me what to edit to make this work?
Once again, thanks for this awesome open software!
Kind Regards,
Mathias
So I've managed to get all the players and teams inside and it works fine now :)
So I've got a new problem, managers can pick the same player over and over again, is it a possible way to make a player only pickable once? Then it cant be picked again?
Cheers
This is excellent! I am so glad you were able to make this application work for your specific purpose!
If you're a developer (and thus familiar with source control - specifically Mercurial) I urge you to open your own fork of the PHP Draft repository on Bitbucket. There, you can apply the changes you've made to your PHPDraft to make it soccer-friendly, then make a few commits (smaller more granular commits are always welcome!) and make a pull request back to the main repository. I'll look it over and pull it in if there are no issues. This way, your changes will be in the main release and source code, and could potentially help other soccer fans around the world with the same issue!
If what I just described is a bit confusing for you - feel free to post the changes you made in this forum here (like the additions of the soccer positions, soccer teams, addition of the soccer league to the app itself), as well as attaching the CSV of all 3000 of the soccer players you've added (this is immensely helpful, as well. Very time consuming process!). I'll do my best to get it included in the app and make a minor release on SourceForge so the downloaded code has all of these changes as well.
Like I said before - I am very happy you were able to tweak the app to make it work for you. I'll do my part to integrate your hard work into the project to help others like you! Thanks!
As for not picking duplicate players... That's tricky. It's something a lot of others have requested, but the only fail safe way to ENSURE 100% that no one is picked twice is to have a table of players for each draft, and once they're picked, mark them as unavailable. It's a bit memory intensive, and we may go this way in the future, but I thought I'd wait it out for a better solution.
For the time being, though, since I've recently added the autocomplete, I think I can add in a nice helpful check. Here's what I was thinking:
When you click "Add Pick", the software performs an AJAX call. Given the name, position and team of the player (maybe just the name - I'll have to test with all leagues to see how many players share a first AND last name), the app will search all picks that have already been made. If there is a case insensitive match, it won't submit the pick just yet, instead it pops up saying, "Mark Texiera was already drafted in the 2nd round by Bob's Team. Are you sure you want to enter this pick?" Yes and No buttons provided. If they click Yes, the pick is submitted as-is, and No just closes the popup and lets the commish edit the pick.
I'm wary of completely 100% blocking the user in that situation, because there may be a situation where they want to enter a duplicate. Provide a warning, and let them proceed at their own risk.
What do you think of this as a possible solution? Let me know, I'd appreciate some feedback. Thanks!
First of all I am not a developer and I've never really done any coding by myself. I have thou over the years edited codes alot and that way understood how most of it works :)!
To explain abit more what I've successfully done so faar, I've just switched out all the NFL players and added around 3k soccer players instead. Switched out and added all the soccer positions over the nfl positions and added around 320 teams for where each player are from. I've taken them all out from the FIFA2013 database and I've only added all players with a rating of 70+ (as European Soccer has ALOT of teams and to add all players would be like 100k+). So I havent made a CSV file with players, I've just implemented them into the SQL file directly with the correct tags.
So by this, the NFL draft now works as a Soccer draft, but it still says NFL, as I havent figured out or added another league as I am not a real coder myself.
So what I want to do from now on;
Add a selectable tab for Soccer instead of haveing to choose NFL to use my draft.
Is this something you could help me with?
How do you want me to publish all this lines of codes? Players, Teams and Positions?
As for the picking duplicate players, your suggestions seems like a good alternative!
Well - that's fine that you've hacked that together - for the time being that'll work for you.
I guess what you can do for me is point me to the information that I need.
For instance, the leagues the software supports are "NFL", "MLB", "NHL", "NBA". What would the three (or four?) letter abbreviation of the league you want to add? Is it EPL? Since I don't follow soccer myself, I'm not sure of this.
What are the positions that players can hold (and what are their abbreviations). For instance, in the NHL (and hockey in general) there are Centers, Left and Right Wingers, Defensemen and Goalies. They're abbreviated C, LW, RW, D, G.
Where can I find the FIFA2013 database so that I may create a CSV with all of the soccer players?
The abbreviation for the league could really be anything, but to simplify it, lets call it "FTB" as we call it Football in Europe aswell.
This should be the positions possible:
"GK" => "Goalkeeper",
"LWB" => "Left Wingback",
"LB" => "Left Back",
"CB" => "Center Back",
"RB" => "Right Back",
"RWB" => "Right Winback",
"LM" => "Left Midfielder",
"CDM" => "Central Defensive Midfielder",
"CM" => "Central Midfielder",
"CAM" => "Central Attacking Midfielder",
"RM" => "Right Midfielder",
"RW" => "Right Wing",
"LW" => "Left Wing",
"CF" => "Central Forward",
"LF" => "Left Forward",
"RF" => "Right Forward",
"ST" => "Striker"
And for the SCV file, I dont really know how to create it or how it should looke like, Ill just give you a complete .sql file with the players as they should be in the sql.
I've attached a .sql file where u will find it :)
EDIT: Also I have another question, in the draftboard it says like this:
1
Cristiano
Ronaldo
(LW - RMD)
Mathias
Where the three letter abbreviation RMD stands for Real Madrid, is it possible to have it say Real Madrid there instead of the abbreviation ??
Thanks for taking your time and helping me out, I am TRULY greatfull!!
Cheers,
Mathias
Last edit: Hendrikx 2013-02-15
Excellent. I've done some work to start getting this into the app. What I'll need help with, though, is a list (just like the list of positions above) of all the teams with their abbreviations and their full club names.
Here's what it looks like for the NBA:
Similarly, you'll do something like that:
"FCB" => "FC Barcelona",
so on, and so forth.
The SQL you provided is great. I think I'll try to reverse-engineer it and write some PHP to create a CSV formatted file so others can import it using the CSV tool in PHPDraft.
Also, there seem to be a high number of players who have only a first or last name - the system requires both parts of the name. Here's a CSV (you can open it in MS Office or Open Office just as you would a spreadsheet) of the 439 players missing a last name:
Alright so I have already made list of all teams, there are a total of 313 teams. Where one team is named Random, where the some of the lowest players are listed in, as those teamnames were to complex to get into. But that shouldnt matter really.
I didnt have any problem what so ever with them having just a first/last name, are you sure it's really needed? If so what do you suggest me doing with them? As in soccer it is very common that a player just has a "rolename" and none really know their real name. This can be seen in "Ronaldinho" "Ronaldo" "Robinho" etc.
Ill attach the list of all the teams. (NOTE: The teams abbreviation is NOT correct as it should be in real life, as many teams has the same abbreviation, and as I noticed, there cant be more then 1 team with the same abbreviation, correct?)
I've been thinking about this - I think with some refactoring of the validation I used on the Add Pick screen, and maybe some on the draft board, I could get around the requirement of both a First AND Last name for players.
The issue of duplicate team abbreviations that you mentioned is correct - the way PHPDraft handles teams right now is that each player (pick) has a column for team that stores a three-character abbreviation. The teams are just stored in a PHP array in the application, and the abbreviations are the keys. The array value is the full team name.
Getting around this requirement will be more difficult, such as using something like an auto-assigned ID and storing teams in the database.
Using the abbreviation as the key was kind of a nice efficient work-around for the representation of teams, and I kept them (along with the positions, and the HTML colors for all positions) in PHP arrays because it was quicker. Having to load a table of 300+ teams each time they're needed (once per session, obviously once we load them make sure to cache them so we're not thrashing the table) might get less than performant.
Not sure how to proceed on this. The data being used for soccer doesn't match the assumptions PHPDraft makes about it, and I'm not sure if PHPDraft can bend to match it, at least right now.
Last edit: Matthew Orres 2013-02-19