From f44b674ed5a70663bc5e9808b6d0a41cec5497a0 Mon Sep 17 00:00:00 2001
From: Francois Marier
[% review.review |html %] +
+ [% IF ( review.avatarurl ) %] + + [% END %] + [% review.review |html %] Added [% review.datereviewed %] [% IF ( review.your_comment ) %] by you[% ELSE %] [% IF ( ShowReviewer ) %] by [% review.firstname %] [% review.surname %][% END %][% END %]
diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl index f1e0b5320d..fbce8a28ad 100755 --- a/opac/opac-showreviews.pl +++ b/opac/opac-showreviews.pl @@ -65,6 +65,13 @@ if($format eq "rss"){ ); } +my $libravatar_available = 0; + +eval 'use Libravatar::URL'; +if (! $@) { + $libravatar_available = 1; +} + my $reviews = getallreviews(1,$offset,$results_per_page); my $marcflavour = C4::Context->preference("marcflavour"); my $hits = numberofreviews(); @@ -92,6 +99,10 @@ for my $result (@$reviews){ $result->{timestamp} = $bib->{'timestamp'}; $result->{firstname} = $borr->{'firstname'}; $result->{surname} = $borr->{'surname'}; + if ($libravatar_available and $borr->{'email'}) { + $result->{avatarurl} = libravatar_url(email => $borr->{'email'}, size => 40, https => $ENV{HTTPS}); + } + if ($result->{borrowernumber} eq $borrowernumber) { $result->{your_comment} = 1; } -- 2.39.5