mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-14 19:00:13 -04:00
Integrate Gravatar. Boy, that was easy.
This commit is contained in:
@@ -42,4 +42,14 @@ class User_Model extends ORM {
|
||||
module::event("user_before_delete", $this);
|
||||
parent::delete($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a url to the user's avatar image.
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user