WordPress.org

Forums

Football Pool
[resolved] rounds in ascending and descending games possible? (5 posts)

  1. giObanii fiOri
    Member
    Posted 1 year ago #

    rounds in ascending and descending games possible?

    I'm using google translator
    not if I explain here will leave a couple of images

    Image of Date descending
    http://www.pixhost.org/show/5002/18160269_example1.png

    Image I want to do
    http://www.pixhost.org/show/5002/18160273_example2.png

    Thanks!

  2. AntoineH
    Member
    Plugin Author

    Posted 1 year ago #

    If I understand correctly you want to display the match types (Jornada) in descending order and the matches in ascending order. This is not possible without a change in the code.

    If you change the get_match_sorting_method function in classes\class-football-pool-matches.php to the code as shown below it should work:

    public function get_match_sorting_method() {
    	$order = Football_Pool_Utils::get_fp_option( 'match_sort_method', FOOTBALLPOOL_MATCH_SORT, 'int' );
    	switch ( $order ) {
    		case 1:
    			$order = 'matchtype DESC, m.play_date DESC, m.id DESC';
    			break;
    		case 0:
    		default:
    			$order = 'matchtype DESC, m.play_date ASC, m.id ASC';
    	}
    
    	return $order;
    }

    I will add the new sorting option to the next version of the plugin.

  3. giObanii fiOri
    Member
    Posted 1 year ago #

    Thank you very much for your reply

    When overriding public function get_match_sorting_method all matches also disappear.
    http://www.pixhost.org/show/5005/18166051_01255.jpg

    this is what is in classes\class-football-pool-matches.php

    public function get_match_sorting_method() {
    		$order = Football_Pool_Utils::get_fp_option( 'match_sort_method', FOOTBALLPOOL_MATCH_SORT, 'int' );
    		switch ( $order ) {
    			case 1:
    				$order = 'm.playDate DESC, m.nr DESC';
    				break;
    			case 0:
    			default:
    				$order = 'm.playDate ASC, m.nr ASC';
    		}
    
    		return $order;
    	}

    I am using the 2.2.5 version of the plugin

    Thanks!

  4. AntoineH
    Member
    Plugin Author

    Posted 1 year ago #

    Whoops, sorry :-) I based the code on my development branch. And that branch has some changes in column names.

    Try this:

    public function get_match_sorting_method() {
    	$order = Football_Pool_Utils::get_fp_option( 'match_sort_method', FOOTBALLPOOL_MATCH_SORT, 'int' );
    	switch ( $order ) {
    		case 1:
    			$order = 'matchtype DESC, m.playDate DESC, m.nr DESC';
    			break;
    		case 0:
    		default:
    			$order = 'matchtype DESC, m.playDate ASC, m.nr ASC';
    	}
    
    	return $order;
    }
  5. giObanii fiOri
    Member
    Posted 1 year ago #

    Thank you very much for your help now I worked great
    I had tried changing that line before asking for support but I could not.

    Thank you for your wonderful plugin
    A couple of days ago I sent him a donation
    was not a huge amount (many euros)
    since even I am starting my website

    Sorry for my English
    I'm using google translator

    Greetings from Mexico!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Football Pool
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.