Support » Plugin: Football Pool » Team flags(logos) on the groups page & Group shortcode

  • Resolved MigenNep


    Is there any way to display the flags(logo) of teams next to their names on the ranking table?

    I tried to figure it out by looking at class-football-pool-matches.php and copying some code(wherever the term “flag” appeared) from there, into class-football-pool-groups.php for about 5 hours, but my php skills are close to NONE.

    After many trials and errors, the closer I got(I believe), was leaving just the code below to class-football-pool-groups.php after line:375, but still no success:

    $output .= sprintf( '<td class="flag">%s</td>',
    							                $teams->flag_image( (integer) $row['teamId'] )

    I wonder if you could help me a bit with this issue(unless it requires a lot of code writting)!

Viewing 4 replies - 1 through 4 (of 4 total)
  • By the way, awesome plugin. Thank you for sharing your work with all of us.

    Plugin Author AntoineH


    Thanks for the compliment.

    If you want to add the flags to the group standing tables (on the page, shortcode and in the widget), make the following changes to the code in class-football-pool-groups.php (version 2.2.5):

    after line 313 add the following line
    $team_flags = $teams->team_flags;

    before line 376 (the if-statement) add the following line:
    $team_name = sprintf( '<img src="%s"> %s', $team_flags[$teamranking['team']], $team_name );

    This will put the image before the name; simply change the order of the image and the team name to show it the other way around. This may also require some extra styling as the tables are relatively small, but that shouldn’t be too hard after the image is in place.

    Thank you sooo much, it worked perfectly. And yes the img size isnt a problem, I`m pretty comfortable at styling.

    At some point I had figured the insertion of $team_flags = $teams->team_flags; at the proper line… but quite obviously the code I was using at/around the if-statement, was totally wrong.

    P.S – I have already translated the front-end of the plugin in Albanian(personally didnt need to translate the admin stuff), but now I think I`ll do it all, and send the translation to you… its the least I can do to show my appreciation for this plugin and your help.

    Plugin Author AntoineH


    Good to hear that it works. Please note that when upgrading the plugin you will have to make your changes again, so document them well 🙂

    And the extra translation would be great. Thanks for that.
    But, as I am working on a new version that is almost finished, I would like to ask you if you would like to translate that new version. The new version has different texts and a lot of texts from the old version have changed or are removed. If you mail me your current translation at wordpressfootballpool [at] gmail [dot] com, I can send you the beta version of the plugin (for testing the translation) and an updated po-file for the new version.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Team flags(logos) on the groups page & Group shortcode’ is closed to new replies.