summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3e5197c)
Use Libravatar::URL to pull the avatar picture for the comment
author if we have an email address for him/her.
my $commentip;
my $commentauthor;
my $commentauthorurl;
my $commentip;
my $commentauthor;
my $commentauthorurl;
+ my $commentauthoravatar;
my $commentopenid;
if (defined $params{username}) {
$commentuser = $params{username};
my $commentopenid;
if (defined $params{username}) {
$commentuser = $params{username};
$commentauthor = $commentuser;
}
$commentauthor = $commentuser;
}
+
+ eval 'use Libravatar::URL';
+
+ if (! $@) {
+ my $email = IkiWiki::userinfo_get($commentuser, 'email');
+
+ if (defined $email) {
+ $commentauthoravatar = libravatar_url(email => $email);
+ }
+ }
}
else {
if (defined $params{ip}) {
}
else {
if (defined $params{ip}) {
$commentstate{$page}{commentip} = $commentip;
$commentstate{$page}{commentauthor} = $commentauthor;
$commentstate{$page}{commentauthorurl} = $commentauthorurl;
$commentstate{$page}{commentip} = $commentip;
$commentstate{$page}{commentauthor} = $commentauthor;
$commentstate{$page}{commentauthorurl} = $commentauthorurl;
+ $commentstate{$page}{commentauthoravatar} = $commentauthoravatar;
if (! defined $pagestate{$page}{meta}{author}) {
$pagestate{$page}{meta}{author} = $commentauthor;
}
if (! defined $pagestate{$page}{meta}{author}) {
$pagestate{$page}{meta}{author} = $commentauthor;
}
$commentstate{$page}{commentauthorurl});
}
$commentstate{$page}{commentauthorurl});
}
+ if ($template->query(name => 'commentauthoravatar')) {
+ $template->param(commentauthoravatar =>
+ $commentstate{$page}{commentauthoravatar});
+ }
+
if ($template->query(name => 'removeurl') &&
IkiWiki::Plugin::remove->can("check_canremove") &&
length $config{cgiurl}) {
if ($template->query(name => 'removeurl') &&
IkiWiki::Plugin::remove->can("check_canremove") &&
length $config{cgiurl}) {
.comment-subject {
font-weight: bold;
}
.comment-subject {
font-weight: bold;
}
+.comment-avatar {
+ float: right;
+}
.comment {
border: 1px solid #aaa;
padding: 3px;
.comment {
border: 1px solid #aaa;
padding: 3px;
<TMPL_IF HTML5><article class="comment" id="<TMPL_VAR COMMENTID>">
<TMPL_ELSE><div class="comment" id="<TMPL_VAR COMMENTID>"></TMPL_IF>
<TMPL_IF HTML5><article class="comment" id="<TMPL_VAR COMMENTID>">
<TMPL_ELSE><div class="comment" id="<TMPL_VAR COMMENTID>"></TMPL_IF>
+<TMPL_IF COMMENTAUTHORAVATAR><div class="comment-avatar">
+<img src="<TMPL_VAR COMMENTAUTHORAVATAR>" alt="" />
+</div></TMPL_IF>
+
<TMPL_IF HTML5><header class="comment-subject"><TMPL_ELSE><div class="comment-subject"></TMPL_IF>
<TMPL_IF PERMALINK>
<a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a>
<TMPL_IF HTML5><header class="comment-subject"><TMPL_ELSE><div class="comment-subject"></TMPL_IF>
<TMPL_IF PERMALINK>
<a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a>
<TMPL_IF HTML5></nav><TMPL_ELSE></div></TMPL_IF>
</TMPL_IF>
<TMPL_IF HTML5></nav><TMPL_ELSE></div></TMPL_IF>
</TMPL_IF>
+<div style="clear: both"></div>
<TMPL_IF HTML5></article><TMPL_ELSE></div></TMPL_IF>
<TMPL_IF HTML5></article><TMPL_ELSE></div></TMPL_IF>