Is there a way to display the site's default picture if the user hasn't uploaded an avatar?

Comments

rayvan’s picture

Using the user_profile tpl - use the following code and replace the URL

  if($user->picture) {print theme('user_picture', $user);}

else {

print '<img src="http://www.yourdomain.com/images/nopic.jpg" alt="This user hasn\'t posted a picture yet or whatelse" />';

}

Thorworx’s picture

Priority: Normal » Critical

This should be pretty simple to implement...

Has this module been abandoned?

ericinwisconsin’s picture

Wow, I posted this a year and a half ago. I learned a few things about Drupal since.

Whether you're using 5.x or 6.x, go to admin/user/settings and you can specify a default picture there.

pukku’s picture

It hasn't been abandoned -- there is a D6 port. However, what time I have to spend on it I am mostly spending trying to figure out how to turn this into a views plug-in.

Ricky

pooneil’s picture

Status: Active » Closed (fixed)