WordPress.org

Ready to get started?Download WordPress

Forums

Football Pool
[resolved] Show toto results in raking (4 posts)

  1. joselo4
    Member
    Posted 1 year ago #

    Hello,

    i would to know how can i configure the plugin to show how many toto results and the w-d-l result had score each user in the rakning.

    Example how it works now:

    Position - User Name - Points
    1 - Joselo4 - 20

    and i would like to show this:

    Position - User Name - Points - Toto Points - W-D-L Points
    1 - Joselo4 - 20 - 2 - 1

    Its that possible ?

    Thank you

    http://wordpress.org/extend/plugins/football-pool/

  2. AntoineH
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that should be possible. The scorehistory table has all the information you need. If you do a GROUP BY on userId and COUNT the columns (full, toto) that have a value of 1 that should do the trick. Please note that points for both questions (type = 1) and matches (type = 0) are stored in the table, so for your query you have to include only 'type = 0'.

    Do you have any PHP and SQL knowledge?

  3. AntoineH
    Member
    Plugin Author

    Posted 1 year ago #

    Oh, I did a quick look in the code. The data is already there. All you have to do is change the print_pool_ranking function to also display the $row['full'] and $row['toto'] values.

    For example:

    $output .= sprintf( '<tr class="%s"><td style="width:3em; text-align: right;">%d.</td>
    					<td><a href="%s">%s%s</a>%s</td>
    					<td>%d</td>
    					<td>%d</td>
    					<td>%d</td>
    					%s
    					</tr>',
    				$class,
    				$i++,
    				esc_url( add_query_arg( array( 'user' => $row['userId'] ), $userpage ) ),
    				$this->get_avatar( $row['userId'], 'medium' ),
    				$row['userName'],
    				Football_Pool::user_name( $row['userId'], 'label' ),
    				$row['points'],
    				$row['full'],
    				$row['toto'],
    				( $all_user_view ? $this->league_image( $row['leagueId'] ) : '' )
    			);
  4. joselo4
    Member
    Posted 1 year ago #

    Your second post was great!

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags