These respected pieces of code are all in the PHT Hall of Fame.
Most of them don't works nowadays as Hattrick has evolved, but you can download all versions if you want to see the code, or if you have a bit of nostalgia about old things of the game :)
-
Download PHT v2.13.3
v2.13.3 24-04-2012
New getPlayerTypeSearch() and getLastCallDate() functions in HTYouthScout class
Fix HTYouthPlayer class
Fix getYouthPlayer() function in HTYouthTeamPlayers class
-
Download PHT v2.13.2
v2.13.2 17-04-2012
Fix getXml() function in HTXml class
-
Download PHT v2.13.1
v2.13.1 13-04-2012
Fix isTrainer() function in HTPlayer class
-
Download PHT v2.13
v2.13 12-04-2012
Use version 2.3 of matchdetails file
Use version 2.1 of matchorders file
Use version 1.8 of matchlineup file
New getTournamentMatchDetails(), clearTournamentMatchDetail() and clearTournamentMatchesDetails() functions in CHPPConnection class
New isYouth() and isTournament() functions in HTMatch class
New getSeniorMatchOrders(), clearSeniorMatchOrders(), clearSeniorMatchesOrders() functions in CHPPConnection class
New getYouthMatchOrders(), clearYouthMatchOrders(), clearYouthMatchesOrders() functions in CHPPConnection class
New getTournamentMatchOrders(), clearTournamentMatchOrders(), clearTournamentMatchesOrders() functions in CHPPConnection class
New getTournamentLineup(), clearTournamentLineup(), clearTournamentLineups() functions in CHPPConnection class
New isTournament() and isYouth() functions in HTTeamMatch class
New getFirstName(), getLastName() and getNickName() functions in HTMatchOrdersPlayer class
New getSourceSystem() function in HTSetLineup class
Change CHPPConnection::oauthFirstTokenSecret scope, now the variable is protected
New getGoalsInCareer(), getGoalsInCup(), getGoalsInLeague(), getGoalsInFriendly() and getHattricksInCareer() function in HTPlayer class
Fix getKey(), getKeyId() and getKeyVariation() functions in HTLiveMatchEvent class
Fix HTYouthPlayerSkill class
Fix getEndDate() function in HTMatch class
Fix getPlayerById() function in HTAvatars class
Fix getXml() function in HTXml class
Parameters of createNewLineup() function in CHPPConnection class have changed: $isYouth boolean parameter has changed to $sourceSystem string parameter, use HTMatch constants to set the value for your lineup
Constructor parameters of HTSetLineup have changed, $isYouth boolean parameter has changed to $sourceSystem string parameter, use HTMatch constants to set the value for your lineup
Remove isYouth() function in HTSetLineup class
Functions getMatchOrders(), clearMatchOrders() and clearMatchesOrders() in CHPPConnection is marked as deprecated. Will be removed within next version
-
Download PHT v2.12
v2.12 10-03-2012
Use version 2.4 of matches file
Use version 2.2 of matchdetails file
Use version 1.4 of leaguedetails file
Use version 1.7 of matchlineup file
Use version 1.0 of youthteamdetails file
Use version 1.0 of youthavatars file
Use version 1.0 of youthplayerlist file
Use version 1.4 of allianceDetails file
Use version 2.2 of players file
Use version 2.1 of playerdetails file
Use version 1.2 of worldcup file
New clearHofPlayers() and clearAllHofPlayers() in CHPPConnection class
New getKeyId() and getKeyVariation() functions in HTLiveMatchEvent class
New getWonNumber(), getDrawsNumber() and getLostNumber() functions in HTLeagueTeam class
New getFirstName(), getLastName() and getNickName() functions in HTLineupPlayer class
New getTotalInjuries() and getInjury() functions in HTMatch class
New HTMatchInjury class
New getCurrentMatchRound() function in HTLeague class
New getDressURI() and getDressAlternateURI() functions in HTNationalTeamDetail class
New getYouthTeam(), clearYouthTeam() and clearYouthTeams() functions in CHPPConnection class
New HTYouthTeam class
New getYouthScouts(), clearYouthScouts() and clearAllYouthScouts() functions in CHPPConnection class
New HTYouthScouts ans HTYouthScout classes
New clearAvatars(), getYouthAvatars() and clearYouthAvatars() functions in CHPPConnection class
New HTYouthAvatars and HTYouthPlayerAvatar classes
New getYouthTeamPlayers(), clearYouthTeamPlayers() and clearYouthTeamsPlayers() functions in CHPPConnection class
New getYouthTeamPlayersDetails() and clearYouthTeamsPlayersDetails() functions in CHPPConnection class
New getYouthTeamPlayersUnlockskills() and clearYouthTeamsPlayersDetails() functions in CHPPConnection class
New getYouthPlayer(), clearYouthPlayer() and clearYouthPlayers() functions in CHPPConnection class
New HTYouthTeamPlayers, HTYouthPlayer, HTYouthPlayerLastMatch, HTYouthScoutCall, HTYouthScoutComment and HTYouthPlayerSkill classes
New parameter in getInvestment() function in HTYouthSquad class
New HTCommonAvatar class, internal class base for all avatars
New getBackground() and getHtml() functions in HTPlayerAvatar class
New getMaximumMember(), getRequestType() and getDescription() functions in HTAllianceRole class
New isYouth(), getLeagueId(), getLeagueName(), getLeagueLevelUnitId(), getLeagueLevelUnitName() and getLeagueLevel() functions in HTTeamMatches class
Fix getLeague() function in HTWorldDetails class
Fix all functions which deal with dates, caches for date formats are integrated transparently
Fix phpdoc for getAvatars() function in CHPPConnection class
Fix getSpecialists() function in HTClub class to handle several calls with differents currencies
Fix isInCup() function in HTTeam class
Remove getAllianceRoleDetails(), clearAllianceRoleDetails(), clearAllianceRolesDetails(), and clearAlliancesRolesDetails() functions in CHPPConnection class
Remove HTAllianceRoleDetails class because of non existence anymore of actionType viewRole in alliancedetails file
Remove getBestMatch() functions in HTTeamPlayer and HTPlayer classes as data is no more available
Function getPositionCode() in HTLineupPlayer is marked as deprecated. Will be removed within next version
Functions getDressCode() and getDressAlternateCode() in HTNationalTeamDetail class are marked as deprecated. Will be removed within next version
-
Download PHT v2.11
v2.11 20-01-2012
Use version 1.7 of live file
New getNextMinuteEvent() function in HTLiveMatch class
New getHomeStartingLineup() and getAwayStartingLineup() functions in HTLiveMatch class
New boolean parameter to include substitutes for getTotalStars() and getTotalStarsAtEndOfMatch() in HTFinalLineup class. Defaut value true, like before
Fix isInCup() function in HTTeam class
Function getStartingLineup() in HTLiveMatch is marked as deprecated. Will be removed within next version
-
Download PHT v2.10.1
v2.10.1 08-11-2011
Fix HTLineupResult constructor
Fix mergeLiveJson private function
-
Download PHT v2.10
v2.10 27-10-2011
Use version 1.8 of matchorders file
Use version 1.6 of matchlineup file
Use version 1.4 of worlddetails file
Use version 2.1 of players file
Use version 2.0 of playerdetails file
Use version 1.6 of live file
New isDeleted() function in HTTeam class
New parameter for HTError constructor, the exception code, used for lineup error
New getOrderType() function in HTMatchOrdersPlayerOrder class
New createNewLineup() and sendLineup() functions in CHPPConnection class
New HTSetLineup, HTLineupSubstitution and HTLineupResult classes
New HTSubstitutionLineup, HTStartingLineup and HTFinalLineup classes
New getStartingLineup(), getFinalLineup(), getSubstitutionNumber() and getSubstitution() functions in HTLineup class
New getLeagueNumber() in HTWorldDetails class
New parameter includeRegions in getWorldDetails() function in CHPPConnection class
New getWorldDetailsByCountryId(), clearWorldDetailsByCountryId(), getWorldDetailsByLeagueId() and clearWorldDetailsByLeagueId() functions in CHPPConnection class
New getSeasonOffet(), getCountryDateFormat(), getCountryTimeFormat(), getRegionsNumber() and getRegion() functions in HTWorldLeague class
New HTWorldRegion class
New getLoyalty() and hasMotherClubBonus() in HTTeamPlayer class
New getLoyalty() and hasMotherClubBonus() in HTPlayer class
New parameter includeStartingLineup in getLive() function in CHPPConnection class
New getSubstitutionNumber(), getSubstitution(), getStartingLineup() and getLastEventIndexShown() functions in HTLiveMatch class
Fix urlencodeRfc3986() function in CHPPConnection class
Fix getRatingStarsAtEndOfMatch() function in HTLineupPlayer class
Fix isTrainer() in HTPlayer class
Fix getStatement() and getShirtNumber() functions in HTTeamPlayer class
Fix getShirtNumber() function in HTPlayer class
Remove getPlayersNumber() and getPlayer() functions in HTLineup class
Remove getPosition() function in HTLineupPlayer class
Remove deprecated function getNumberOfVitories() in HTTeam class
Remove deprecated function getNumberTransfersDuringPeriod() in HTTeamTransferHistory class
Change internal fetchUrl(), buildUrl() and buildSignature() functions in CHPPConnection class
Function getTotalLeague() on HTWorldDetails class is marked as deprecated, use getLeagueNumber() function instead. Will be removed within next version
Function checkInitLive() on CHPPConnection class is marked as deprecated, the function don't do anything. Will be removed within next version
-
Download PHT v2.9
v2.9 05-07-2011
Use version 1.7 of nationalteamdetails file
Use version 1.7 of matchorders file
New getLogoUrl() function in HTNationalTeamDetail class
New getSeasonExpectation() function in HTFans class
New getNumberTransfers() function in HTTeamTransferHistory class, it replaces getNumberTransfersDuringPeriod() function
New getNumberOfVictories() function HTTeam class, it replaces getNumberOfVitories() function (typo)
New enableHTSupporter(), disableHTSupporter() and resetHTSupporter() functions in CHPPConnection class. It allows you to query xml by forcing to be HT Supporter or not
Fix private function getTeams() in HTLeagueSeason class
Function getNumberTransfersDuringPeriod() in HTTeamTransferHistory class is marked as deprecated and will be removed within next version
Function getNumberOfVitories() in HTTeam class is marked as deprecated and will be removed within next version (typo function name)
Remove getMatchId() and getTeamId() functions in HTMatchOrdersPlayerOrder class as xml tags were removed
-
Download PHT v2.8
v2.8 19-06-2011
Use version 1.9 of playerdetails file
Use version 2.0 of players file
Use version 1.4 of arenadetails file
Use version 1.3 of alliances file
Use version 1.4 of cupmatches file
New HTPlayerMatch class, replace HTPlayerBestMatch and HTPlayerLastMatch classes
New getPlayedMinutes() function in HTPlayerMatch class
New getBestMatch() function in HTTeamPlayer class
New getLeagueId() and getLeagueName() functions in HTArenasStatsArena class
New getUserAlliances() function CHPPConnection class
New startLog(), stopLog(), canLog() and log() functions in CHPPConnection class
Fix getRegionId() function in HTArenasStatsArena class
Fix isPositionChangeAvailable() function in HTLeagueTeam class
Fix getLastMatch() and getBestMatch() functions in HTPlayer and HTTeamPlayer classes
Fix scope of $oauthFirstTokenSecret variable in CHPPConnection class
Remove UNAVAILABLE constant in HTLineupPlayer class, getRatingStars(), getPosition() and getIndividualOrder() functions return null instead of this constant
Remove UNAVAILABLE constant in HTLeagueMatch class, getHomeGoals() and getAwayGoals() functions return null instead of this constant
Remove UNAVAILABLE constant in HTTransfer class, getType() function returns null instead of this constant
Remove UNAVAILABLE constant in HTTeamMatch class, isOrdersGiven() function returns null instead of this constant
Remove UNAVAILABLE constant in HTMatchTeam class, getAttitude() function returns null instead of this constant
Remove UNAVAILABLE constant in HTArenaCapacity class, isLastRebuildDateAvailable() and getExpansionDate() functions return null instead of this constant
Remove UNAVAILABLE constant in HTMatchOrdersPlayer class, getIndividualOrder() function returns null instead of this constant
Remove UNAVAILABLE constant in HTArenasStats class, getLeagueName() function returns null instead of this constant
Remove UNAVAILABLE constant in HTAllianceDetails class, getAbbreviation(), getHomepageUrl(), getMessage(), getLogoUrl(), getNumberAwaitingRequests() and getDissolutionDate() functions return null instead of this constant
Remove deprecated function isDataAvailable() in HTTrainingEvents class
-
Download PHT v2.7
v2.7 17-04-2011
Use version 1.2 of transfersteam file
Use version 2.6 of teamdetails file
Use version 1.6 of nationalteamdetails file
Use version 1.2 of economy file
Use version 1.1 of fans file
New version 1.0 of file hofplayers
New version 1.0 of file avatars
New getTeamFlags(), clearTeamFlags(), clearTeamsFlags(), getTeamFlagsByUserId(), clearTeamFlagsByUserId() and clearTeamsFlagsByUserId() functions in CHPPConnection class
New HTTeamFlags class, extends HTTeam class. Use to retrieve flags for teams
Change getTeam() and getTeamByUserId() functions in CHPPConnection class, remove $includeDomesticFlags parameters. Use getTeamFlags functions to get flags for teams
New getTeamSupporters(), clearTeamSupporters(), clearTeamsSupporters(), getTeamSupportersByUserId(), clearTeamSupportersByUserId() and clearTeamsSupportersByUserId() functions in CHPPConnection class
New HTTeamSupporters class, extends HTTeam class. Use to retrieve supporters for teams
New HTTeamSupporter and HTTeamSupported classes
New get442Experience() function in HTNationalTeamDetail class
New getSoldPlayers() and getSoldPlayersCommission() functions in HTEconomyIncome class
New getBoughtPlayers() and getArenaBuilding() functions in HTEconomyCosts class
New getFanClubId() and getFanClubName() functions in HTFans class
New getTrophyNumber() and getTrophy() function in HTTeam class
New HTTrophy class
New getHofPlayers() function in CHPPConnection class
New HTHofPlayers and HTHofPlayer classes
New getAvatars() function in CHPPConnection class
New HTAvatars, HTAvatar and HTLayer classes
Fix get433Experience() function in HTTraining class
Fix getNumberTeams() function in HTWorldCupGroup class
-
Download PHT v2.6
v2.6 30-03-2011
Use version 1.9 of training file
Use version 1.3 of cupmatches file
Use version 1.8 of playerdetails file
Use version 1.9 of players file
Use version 2.5 of teamdetails file
Use version 1.4 of nationalteams file
Use version 1.3 of worlddetails file
Change getTrainingStats() function in CHPPConnection class, empty leagueId returns global stats
Add getLastTrainingTrainingType(), getLastTrainingTrainingLevel() and getLastTrainingStaminaTrainingPart() functions in HTTraining class
Add getHomeTeamId() and getAwayTeamId() functions in HTCupMatch class
Add includeMatchInfo parameter to getPlayer(), getTeamPlayers(), getTeamOldPlayers() and getTeamOldCoaches() functions in CHPPConnection class, default value set to false
Change getStamina() function in HTPlayer class, value is available even player others skills are not shown
Add getOwnerNotes(), getCategoryId() and getBestMatch() functions in HTPlayer class
New HTPlayerBestMatch class and HTPlayerLastMatch inherit from this class
Add getLastMatch() function in HTTeamPlayer class
Add getFanClubSize() function in HTTeam class
Change getFanClubId() and getFanClubName() functions, make them available for everyone (not only htsupporters)
Add getLeagueId() function in HTNationalTeamsTeam class
Add getNationalTeamId() and getU20TeamId() functions to HTWorldLeague class
Add withdrawChallenge() function in CHPPConnection class, this function needs OAuth privileges
Add invalidateToken() function in CHPPConnection class
Add isValid() function in HTCheckToken class
Add getTeamId() and getTeamName() class in HTPlayer class
Change getSeniorMatchDetails() function in CHPPConnection class: add new parameter matchEvents set to true by default
Change getYouthMatchDetails() function in CHPPConnection class: add new parameter matchEvents set to true by default
Fix getMatch() function in HTNationalMatches class
Fix getSeriesMatchDate() function in HTWorldLeague class
Fix getTeamRank(), getNumberOfUndefeat(), getNumberOfVitories() in HTTeam class
Fix getMyArenaStats() and getOthersArenasStats() function in CHPPConnection class
Fix isTrainer() function in HTTeamPlayer class
Fix getName() function in HTRegion class
PHP 5.3 compatibility: Fix all functions that use deprecated ereg() function, replaced by preg_match() function
Change functions visibility from private to protected in CHPPConnection class
Change properties visibility from private to protected for $signatureMethod and $version in CHPPConnection class (properties used for oauth)
Function isDataAvailable() on HTTrainingEvents is marked as deprecated and returns always true. Will be removed within next version
-
Download PHT v2.5
v2.5 16-01-2011
Use version 1.5 of live file
Use version 2.0 of matchdetails file
Use version 1.5 of nationalteamdetails file
New getIndirectSetPiecesDefenseRating() and getIndirectSetPiecesAttackRating() functions in HTMatchTeam class
New get523Experience(), get550Experience() and get253Experience() functions in HTNationalTeamDetail class
New getNationalTeamNumber() and getNationalTeam() functions in HTTeam class
New HTTeamNationalTeam class to get national teams coached by user of selected team
Fix getTrainingType() function in HTTrainingStats class, use index instead of type value
-
Download PHT v2.4
v2.4 29-12-2010
New getAuthenticateUrl() function in CHPPConnection class. Use to get a temporary token with one-time authorization htmail
New checkToken() function in CHPPConnection class. Check if a token is still valid
New HTCheckToken class to know related informations on a token (this object is returned by checkToken() function)
Use version 1.6 of playerdetails file
New getNativeCountryId() function in HTPlayer class
Fix getRedCard() function in HTMatch class
Fix includeDomesticFlags for getTeam() and getTeamByUserId() functions in CHPPConnection class
Remove supporter check in getNumberFlagsHome(), getNumberFlagsAway(), getFlagHome(), getFlagAway() functions in HTTeam class
-
Download PHT v2.3
v2.3 24-11-2010
Use version 1.1 of achievements file
New getRank() function in HTAchievement class
New boolean parameter includeDomesticFlags for getTeam() and getTeamByUserId() functions in CHPPConnection class
New getYouthTeamName() in HTTeam class
-
Download PHT v2.2
v2.2 22-11-2010
Use version 1.5 of playerdetails file
New getLastMatch() function in HTPlayer class and new HTPlayerLastMatch class
Fix getHatStats() function in HTMatchTeam class
Fix getText() function in HTLiveMatchEvent class
Remove deprecated functions: HTMatchTeam::getDressCode(), HTNationalTeamsTeam::getDressCode(), CHPPConnection::getChallanges(), CHPPConnection::clearChallanges(), HTTeam::getDessCode(), HTTeam::getDessAlternateCode()
-
Download PHT v2.1
v2.1 13-11-2010
Use https for OAuth proccess
OAuth scope supported, set your scope on getAuthorizeUrl() function
New manage challenges: CHPPConnection::getChallengeableTeams(), challengeTeam(), acceptChallenge(), declineChallenge()
New constants in HTChallenges class to use with challengeTeam() function
New player skills functions in HTTeamPlayer class
Use version 1.6 of training file
New functions getSpecialTrainingPlayerNumber() and getSpecialTrainingPlayer on HTTraining class
New HTSpecialTrainingPlayer class
Fix team details filename
Deprecated function: getChallanges() and clearChallanges() use getChallenges() and clearChallenges() instead
Remove getHost() function
Remove deprecated functions: getFlagsHome(), getFlagsAway(), clearFlagsHome() and clearFlagsAway() in CHPPConnection class
Change some internal constant (for server url)
-
Download PHT v2.0
v2.0 26-10-2010
Use new OAuth authentication
Functions getLoginResult() and disconnect() have been removed.
No more cookie are used
Use version 2.4 of teamdetails file
Use version 1.5 of training file
Use version 1.7 of players file
Use version 1.9 of matchdetails file
Use version 1.4 of nationalteamdetails file
Use version 1.2 of club file
New functions getDressURI() and getAlternateDressURI() on HTTeam, HTMatchTeam and HTNationalTeamsTeam classes. Functions getDess() and getAlternateDess() are deprecated.
Add functions get442Experience(), get523Experience(), get550Experience(), get253Experience() on HTTraining class
All match events included
Remove functions getKeeperTrainers(), getKeeperTrainersCost(), getEconomists() and getEconomistsCost() on HTSpecialists class
Remove useStageAtYourOwnRisk() function as there is no stage server for OAuth system.
-
Download PHT v1.16
v1.16 28-08-2010
Use version 2.3 of team file
New function on HTTeam class: getNumberFlagsHome(), getNumberFlagsAway(), getFlagHome(), getFlagAway()
New HTTeamFlag class, used with HTTeam class
Fix HTLeagueSeason when several teams get exactly same standings
Remove deprecated HTMatchTeam::getMiedfieldRating() function
Mark CHPPConnection::getFlagsHome() and CHPPConnection::getFlagsAway() as deprecated
Use HTTeam::getFlagHome() and HTTeam::getFlagAway() functions instead, deprecated function will be removed next version
-
Download PHT v1.15
v1.15 17-06-2010
Enhance HTLeagueSeason, for any season you can get all teams datas (id, name, position, points, matches played, won, lost, draw, goals for, goals against, goal average)
Use version 1.4 of matchlineup.xml
Use version 1.5 of matchorders.xml
Use new RoleID for players in lineup
New getNewPosition() function on HTMatchOrdersPlayer class
-
Download PHT v1.14.1
v1.14.1 19-10-2009
Fix HTNationalPlayers::getPlayer() function
-
Download PHT v1.14
v1.14 02-10-2009
Fix HTTeam::isLeagueLevelAvailable() function
Fix a bug in xml files transfer when safe mode enabled
Enhance cookie management
No more file used, all is in memory : xml transfer process is a bit quicker.
Support of cookie change each 20 minutes : You can have script running without time limit
CHPPConnection construct has one parameter less, use : $HT = new CHPPConnection('name', 'chppId','chppKey');
-
Download PHT v1.13
v1.13 20-08-2009
New version of pages: Alliance, AllianceDetails, MatchsDetails, Players, PlayerDetails, PlayerEvents, TeamDetails, Training, TrainingEvents
New function getNumberOfVisits() in HTTeam class
Fix some phpdoc comments
Rename getMiedfieldRating() function to getMidfieldRating() in HTMatchTeam class.
getMiedfieldRating() is now deprecated and will be removed next version, please update your code.
Remove hasClubHouse() function as tag was removed in xml files
-
Download PHT v1.12
v1.12 30-06-2009
Fix define version of all xml files
Fix economy functions which use Available attribute
Fix functions which returns boolean, use same compare method in all functions
Fix HTNationalTeamDetail class, remove isMoraleAvailable(), isSelfConfidenceAvailable(), isSupportersPopularityAvailable() and isRatingScoreAvailable() functions
New live version 1.4
- addLiveMatch() and deleteLiveMatch() have new boolean parameter: isYouth for a youth match or not, default false
- New getEventByOrder($order) function: Get events by order of appearance
Remove HTTeam::isFriendlyAvailable() function as data is removed from xml
-
Download PHT v1.11
v1.11 25-06-2009
Fix all functions using 'Index' attribute, now using xml nodes count
-
Download PHT v1.10
v1.10 17-05-2009
New getFetchedDate(), getXmlFileName() and getXmlFileVersion() functions in HTGlobal class, all functions are accessibles by all classes which request a xml file
Fix CHPPConnection::searchPlayerByName() function, leagueId is corrected send to request
Fix HTNationalPlayers::getPlayer() function
-
Download PHT v1.9
v1.9 21-02-2009
New player xml : version 1.4
New match orders xml : version 1.4
New events 187 and 287
New getLanguageId() function in HTPlayer class
New isPlayingMatch() function in HTTeamPlayers class
New HTMatchOrdersPlayerOrder object, you can know orders given for a match:
- get number of orders given
- get each order and know all parameters (which minute, which condition, which player, ...)
- get number of orders by player
- get orders by player
Fix events 350, 351, 352
Fix HTMatchTeam::getAttitude()
Fix HTArenaCapacity::isLastRebuildDateAvailable() and HTArenaCapacity::getExpansionDate()
Fix HTMatchOrdersPlayer::getIndividualOrder()
Fix HTArenasStats::getLeagueName()
Fix getAbbreviation(), getHomepageUrl(), getMessage(), getLogoUrl(), getNumberAwaitingRequests(), getDissolutionDate in HTAllianceDetails class
Fix HTLeagueMatch::getHomeGoals(), HTLeagueMatch::getAwayGoals()
Fix HTTransfer::getType()
Fix getGoalsInLeague(), getGoalsInCup(), getGoalsInFriendly(), getGoalsInCareer(), getHattricksInCareer(), getCards(), getInjury(), isTransferListed(), isAbroad() in HTTeamPlayer class
HTPlayer::getNextBirthDay() now returns xml value, it's no more calculated
Remove deprecated functions: CHPPConnection::initLive() and HTLineupPlayer::getRatingStarsAtEndOfGame()
-
Download PHT v1.8
v1.8 06-01-2009
Add new events : 55 to 59 and 73
-
Download PHT v1.7.1
v1.7.1 22-12-2008
Fix matches number managment in live feature
Fix events 62,68,185,501,502
New events: 97,186,285,286,335,350,351,352,360,361,362,500,550
Deprecated initLive() function. Start live by using getLive() function
-
Download PHT v1.7
v1.7 27-11-2008
New HTException class, extends Exception, thrown when error occurs
New event infos, based on Lobster xml/xsd files. You can get named datas for all known events
A lot of class added, HTEvent and one HTEvent* for each event
HTLiveMatchEvent class updated with new functions to handle this new feature
Fix CHPPConnection::checkInitLive() and CHPPConnection::initLive() functions
Fix CHPPConnection::getAllianceMembersByLetter()
Remove deprecated functions: CHPPConnection::getAlliancesById() and HTFlags::getLeagueOfFlag()
-
Download PHT v1.6.4
v1.6.4 21-10-2008
Fix HTPlayerEvents::getEvent
Fix HTPlayer::isSkillsAvailable
Enhance xml error checking
-
Download PHT v1.6.3
v1.6.3 16-10-2008
Fix error handling. In case of error, two exceptions can be thrown with one of these messages :
- Invalid XML: <following by datas received>
- Error: <following by datas received>
Fix disconnect() function, remove cookies file
-
Download PHT v1.6.2
v1.6.2 15-10-2008
Fix all functions which check an attribute with 'true' value
-
Download PHT v1.6.1
v1.6.1 10-10-2008
Fix creation of cookies file when user agent contains invalid characters for filename
-
Download PHT v1.6
v1.6 08-10-2008
Fix functions which use Index and Count attributes, these attributes have been removed in new xml files
Enhance getFlags*() functions :
- For home and away matches flags : You can call then with a date to get only flags from this date to now.
- For all flags functions : You can also get a flag by country name in addition of getting it by number
New : PHT is compatible when safe mode is enabled
New public functions (instead of being private) : HTTeam::isLeagueLevelAvailable(), HTTeam::isFriendlyAvailable()
Deprecated (Deprecated functions will be removed within two versions!) :
- HTFlags::getLeagueOfFlag() is deprecated, use HTFlags::getLeagueOfFlagByNumber() instead
- CHPPConnection::getAlliancesById(), use CHPPConnection::getAlliances() instead
-
Download PHT v1.5
v1.5 13-09-2008
New isTrainer(), getTrainerType(), getTrainerSkill(), getNextBirthDay() functions in HTPlayer and HTTeamPlayer classes
New getTotalStars() and getTotalStarsAtEndOfMatch() in HTLineup class
Fix getNumberTransfers() in HTPlayerTransferHistory class
-
Download PHT v1.4
v1.4 08-09-2008
Fix some notice error in phperror.log
Fix internal way to manage xml data in order to work with session
Fix base cost of specialists
Fix functions which return boolean
Fix getEventsNumber() function in HTPlayerEvents class
Fix getTeam() function in HTLeague class
Fix minor bugs
New functions in HTPlayer class: getAgreeability(), getAggressiveness(), getHonesty()
New parameter for getPrice() function in HTTransfer class, you can specify a currency
Remove old function getMaketValue() on a player transfer as data is not and was not in xml
-
Download PHT v1.3.1
v1.3.1 07-09-2008
Rename clearMatchDetail() into clearSeniorMatchDetail() as it affects cache of senior detail match
Rename clearMatchesDetails() into clearSeniorMatchesDetails() as it affects cache of senior details matches
Fix getEvent() function in HTMatch class in order to get all events of a match even if eventID are not consecutive
-
Download PHT v1.3
v1.3 20-08-2008
Use new .net files
New parameter to getRegion() function in order to get data for a particular region
New getLeagueById(), getLeagueByName(), getLeagueByCountryId() functions in HTWorldDetails class
New getFlagsHome(), getFlagsAway() functions, with HTFlags class
New getFlagsHome(), getFlagsAway(), getFlagsPlayers(), getFlagsRaisedPlayers() functions in CHPPConnection class
New isMatchADerby() function in CHPPConnection class
New getWorldCupMatches() in CHPPConnection class, new classes class to manage datas
New getAMatchesList() and getU20MatchesList() function in CHPPConnection class, new classes class to manage datas
New search features using new .net interface
Fix HTTeamPlayers and HTTeamOldPlayers class
Fix getNumberPlayers() function in HTTeamPlayers class
Fix minor bugs
No more asp page used, all query are done on .net pages
-
Download PHT v1.2
v1.2 16-08-2008
Optimize xml parsing
Use new .net files
Use version 1.3 of match lineup
Use version 1.7 of team players
Use version 1.3 of player details
New file supported : achievements : use getAchievements() function to fetch datas, new classes to manage datas.
New useStageAtYourOwnRisk() function to use stage server to test new features
New getPositionChange() function in league details
New parameter isYouth in getMatchOrders() function
New function getTeamOldPlayers() : returns old players who played in club, new classes to manage datas.
New function getTeamOldCoaches() : returns old players became coach in another club, new classes to manage datas.
New getAlliancesById() function
New getPageIndex() and getPageNumber() functions in HTAlliances class
New isPlayingMatch() function in HTNationalTeamDetail class
New getNationalPlayersStats() and getNationalPlayersStatsWorldCup() functions, new classes HTNationalPlayersStats and HTNationalPlayerStats
New getFirstName(), getLastName(), getNickName() functions in HTTeamPlayer and HTPlayer class, getName() functions are still available in both classes and returns full name of player
New getLoginResult() function which return login result code
Fix notice in phperror.log
Fix syntax bugs
Fix getRoof() functions
Fix matchsdetails version in order to fetch formation data
Fix players fetching data according xml changes
Fix getTransfer() and getPlayer() functions : work as others similar functions, expected parameter starts from 1 to max
Fix cup data in team file according to new changes
Fix getShirtNumber() according to new change
Fix match lineup when player is not selected
Fix search arena by name
Fix getYouthTeamArchiveMatches() function
Fix clearPlayersEvents() function
Fix getTeamByLocalName() function
Fix getNationalPlayers() function
Fix getArena() function according to new change
Fix getAllianceDetails() function according to new changes
Fix all getAlliancesBy*() functions
Fix all functions which return boolean
Rename getRatingStarsAtEndOfGame() into getRatingStarsAtEndOfMatch() function in match lineup
Remove languageID in getPlayerEvents() function
Remove getTrainerName() in HTTeam class
Remove endDate parameter in getTeamTransfersHistory() function, replace it by pageIndex according to new change
Remove getAlliances() and getAlliancesByLang() functions according to new changes
Remove getCreatedDate() in HTTrainingStats according to new changes
-
Download PHT v1.1
v1.1 10-06-2008
Add new RatingStarsEndOfGame value for all players in matchlineup
-
Download PHT v1.0
v1.0 18-05-2008
First public version
Comments (Post yours)
By Samurai-BR the 20-05-2008
I will try here and when possible return on feedback.
Congrats, on advance.
[=
By destor77 the 23-05-2008
excellent work, I hope more examples (Session, statistics, etc.) to migrate my application to this tool.
By Peaso the 26-05-2008
Thank you!
By destor77 the 26-05-2008
By arash the 24-06-2009
By portugal10 the 07-02-2010
By OR the 12-03-2010
Is it possible to use this to find out how many minutes a player played in a match?
Thanks,
OR
By teles the 12-03-2010 teles Hattrick team
Look at HTMatch and HTEvent classes.
By david the 17-04-2010
By teles the 17-04-2010 teles Hattrick team
By Adriano Moutinho the 08-11-2010
I found some minor mistakes on the code examples. missing and missing ; on line 21 of second example.
Anyway, thanks for the development!
By teles the 08-11-2010 teles Hattrick team
By HiseaSaw the 15-11-2010 HiseaSaw Hattrick team
Are these examples up-to-date?
After login in HT I'm getting this error: oauth_problem=parameter_rejected&oauth_problem_advice=When%20obtaining%20a%20request%20token%2C%20you%20must%20not%20supply%20the%20oauth_token%20parameter
By teles the 15-11-2010 teles Hattrick team
Error you got is strange, can you send me your piece of code?
By HiseaSaw the 15-11-2010 HiseaSaw Hattrick team
I'm getting the error just after typing my credentials at Hattrick page (https://chpp.hattrick.org/oauth/authorize.aspx?oauth_token=[TOKEN]).
Thank you again.
By HiseaSaw the 15-11-2010 HiseaSaw Hattrick team
By teles the 15-11-2010 teles Hattrick team
Nice it works for you :)
By fcheitenried the 16-11-2010
The Authorization works. But how is the code for an automatically login. I always get this error:
oauth_problem=token_rejected&oauth_problem_advice=Supply%20a%20correct%20token
When i get the autorization ther ist an token in the url and an security token. But how goes the automaticaly login.
pls help
thx a lot.
By teles the 16-11-2010 teles Hattrick team
Next time the user comes, you can set back this tokens to PHT and request xml.
It's the third piece of code of this page: http://pht.htloto.org/documentation/connection.html
In this example, tokens are set in $userToken and $userTokenSecret
By fcheitenried the 17-11-2010
But now i want a "directly" link. I got the Tokens from last login.
When i only put the code of the 3rd part it does not work.
thx for ur help.
By teles the 17-11-2010 teles Hattrick team
You just request xml files with these tokens set in PHT
There is no direct link to authenticate user if you have his access token, access is already granted. (if token was not revoke by user on hattrick website)
If it's doesn't help you, I didn't understood your problem, so you will have to explain it differently :)
By Orbix the 21-11-2010
There is an error in function getHatStats() :
return ($this->getMidfieldRating()
instead of
return ($this->getMiedfieldRating()
Besides, when I call this line $match->getFirstHalfTime()
I have this error : Undefined class constant 'SERVER_URL' (line 10245)
thanks
By teles the 21-11-2010 teles Hattrick team
Will be fixed in next version, I do my best to publish it tomorrow
By teles the 22-11-2010 teles Hattrick team
By alessandro the 24-11-2010 alessandro Hattrick team
Tanks
Alessandro
By teles the 24-11-2010 teles Hattrick team
$HT->getWorldDetails()->getLeagueById(5)->getTrainingDate();
with "5" the id of the league you want
You can also get it by requesting with getLeagueByCountryId() and a country id, or getLeagueByName() with an english name, getLeague() with a number according number of leagues returned in xml (get number with getTotalLeague())
By alessandro the 24-11-2010
i was arrived at this (poor poor english) reading the hattrick api documentation but i get the wrong way using getleaguebyid('4'), but i saw in your PHT.php the class HTWorldLeague it's not possible use this?
If is possible to contact you i'll be very happy.
Thanks
By teles the 26-11-2010 teles Hattrick team
By alessandro the 26-11-2010
like u said, but i found in the your lib file (PHT.php) the class HTWorldLeague that seems to have trainingdate function .
Alessandro
By alessandro the 02-12-2010
it's me again, i'm upgrade to last versione and i'm trying
to use getLastMatch() function in this way:
$HT = $_SESSION['HT']
$player = $HT->getPlayer('296383769')
echo $player->getLastMatch()
but i receive a fatal error
Call to a member function hasChildNodes() on a non-object in PHT.php on line 9478
Thanks
Alessandro
By teles the 02-12-2010 teles Hattrick team
By Riccardo the 22-12-2010
By alessandro the 20-01-2011
http://www.modalitaprovvisoria.it/triplete/information.php
Thanks a lot
Alessandro
By teles the 22-01-2011 teles Hattrick team
By alessandro the 24-01-2011
http://www.modalitaprovvisoria.it/triplete/banner.gif
Thanks
Alessandro
By alessandro1977 the 30-01-2011
but i can't get my opponent ID
Thank
Alessandro1977
By Alessandro1977 the 30-01-2011
Thank
Alessandro
By teles the 05-02-2011 teles Hattrick team
You can do it like this:
for($i=1; $i<=$list->getMatchNumber(); $i++)
{
$list->getMatch($i)->getId();
//get others match info here
}
By mogito the 15-02-2011 mogito Hattrick team
J'ai une petite erreur sur ma page de callback :
"Fatal error: main() [function.main]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "CHPPConnection" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in mypage.php on line 20"
Une idée ?
By mogito the 15-02-2011
By teles the 19-02-2011 teles Hattrick team
Le fichier PHT.php doit être inclus avant de récupérer l'objet en session, car si l'objet n'est pas connu par l'interpréteur avant qu'il soit chargé de la session, il ne peut pas être chargé correctement, d'où l'erreur :)
By me9mill the 28-02-2011 me9mill Hattrick team
By Saxbar the 15-03-2011
Je ne comprends pas pourquoi le script suivant (inclu dans une class avec des fonctions) ne retourne rien... même pas une erreur...
$this->HT = $_SESSION['HT'];
$this->arenamystats = $this->HT->getMyArenaStats();
$arenamystats->matchesnumber = $this->arenamystats->getMatchesNumber();
J'ai essayé de placer des arguments dans getMyArenaStats(); comme la syntaxe le permet mais rien...
Merci du coup de main ;)
By teles the 17-03-2011 teles Hattrick team
Merci pour la remontée !
By Saxbar the 18-03-2011
mixed $tomorrowWheaterId = null (line 5612)
By teles the 19-03-2011 teles Hattrick team
By Saxbar the 21-03-2011
HTRegion::getName() retourne l'ID de région. Le soucis se situe ligne 5639 ;) j'ai corrigé chez moi mais je te le dis pour la 2.6
J'en profite pour te dire merci car ton boulot est formidable pour nous qui nous appuyons totalement dessus.
By teles the 23-03-2011 teles Hattrick team
By chew the 05-04-2011
https://chpp.hattrick.org/oauth/authorize.aspx?oauth_token=
So it gives me error.. I have put consumerkey and consumersecret correctly..Why is there this problem? :(
By teles the 06-04-2011 teles Hattrick team
By chew the 06-04-2011
And I have discovered that the problem was that curl that hasn't the support for https.. So I have tryied in a hosting with curl and support https and it works!
Thanks for all :)
By chew the 07-04-2011
I see the third piece of code for connection and it's ok.. but i think that to save and reuse data, I have to link them to the user id..
But How can I recover the user id of the user connected in hattrick? Is there a (chpp)link to recover this info or some function in PHT? Or is use of cookies needed?
Thanks :)
By teles the 07-04-2011 teles Hattrick team
But, if you have no self auth system you won't be able to reuse the token (you have to know which user is the visitor, and without own authentication you can't know visitors then reuse token on future visits. You can use cookie but it's not a safe way)
And you can come when you want, don't leave :)
By chew the 07-04-2011
So have I to create a login on my site...? I thought that there was a way to take parameters of the connection/session of the user to the site of hattrick.. (I have seen some external site that shows status of the user on hattrick..if he's connected or not to hattrick.. but I don't know if it works..)
By Mark the 08-04-2011
PHP Notice: Undefined variable: oauth_token_secret in /srv/http/roba/psiutil/lib/PHT/PHT.php on line 194
why?
By teles the 08-04-2011 teles Hattrick team
@Mark: Does oauth process works? After which function call do you get this notices?
By Mark the 09-04-2011
By chew the 09-04-2011
@Mark: I don't know if your problem is similar to my old problem .. (read my message of 06-04-2011.. maybe is that the problem.. ) :)
By Mark the 09-04-2011
I try the script in a php-cli, how can I solve?
By Saxbar the 09-04-2011
Je viens de tomber là dessus (PHT 2.6) :
Fatal error: Call to a member function getAttribute() on a non-object in /class/PHT.php on line 13320
Si cela provient bien de la PHT, merci de me donner la correction car ca me bloque.
Merci d'avance
Saxbar
By Saxbar the 09-04-2011
Si tu pouvais regarder la fonction get433Experience(),
je pense qu'il y a une coquille dans le code (343 au lieu de 433), elle ne retourne rien.
Merci ;)
Saxbar
By teles the 10-04-2011 teles Hattrick team
By Saxbar the 11-04-2011
encore merci :)
By Saxbar the 19-04-2011
Pour la 2.8, class HTLeagueTeam, getPositionChange(), coquilles sur les lignes 7298 à 7302.
@+ Christophe
By Saxbar the 19-04-2011
Je ne comprends pas, getPositionChange() ne retourne rien.
By teles the 20-04-2011 teles Hattrick team
$this->hasPostionChange = $this->getXml()->getElementsByTagName('PositionChange')->length > 0;
By Saxbar the 21-04-2011
By Saxbar the 21-04-2011
By Saxbar the 22-04-2011
By teles the 22-04-2011 teles Hattrick team
By Saxbar the 22-04-2011
By teles the 22-04-2011 teles Hattrick team
http://www.hattrick.org/Forum/Overview.aspx?v=0&f=765917
By Reelax the 07-05-2011
Can someone tell me how to perform a connection to HT for our OWN team ? So if we already know our login and our secret password, what code should we use ?
I mean if I want to create a website presenting my own team.
Thanks
By teles the 07-05-2011 teles Hattrick team
By eraser the 10-05-2011
How could i use the code from the last box? Where do i get the right token?
Thanks
By teles the 11-05-2011 teles Hattrick team
By josh the 17-05-2011
maybe a noob question but where do i get those consumerKey and consumerSecret?
Must i request them in hattrick via registering an app or how do i get this?
Would be very pleasant if somebody can help a beginner :*-/
By teles the 17-05-2011 teles Hattrick team
By Marius_J the 20-05-2011
Thank you for answering! :)
By teles the 21-05-2011 teles Hattrick team
The callback url is the url where the user will be redirected after login on Hattrick website, it must be an url on your site in which you will receive data for getting OAuth token.
By WouterT the 21-05-2011
Thanks for this great program, but I've got a question; is it also possible to just save the xml generated by hattrick on my webserver and do imports from that file?
1. I've got a backup then.
2. I can use data from those files for "stuff" I add later on.
Thanks,
Wouter
By Marius_J the 21-05-2011
I am using the website tool "Joomla!" to build my website. U am a beginner with this, and I don't understand how I request token ect.
The codes above in the black boxes, where do I put them?
Thank you,
Marius_J
By teles the 21-05-2011 teles Hattrick team
You have to put this code somewhere in page, or module, ... which will do the chpp connection for your site.
By Marius_J the 22-05-2011
Could you please help me with a little description?
Thank you,
Marius_J
By teles the 25-05-2011 teles Hattrick team
By leroutard the 28-06-2011
I want to know if we can get all team from a leagueId ( poule en français) ?
If yes, which class handle this ? ( I can't find it )
Thanks
By teles the 28-06-2011 teles Hattrick team
You can search league with search xml file, yu got leagueUnitId, then with league xml file you can find team of this league.
By leroutard the 28-06-2011
By mrbrown79 the 26-07-2011
Great tool.
Do you have an overview of the memory usage of PHT?
In the code skeleton below, I try to get the player data from a large amount of leagues. At some point, I get a memory exhausted error. So my theory is that the memory usage accumulates for each TeamPlayers lookup.
Any comments on this theory?
$HT = new CHPPConnection('mSoqGeWBwLGPPCCKHLDwwT', 'xx','xx'');
$HT->setOauthToken($userToken);
$HT->setOauthTokenSecret($userTokenSecret);
for($leagueId=$firstLeague;$leagueIdgetLeague($leagueId);
for($i=1; $igetTeam($i);
$leagueTeamId = $leagueTeam->getTeamId();
$players = $HT->getTeamPlayers($leagueTeamId);
for($j=1; $jgetNumberPlayers(); $j++)
{
$player = $players->getPlayer($j);
$name = addslashes($player->getName());
$age = $player->getAge();
$salary = $player->getSalary() ;
$stamina = $player->getStamina();
$tsi = $player->getTsi() ;
$exp = $player->getExperience() ;
$id = $player->getId() ;
sql_insert(); // defined elsewhere
}
}
}
By mrbrown79 the 26-07-2011
Anyway, the code is three nested for loops.
1st running through leagues
2nd running through teams (of each league)
3rd running through players (of each team)
All is done on the same CHPPConnection.
Do you think, the memory usage of each player lookup will accumulate in such a case?
By teles the 26-07-2011 teles Hattrick team
By mrbrown79 the 27-07-2011
As the process of data collection is pretty time-consuming, I want it to be (close to) optimal with reference to processing time. Please, let me know if you have any tricks in regards to this :)
By teles the 27-07-2011 teles Hattrick team
you can call $HT->clearTeamPlayers($leagueTeamId);
When you call getTeam($id), after you get all you want you can call clearTeam($id)
It will clear pht cache (there is a cache on each xml file) and then you will consume less memory
By halftime the 10-08-2011
../trunk/PHT.php on line 13477"
function: $player->getRatingStarsAtEndOfMatch();
By guillermo the 22-10-2011
I have a nab doubt, when u say that we can save user token u mean on acutal session or in a db?
if its on db, when the user puts login i can manage the conecction to his team without doing 1st step?
i dont rly undertand steps. 1st one i give my chpp credentials and a url for users, they log in on hattrick and i get a request with their oauth_token and oauth_verifier.
retrieveAccessToken method is to validate that ? and after that i can store that access data in a db?
By teles the 26-10-2011 teles Hattrick team
Yes, retrieveAccessToken is to validate the token and give you real access to user data.
When you got the final token, you can save it to reuse later and avoid firsts login steps.
By Thomas the 16-11-2011
Fatal error: Call to undefined method HTTeam::getNumberFlagsHome()
I used the above example...
By Hoedinie the 22-11-2011 Hoedinie Hattrick team
By teles the 08-01-2012 teles Hattrick team
By teles the 08-01-2012 teles Hattrick team
When you retrieve the token in last step, you can save it on your side, as you want, and reuse it without doing whole auth process.
By Mark the 13-01-2012
By teles the 20-01-2012 teles Hattrick team
There is no easy way to get current week, you have to test if week match is played or not.
By fcheitenried the 06-03-2012
Want to have the whole table... how to do this...
By teles the 12-03-2012 teles Hattrick team
By fcheitenried the 22-03-2012
i tried with:
$HT->getLeague()->getLeagueTeam('1')->getPoints();
also tried with:
$HT->getLeague()->getLeagueTeam()->getTeam('1')->getPoints();
i wantet to have the points of the Team at first position. Do i am completly Wrong.
pls help
By teles the 12-04-2012 teles Hattrick team
You have to do: $HT->getLeague()->getTeam(1)->getPoints();