From a5c4e3d46592eddf0c23947727c2c13b03a8841f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 10 Jan 2009 05:56:11 +0000 Subject: Integrate Gravatar. Boy, that was easy. --- modules/comment/views/admin_comments.html.php | 5 +++-- modules/comment/views/comment.html.php | 2 +- modules/comment/views/comments.html.php | 6 ++++-- modules/user/models/user.php | 10 ++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 311a27c9..5b2d2ca4 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -91,8 +91,9 @@ - " - alt="author_name() ?>"/>
+ <?= $comment->author_name() ?> +
author_name() ?> diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php index 59b00b73..86f635d3 100644 --- a/modules/comment/views/comment.html.php +++ b/modules/comment/views/comment.html.php @@ -2,7 +2,7 @@
  • - " + <?= $comment->author_name() ?> created) ?> diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index 7f82241e..b3757a5c 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -5,10 +5,12 @@

  • - " + <?= $comment->author_name() ?> - %s said"), date("Y-M-d H:i:s", $comment->created), $comment->author_name()) ?> + {{name}} said", + array("date" => date("Y-M-d H:i:s", $comment->created), + "name" => $comment->author_name())); ?>

    text ?> diff --git a/modules/user/models/user.php b/modules/user/models/user.php index df01a345..991e02f0 100644 --- a/modules/user/models/user.php +++ b/modules/user/models/user.php @@ -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); + } } \ No newline at end of file -- cgit v1.2.3