Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter lloydsmartin3

    (@lloydsmartin3)

    I have the same problem, when 2 teams have the same score this teams have the same position:
    Image

    I find this in class-sp-league-table.php in the line 542

    public function calculate_pos( $columns ) {
    		$this->counter++;
    
    		// Replace compare data and use last set
    		$compare = $this->compare;
    		$this->compare = $columns;
    
    		// Loop through priorities
    		foreach( $this->priorities as $priority ):
    
    			// Proceed if columns are not equal
    			if ( sp_array_value( $columns, $priority['column'], 0 ) !== sp_array_value( $compare, $priority['column'], 0 ) ):
    
    				// Increment if not equal
    				$this->pos = $this->counter;
    				return $this->counter;
    
    			endif;
    
    		endforeach;
    
    		// Repeat position if equal
    		return $this->pos;
    	}

    When I modify or comment some things the numbers who are repeating change to 0.

    Plugin Author Brian

    (@brianmiyaji)

    @lloydsmartin3 @llenolleno we’ll be releasing an update that lets you switch between comparative and incremental positions. For now, you can add the following line directly below $this->counter++;

    return $this->counter;

    Or simply replace the calculate_pos function with this:

    public function calculate_pos( $columns ) {
    	$this->counter++;
    	return $this->counter;
    }

    Thank you!
    Now is working fine!
    I use this

    public function calculate_pos( $columns ) {
    	$this->counter++;
    	return $this->counter;
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘league table’ is closed to new replies.