Page 1 of 1

Age at Contract End

Posted: Sat Jun 30, 2018 9:14 pm
by Owen
I have a request that I am not sure is possible, but I figure it does not hurt to ask. Can you output the exact age all players will be at the end of their contracts? Currently, this info only shows on the HTML output for Current and Next Year's Free Agents (and only if the page is maximized).

The reason that I ask is because in the 7 years I have been playing this game, there is someone every summer who is confused about whether their player is going to be an RFA or UFA at the end of their contract. Adding this to the outputs for all players would help ease the confusion.

It seems like this information would be easy to produce if the "Use Date for Age Calculation" is active. I have mine set to June 30 every year to match the NHL's free agency. However, I don't know how this type of output would be affected in a league where that option is not used.

Re: Age at Contract End

Posted: Mon Jul 02, 2018 9:58 am
by SimonT
Hi.

The Free Agents option "Use Date Instead of Now For Age Calculation" should be apply in the Version 3 Dynamic Website. This special option is only used in the Free Agent Output.

Re: Age at Contract End

Posted: Fri Jul 13, 2018 6:00 am
by Simon Beaudoin
Je trouverais ça bien d'avoir le statut du contrat à la fin de celui-ci

Ex : Je signe un gars pour 6 ans à l'âge de 24 ans. Mon âge pour les UFA est 28 ans alors, ça pourrait indiquer qu'à la fin de son contrat, le joueur sera UFA.

Ça pourrait aider les DGs à gérer leurs effectifs plus facilement.

Un peu comme quand on va sur le site CapFriendly par exemple, ça nous indique le statut du joueur à la fin du contrat (UFA, RFA, etc).

Merci

Re: Age at Contract End

Posted: Fri Jul 13, 2018 11:41 am
by SimonT
La page fait ça pour les agent libres la prochaine année.

Dans le Code de la page PlayerRoster.php, vous voyez le code qui calcul ça avec la fonction date_diff.

Code: Select all

		If ($FreeAgentYear == 1 AND $Row['NextYearFreeAgentPlayerType']=="True"){
			echo "<td>" . $PlayersLang['AlreadyResign'] . "</td>";
		}elseif ($LeagueOutputOption['FreeAgentUseDateInsteadofDay'] == "True" AND $FreeAgentYear == 1){
			$age = date_diff(date_create($Row['AgeDate']), date_create($LeagueOutputOption['FreeAgentRealDate']))->y;
			if ($age >= $LeagueGeneral['UFAAge']){echo "<td>" . $PlayersLang['UFA'] . "</td>";}elseif($age >= $LeagueGeneral['RFAAge']){echo "<td>" . $PlayersLang['RFA'] . "</td>";}else{echo "<td>" . $PlayersLang['ELC'] . "</td>";}
		}else{
			if ($Row['Age'] >= $LeagueGeneral['UFAAge']){echo "<td>" . $PlayersLang['UFA'] . "</td>";}elseif($Row['Age'] >= $LeagueGeneral['RFAAge']){echo "<td>" . $PlayersLang['RFA'] . "</td>";}else{echo "<td>" . $PlayersLang['ELC'] . "</td>";}
		}	
Je ne peux pas le faire sur plusieurs années car je n'ai pas la date exact dans le STHS que les agents libres commence l'année 2, 3, 4, etc.

Re: Age at Contract End

Posted: Mon Jul 16, 2018 8:29 am
by PNHL
Moi j'ai fait un tableau comme CapFriendly. http://eshl.ca/ProTeam.php?Team=15 -> Salary

Assez facile à faire, mais doit être modifier selon la date des agents libres