TBD Game - When team names are not known | Peter's Sports League Standings | Forum
Back to the sports standings script page
9:18 pm
Is there any easy way to add games to the schedule (such as end-of-season playoffs) when the team names are not known yet?
If I create new teams called ‘TBD1? and ‘TBD2? then they will show up in the standings, so that is not really ideal.
So here is what I did:
1) Created ‘TBD’ Teams
2) Added new games for these teams
3) Edited these teams to make them Inactive
Then later, when we know which teams will be in the playoffs, we will edit these games.
Anyone have a better way??
Hi Jon,
I would have initially suggested that you just add a table manually for the schedule. I think your solution is actually pretty great and is the best idea within the framework. In fact, while it might be considered a "workaround" it is probably better versus hard-coding such functionality into the code.
Is there an administrative hassle for your solution? Only for leagues with many conferences and divisions would I see this being a problem, but then you could probably write a simple MySQL script to automate the process of creating the inactive TBD teams.
1:02 am
Hi Peter,
This workaround works pretty well. The only things not great about it:
1) Like you said, for each division, you need to create 2 different TBD teams (a team cannot play itself)
2) If you need to edit a game (for example the time changes) you need to first re-activate the teams; the form will not let you keep an inactive team as a selection in edit mode.
So it is good enough, I think alot of programming would be needed otherwise. For example, it would be nice to add a hard-coded option in the team select drop-down, something like:
<option value=”TBD”> TBD </option>
But then you would have to change other files to recognize this value as a special case that is not assigned to a division, etc…..
I’ve decided this TBD thing would be a good addition to the core release.
As a result, I’ve created a beta release of version 1.3 for that feature.
Upgrade instructions are similar to before:
- Back up your files and database!
- Run the MySQL commands in upgrades/upgrade_1.x_to_1.y.sql to upgrade the database tables from Version 1.x to 1.y. If you are upgrading across multiple versions, you must run the commands in multiple files. For example, to upgrade from Version 1.0 to 1.2, run the commands in upgrade_1.0_to_1.1.sql, then run the commands in upgrade_1.1_to_1.2.sql. Note that starting from version 1.3 (upgrade_1.2_to_1.3.php), you run the equivalent PHP upgrade file in your browser.
- All files can be overwritten except for settings.php.
Download version 1.3 beta here
If you have a highly customized version 1.2 and don’t want to overwrite any files, first back everything up! Then, you must at least run the PHP upgrade file (which makes database changes) and then try to follow my notes on the file changes. (I don’t particularly recommend this, but I figure I should just make this an option for people like Jason who I want to test this.)