Forums

[Plugin: Leaguemanager] Table sorting (3 posts)

  1. Garthnait
    Member
    Posted 3 months ago #

    Hey Guys.

    I have the following problem. The custom sorting of tables in leaguemanager are 1.) points, 2.) goal difference and 3.) teamID. That is not what i need.

    What i need is 1.) points, 2.) goal difference and 3.) goals done.

    Is there anyway to edit/change this to the other-two-scores.php??

  2. adzeds
    Member
    Posted 3 months ago #

    I need this to!

    Hopefully there will be a new update soon because there are many problems with the current version!

  3. Garthnait
    Member
    Posted 3 months ago #

    I tried my self to change the sorting, but it doesn't work.

    I changed this

    /**
    	 * rank Teams
    	 *
    	 * @param array $teams
    	 * @return array of teams
    	 */
    	function rankTeams( $teams )
    	{
    		foreach ( $teams AS $key => $row ) {
    			$points[$key] = $row->points['plus'];
    			$done[$key] = $row->done_matches;
    			$diff[$key] = $row->diff;
    		}
    
    		array_multisort( $points, SORT_DESC, $diff, SORT_DESC,  $done, SORT_ASC, $teams );
    		return $teams;
    	}

    into this

    /**
    	 * rank Teams
    	 *
    	 * @param array $teams
    	 * @return array of teams
    	 */
    	function rankTeams( $teams )
    	{
    		foreach ( $teams AS $key => $row ) {
    			$points[$key] = $row->points['plus'];
    			$goals[$key] = $row->goals['plus'];
    			$done[$key] = $row->done_matches;
    			$diff[$key] = $row->diff;
    		}
    
    		array_multisort( $points, SORT_DESC, $diff, SORT_DESC,  $goals, SORT_DESC, $done, SORT_ASC, $teams );
    		return $teams;
    	}

    but nothing changed in the sorting.

Reply

You must log in to post.

About this Topic