Radio Streaming - 50% Lifetime Discount with purchase of any Joomla Web Radio Addon. Discount Code: STR15-Z
See Radio Streaming Plans

Results 1 to 7 of 7

Thread: Change total matches

  1. #1

    Change total matches

    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

  2. #2
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    Hello,

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

    Best Regards

  3. #3
    Hi,
    yes, sorry I never made it clear. match day totals rather than total matches.

    regards

  4. #4
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    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
    Code:
    $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
    Code:
    $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

  5. #5
    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
    Last edited by Sjf0464; 19-12-2016 at 09:41 PM.

  6. #6
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    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.

  7. #7
    Hi,

    Great thanks for the info, much appreciated
    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •