phppickem icon indicating copy to clipboard operation
phppickem copied to clipboard

[request / suggestion] Games not locked until actual game time

Open searnhardt opened this issue 7 years ago • 1 comments

I would like to see a config option, or default, be to keep games open to change right up to game time. I realize that later in the year, the game times change meaning more work for the admins, but there are a lot of times where I'd like to allow players to change a late Sunday game or the Monday night game. Sometimes it's a matter of desperation in trying to keep a tie from happening, but I think the option should be there for the players. I'm a PHP newbie and haven't looked into how the weeks are currently locked but I don't think this should be too hard to implement. I suggested making if a config so that if admins want to keep the weeks locking when they do, that is fine also.

searnhardt avatar Oct 09 '17 16:10 searnhardt

You can try my fork. I have implemented a config option so that the London games don't burn me. It would open up all of the games and prevent changing picks at 8:30 am until I implemented the alternate lock time. My solution may work for you but I haven't tested changing it to a later time on Sunday. It locks all games on each start time & day until the hour (on Sunday) provided in the config. As is it won't work for pushing this out to Monday.

https://github.com/randyr505/phppickem

Here is some of the code to see what I have done in case you want to try and modify your own fork. i.e. includes/config.php:define('ALT_CUTOFF_SUNDAY', 13); // use 00-13 so early Sunday games don't lock too early, i.e set = 13 for cutoff at 13:00 Eastern. includes/functions.php: $sql = "select gameTimeEastern from " . DB_PREFIX . "schedule where weekNum = " . $week . " and DATE_FORMAT(gameTimeEastern, '%W') = 'Sunday' and DATE_FORMAT(gameTimeEastern, '%H') >= " . ALT_CUTOFF_SUNDAY . " order by gameTimeEastern limit 1;"; includes/functions.php.orig: $sql = "select gameTimeEastern from " . DB_PREFIX . "schedule where weekNum = " . $week . " and DATE_FORMAT(gameTimeEastern, '%W') = 'Sunday' and DATE_FORMAT(gameTimeEastern, '%H') >= " . ALT_CUTOFF_SUNDAY . " order by gameTimeEastern limit 1;";

randyr505 avatar Oct 09 '17 22:10 randyr505