• I’m looking for some help comming up with a way to have the User Photo plugin work with Gravatars. So where if there is no user photo, it will use the gravatar of the user instead in the comments area.

    Anyone know where I would start?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have been trying to figure how the User Photo to work with Gravatar. But my efforts turned futile. Can anybody help us?

    Thread Starter John Leschinski

    (@picard102)

    Ya something like, if the user photo dose not exist use gravatar function, but if there is a photo present use it instead.

    This worked for me in the comments.php of the theme. Find:
    <?php echo get_avatar( $comment, 32 ); ?>
    replace with:

    <?php
    	$the_photo = '';
    	if (function_exists('userphoto__get_userphoto') && defined('USERPHOTO_THUMBNAIL_SIZE') && !empty($comment->user_id))
    		$the_photo = userphoto__get_userphoto($comment->user_id, USERPHOTO_THUMBNAIL_SIZE, /* before */ '', /* after */ '', array('class' => 'avatar'), /* def src */ '');
    	if (!empty($the_photo)) echo $the_photo;
    	else echo get_avatar( $comment, 32 );
    ?>

    checks should allow you to deactivate the plugin without having a problem on the template. It also inserts the “avatar” class for your stylesheet that was forgotten in the original plugin. Hope that helps.

    I′m using User Photo with Visionary theme and got It all to work perfectely – Thanks Surfalot

    Einar

    Hi,

    I replaced it how surfalot told, but with my theme Atahualpa it doenst work. All I get is a the avatar picture, although the user I tested have an user photo.

    thanks
    itachy

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘User Photo Gravatar’ is closed to new replies.