Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author AntoineH

    (@antoineh)

    The new version uses a template (with template params) to define the HTML for the ranking. If you want to use a different template you can hook into the code with your own plugin or by adding some code to your template’s functions.php file. The help page in the admin has more information on the available template params.

    To make it easy for you I made a small extension plugin. Place the following file in your /wp-content/plugins folder and activate the plugin.
    And the avatars are back 🙂

    https://dl.dropboxusercontent.com/u/397845/wordpressfootballpool/football-pool-avatar.php

    After copy and pasting the code into a file and uploading it to /wp-content/plugins folder, I get the following fatal error when trying to activate the plugin:

    Parse error: syntax error, unexpected T_FUNCTION in /xxx/xxx/public_html/worldcup2014/wp-content/plugins/football-pool-avatar.php on line 11

    Line 11 is: add_filter( ‘footballpool_ranking_ranking_row_template’, function( $template, $all_user_view, $type ) {

    I’m not a PHP pro, so any help is appreciated.

    Thanks!

    Plugin Author AntoineH

    (@antoineh)

    I guess you’re still on PHP version 5.2. I used a closure in my file which is not supported in that version.

    Try this file:
    https://dl.dropboxusercontent.com/u/397845/wordpressfootballpool/football-pool-avatar-php5.2.php

    Hi AntoineH, thanks for the extra bit of code. It works to show the avatars in the ranking. I have two questions:

    1) Should I edit your code to make bigger avatars or should I do this in WP main?

    2) Is it possible to show the avatars on the user prediction page?

    I am not really into php, but still working to find answers myself, so don’t worry if you are really busy (which is my guess 🙂

    Really nice work btw!

    Plugin Author AntoineH

    (@antoineh)

    1. You don’t have to change the code. You can add the following line to your wp-config.php file (and change the value) to change the avatar size:

    define( 'FOOTBALLPOOL_MEDIUM_AVATAR', 28 ); // size in px

    2. The user predictions (I guess you’re referring to the overview of user predictions for a match) does not have a template (yet). So you will have to alter the plugin’s code for that. Remember that when you change the code, you won’t be able to upgrade (at least not without losing your changes).
    The function used for the display of match predictions is:
    Look for the line that shows the user name and change it to:
    $pool->get_avatar( $row['user_id'], 'medium' ) . $pool->user_name( $row['user_id'] )

    Or, you can use the footballpool_statistics_matchpredictions_html filter to alter the HTML for that page. There is an example in the help file that changes HTML with the help of the Simple DOM ‘plugin’; you can try using that technique, but it requires some more knowledge of PHP.

    Hi Guys,

    I’m trying to change the avatar the size this way but nothing is happenings.

    Do you have idea why?

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Avatars missing in ranking’ is closed to new replies.