Age at Contract End

Your suggestions are always welcome. / Vos suggestions sont toujours bienvenues.
Post Reply
Owen
The Crazy / Le Fou
Posts: 452
Joined: Tue Jan 01, 2013 12:43 pm
Contact:

Age at Contract End

Post by Owen » Sat Jun 30, 2018 9:14 pm

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.
Elite Hockey Experience

We're not just any league. We're the competitive league that you've waited years to find!
Now available en Français & auf Deutsch!
www.elitehockeysim.com

SimonT
STHS Owner / Propriétaire du STHS
Posts: 13173
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: Age at Contract End

Post by SimonT » Mon Jul 02, 2018 9:58 am

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.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français

Simon Beaudoin
The Addict / Le Drogué
Posts: 544
Joined: Tue Feb 28, 2006 9:50 pm
Location: L'Islet
Contact:

Re: Age at Contract End

Post by Simon Beaudoin » Fri Jul 13, 2018 6:00 am

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
Commissaire FHLQ
19e année d'existence
Image
http://www.fhlq.com

SimonT
STHS Owner / Propriétaire du STHS
Posts: 13173
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: Age at Contract End

Post by SimonT » Fri Jul 13, 2018 11:41 am

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.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français

PNHL
The Addict / Le Drogué
Posts: 614
Joined: Thu Oct 21, 2010 4:19 pm

Re: Age at Contract End

Post by PNHL » Mon Jul 16, 2018 8:29 am

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

Post Reply