WordPress.org

Ready to get started?Download WordPress

Forums

Football Pool
[resolved] Team flags(logos) on the groups page & Group shortcode (5 posts)

  1. MigenNep
    Member
    Posted 7 months ago #

    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)!

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

  2. MigenNep
    Member
    Posted 7 months ago #

    By the way, awesome plugin. Thank you for sharing your work with all of us.

  3. AntoineH
    Member
    Plugin Author

    Posted 6 months ago #

    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.

  4. MigenNep
    Member
    Posted 6 months ago #

    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.

  5. AntoineH
    Member
    Plugin Author

    Posted 6 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.