Skip to:

Social 0.1.8 by Utkarsh Kukreti

  • bbrian017


    I see that one of my members is using a theme named Social 0.1.8 by Utkarsh Kukreti.

    When people comment it continues to grab here picture and not the commentators.

    Any suggestions to why this is happening?

    In her admin cp it’s showing the users avatar but on her blog the avatars are all hers.



Viewing 7 replies - 1 through 7 (of 7 total)

  • Tynan Beatty


    i had a similar problem when filtering bp avatar fetcher.


    Could you post a link to the site or message me?



    Hi Utkarsh Kukreti I have never seen your reply I will message you now.



    This is a core BP problem, so it’s not the theme. This will be fixed for 1.2.2. It only occurs on sub blogs, not the root blog.



    Well actually I’ve gone through all of my themes and edited the comments.php file. I found all the code like this:

    <?php foreach ($comments as $comment) : ?>

    <li class="comment <?php echo $oddcomment; ?>" id="comment-<?php comment_ID();$ix++; ?>"> ">#

    <?= $ix; ?>

    <!-- display avatars -->

    <?php if (function_exists('get_avatar')) { ?>

    <?php echo get_avatar(get_comment_author_email(), '32'); ?>

    <?php } ?>


    <?php comment_author_link() ?>


    <?php if ($comment->comment_approved == '0') : ?>

    <?php _e('Your comment is awaiting moderation.');?>

    <?php endif; ?>

    <small class="commentmetadata">" title="">

    <?php comment_date('F jS, Y') ?> <?php _e('at');?> <?php comment_time() ?>

    <?php edit_comment_link('e','',''); ?>


    <?php comment_text() ?>

    <?php /* Changes every other comment to a different class */

    if ('alt' == $oddcomment) $oddcomment = '';

    else $oddcomment = 'alt';


    <?php endforeach; /* end for each comment */ ?>

    and replaced it with code the following code:

    <?php wp_list_comments(); ?>

    Then I went through my css files and changed them accordingly. Big pain but it worked for now.

    I found a solution for my version of the problem and learned a few things along the way that might help with your BuddyPress avatar problems.

    Full text at:

    What I found:

    In the file /wp-content/plugins/buddypress/bp-core/bp-core-avatars.php, lines 344 and following contain the following code:

    global $authordata;

    if ( is_object( $user ) )

    $id = $user->user_id;

    else if ( is_numeric( $user ) )

    $id = $user;


    $id = $authordata->ID;

    if ( empty( $id ) )

    return $avatar;

    I think that last “if statement” may be there to catch cases where the commenter does not have a BuddyPress account (which is the majority on my site at this point). However, if you look closely at the block just above the “if ( empty( $id))” you will notice $id is never going to be empty at this point.

    That suggests two possible solutions.

    Solution 1:

    I have not tested this, but it makes sense that you could move the last “if statement” above the first “if statement.” That way you can check for “empty( $id )” before it gets set to”$authordata->ID”

    Solution 2:

    I found it works quite well to add these lines just under the last “if statement.”

    if ( is_string( $user ) )

    return $avatar;

    This will catch any case where an email is sent as input, which is what all (most) non-buddypress themes send. Cases where numbers or objects are sent (the BuddyPress method) will be handled normally.

    Maybe I can get this added into the next release of BuddyPress.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Social 0.1.8 by Utkarsh Kukreti’ is closed to new replies.
Skip to toolbar