WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Author Avatars List] Bug in "Link users to..." (10 posts)

  1. mayuxi
    Member
    Posted 4 years ago #

    Hello!

    First of all, thanks for the great plugin!

    But I have a strange bug and can't fix it. I want the avatars to link to authors' pages, but on my site if user has his own website (filled on profile), in sidebar that user's avatar will link to his website (not the author page!)/

    When I try to disable links at all, it's still the same: people who didn't fill homepage in profile is ok (no a href), but who did - you still can click on them.

    HTML code (in widget) for people without website is also no problem:

    <div class="user">
    <a href="http://www.russianshanghai.com/author/bondarenko/">
    <span class="avatar">
    <img src="/avatars/bondarenko.jpg" class="avatar avatar-65 avatar-default" alt="Username..." title="Username..." height="65" width="65">
    </span>
    </a>
    </div>

    But code for "users with websites" is not:

    <div class="user">
    <a href="http://www.russianshanghai.com/author/mayuxi/">
    <span class="avatar"></span>
    </a>
    <a href="http://ezhe.ru/fri/656" rel="external nofollow" title="Посетить  Александр Мальцев’s website" class="snap_noshots">
    <img src="/avatars/ma.jpg" class="avatar avatar-65 avatar-default" alt="Александр Мальцев" title="Александр Мальцев" height="65" width="65">
    </a>
    </div>

    Website: http://www.russianshanghai.com/

    I'm used version 0.7.2 before and it works perfect, then when I updated to 0.7.3 I found that bug. I can't fixed by myself, I read all forums but still can't found solution, so I just did downgrade to 0.7.2. Now, 0.7.4 is still problem.

    Another bug: for avatars has duplicated "alt" attribute!

    Please help!

  2. Pbearne
    Member
    Posted 4 years ago #

    We did some work around profile and get buddy press to work etc. along with a beefed up profile page.
    I will have look at this over the week-end and thanks for the duplicated "alt" spot

  3. Pbearne
    Member
    Posted 4 years ago #

    Hi

    I have had quick look your page and it looks like the two a href just on top of each other

    try setting the z-index of snap_noshots class to something

    the page works as you want in firefox so it looks a bit like a IE problem

    I will have look at the code to see if we can make the code cleaner for you.

  4. annaba1
    Member
    Posted 4 years ago #

    Hi!

    First of all, thanks for this plugin,it's very useful!

    I have the same problem, and I'd like to ask another things.I need the author's avatar (when the setting is "link to author page") links to a specific page (ex: http://www.asifaitalia.org/?page_id=2255&uid=87, where 87 is the author's ID). Is it possible to do this?

    If it isn't possible... it's enough to disable link.

    Thanks!

  5. mayuxi
    Member
    Posted 4 years ago #

    Hi, pbearne!

    Thanks for reply! But it's not z-index problem, it's same in Firefox and IE. You can also check this page validation results and see, that's plugin returns bad urls.

    Please assist!

    Thanks again!

  6. mayuxi
    Member
    Posted 4 years ago #

    Duplicated "alt" is fixed. User.List.class.php / Lines 189-191

    $avatar = get_avatar($user->user_id, $avatar_size);
    $avatar = preg_replace('@alt=["\'][\w]*["\'] ?@', '', $avatar);
    $avatar = preg_replace('@ ?\/>@', ' title="'.$name.'" />', $avatar);
  7. mayuxi
    Member
    Posted 4 years ago #

    F**! I found the problem! This is incompatibility with Add Local Avatar plugin. But your plugin worked perfect before I upgraded it to 0.7.4.

  8. clikkare
    Member
    Posted 4 years ago #

    Solution:

    add-local-avatar/avatars.php Versione 7.5

    line 128

    $url = $user->user_url;

    $url = $user->the_author_posts_link;

    line 138

    $url = $user->user_url;

    $url = $user->the_author_posts_link;

    http://www.clikkare.it

  9. Ben
    Member
    Posted 4 years ago #

    Thanks for figuring this out, guys. I have just commited a fix for this problem to Trunk, see changset [200419] for details.

  10. mayuxi
    Member
    Posted 3 years ago #

    clikkare, doesn't work, because there is no the_author_posts_link inside get_userdata

    $user = get_userdata($id);
    		if($user) {
    			$email = $user->user_email;
    			$name = ($avatar_options['name'] == 'on' ? $user->nickname : $user->first_name . ' ' . $user->last_name);
    			$url = $user->user_url;
    		}

Topic Closed

This topic has been closed to new replies.

About this Topic