Short team name for player stats

Status: under development
Branch: https://gitlab.com/joomleague/joomleague/tree/3.0.0

Moderator: And_One

davilafran
Newbie
Posts: 13
Joined: Wed Feb 20, 2013 4:38 pm

Short team name for player stats

Postby davilafran » Thu Nov 10, 2016 3:38 pm

Hi!

Which variable name should be used to show the short version of the team name in players info view? On the file player/default_playerstats.php we have

Code: Select all

<?php
      if ($this->config['show_playerstats_teamlink'] == 1) {
      echo JHtml::link($link2,$player_hist->team_name);
      } else {echo $player_hist->team_name;}
      ?>


That "team_name" shows the long name of the team and is not convenient for me as some team names are too long.

How do we change it to the short team version?

Thanks.

davilafran
Newbie
Posts: 13
Joined: Wed Feb 20, 2013 4:38 pm

Re: Short team name for player stats

Postby davilafran » Fri Nov 11, 2016 2:19 pm

Solved!

Just head onto: "./com_joomleague/model/player.php" and there search for "public function &getPlayerHistory" (line 247 on version 3.0.21.124789c). There is where the player career shows up. Then a series of abbreviation or substitutions happens to launch queries to the database.

t substitutes "team": #__joomleague_team AS t (line 271)
So "t.id=pt.team_id" the id of the team shown on each row of career is picked from the team_id of each project. This happens on the table "_joomleague_project_team".

To decide which name is shown, that file uses the line 260. "t.name AS team_name". So originally is set to look for the column "name" to return the name of the team, given a certain team project id. To use short name, just change "t.name AS team_name" for "t.short_name AS team_name". Then it will return the value of the column "short_name" of the table "_joomleague_team".

Hope it helps.

Cheers!


Return to “3.0.22.57ae969-Blue (Joomla: 3.x)”

Who is online

Users browsing this forum: No registered users and 0 guests

cron