diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-10 06:18:35 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-10 06:18:35 +0000 |
commit | 9b90b4b0cd464424f3f9a4214d265db69b3691dc (patch) | |
tree | a8e42c5442b5ed06aba7637ba33fcb49af8a833a /modules/user/models | |
parent | 5690e58c4577e9b0a29f0c1d95edc7e6715a2cf6 (diff) |
Use the theme's avatar as the default if Gravatar doesn't have one.
Diffstat (limited to 'modules/user/models')
-rw-r--r-- | modules/user/models/user.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/user/models/user.php b/modules/user/models/user.php index 991e02f0..85fa75bb 100644 --- a/modules/user/models/user.php +++ b/modules/user/models/user.php @@ -48,8 +48,8 @@ class User_Model extends ORM { * @param integer $size the target size of the image (default 80px) * @return string a url */ - public function avatar_url($size=80) { - return sprintf("http://www.gravatar.com/avatar/%s.jpg?s=%d&r=pg", - md5($this->email), $size); + public function avatar_url($size=80, $default=null) { + return sprintf("http://www.gravatar.com/avatar/%s.jpg?s=%d&r=pg%s", + md5($this->email), $size, $default ? "&d=" . urlencode($default) : ""); } }
\ No newline at end of file |