mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-05 12:39:07 -04:00
Integrate Gravatar. Boy, that was easy.
This commit is contained in:
@@ -91,8 +91,9 @@
|
||||
<input type="checkbox" name="delete_comments[]" value="<?= $comment->id ?>" />
|
||||
</td>
|
||||
<td>
|
||||
<a href="#"><img src="<?= $theme->url("images/avatar.jpg") ?>"
|
||||
alt="<?= $comment->author_name() ?>"/></a><br/>
|
||||
<a href="#"><img width="40" height="40" src="<?= $user->avatar_url(40) ?>"
|
||||
class="gAvatar" alt="<?= $comment->author_name() ?>" /></a>
|
||||
<br/>
|
||||
<a href="mailto:<?= $comment->author_email() ?>"
|
||||
title="<?= $comment->author_email() ?>"> <?= $comment->author_name() ?> </a>
|
||||
</td>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<li id="gComment-<?= $comment->id; ?>">
|
||||
<p class="gAuthor">
|
||||
<a href="#">
|
||||
<img src="<?= $theme->url("images/avatar.jpg") ?>"
|
||||
<img width="40" height="40" src="<?= $user->avatar_url(40) ?>"
|
||||
class="gAvatar" alt="<?= $comment->author_name() ?>" />
|
||||
</a>
|
||||
<?= t("on ") . date("Y-M-d H:i:s", $comment->created) ?>
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
<li id="gComment-<?= $comment->id ?>">
|
||||
<p class="gAuthor">
|
||||
<a href="#">
|
||||
<img src="<?= $theme->url("images/avatar.jpg") ?>"
|
||||
<img width="40" height="40" src="<?= $user->avatar_url(40) ?>"
|
||||
class="gAvatar" alt="<?= $comment->author_name() ?>" />
|
||||
</a>
|
||||
<? printf(t("on %s <a href=#>%s</a> said"), date("Y-M-d H:i:s", $comment->created), $comment->author_name()) ?>
|
||||
<?= t("on {{date}} <a href=#>{{name}}</a> said",
|
||||
array("date" => date("Y-M-d H:i:s", $comment->created),
|
||||
"name" => $comment->author_name())); ?>
|
||||
</p>
|
||||
<div>
|
||||
<?= $comment->text ?>
|
||||
|
||||
@@ -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