PDA

View Full Version : Change total matches



Sjf0464
17-12-2016, 09:31 PM
Hi,

Is there a way to change the total matches in the league tables to Games Played. For example instead of showing 140 total matches, (as we do 20 prediction games each week), it would show 7 Games Played ?
Regards

kostas
19-12-2016, 10:53 AM
Hello,

if i understood correctly you wish instead of the total matches to show the total match days the user participated?

Best Regards

Sjf0464
19-12-2016, 03:44 PM
Hi,
yes, sorry I never made it clear. match day totals rather than total matches.

regards

kostas
19-12-2016, 04:47 PM
It is possible

the answer that follows is not the best practice , but in order to apply the changes with the minimum amount of moves it is the best available

you will have to change the code in file <joomla directory>/components/com_masterleaguepro/models/standings.php

near line 55 the following code should be present


$query="SELECT u.id , u.username,SUM(log.points) as points,SUM(log.win) as win,SUM(log.draw) as draw,SUM(log.lose) as lose,SUM(log.matches_played) as matches_played ,SUM(log.goal_for) as goal_for, SUM(log.goal_against) as goal_against , SUM(log.goal_difference) as goal_difference
FROM `#__masterleaguepro_users` mu
INNER JOIN `#__users` u ON mu.user_id=u.id
INNER JOIN `#__masterleaguepro_user_log` log
ON log.user_id=mu.user_id
WHERE log.league_id=$league AND mu.league_id=log.league_id
GROUP BY mu.user_id
ORDER BY points DESC , goal_for DESC , goal_difference DESC";



you will have to change it to


$query="SELECT u.id , u.username,SUM(log.points) as points,SUM(log.win) as win,SUM(log.draw) as draw,SUM(log.lose) as lose,COUNT(DISTINCT log.matchday_id) as matches_played ,SUM(log.goal_for) as goal_for, SUM(log.goal_against) as goal_against , SUM(log.goal_difference) as goal_difference
FROM `#__masterleaguepro_users` mu
INNER JOIN `#__users` u ON mu.user_id=u.id
INNER JOIN `#__masterleaguepro_user_log` log
ON log.user_id=mu.user_id
WHERE log.league_id=$league AND mu.league_id=log.league_id
GROUP BY mu.user_id
ORDER BY points DESC , goal_for DESC , goal_difference DESC";


Best regards

Sjf0464
19-12-2016, 09:33 PM
Hi,

Many thanks, this has worked.
Can you let me know which File I need to go to to change the text in the league, would like to change the text total matches to Total Games.
Regards

kostas
20-12-2016, 10:22 AM
Hello,

i am glad that i could help, the translation file is located at <joomla directory>/language/en-GB/en-GB.com_masterleaguepro.ini you should be able to find there the text you are looking for.If you are using multiple languages in your joomla installation you can copy that file in the other language directory and support multiple languages.

Best regards.

Sjf0464
20-12-2016, 10:35 PM
Hi,

Great thanks for the info, much appreciated
Regards