Bug 6298 - Profile pictures in the OPAC next to review authors
Summary: Profile pictures in the OPAC next to review authors
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Francois Marier
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-04 12:13 UTC by Francois Marier
Modified: 2013-12-05 20:01 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Screenshot of user reviews on book with avatars (73.17 KB, image/jpeg)
2011-05-04 12:13 UTC, Francois Marier
Details
Screenshot of the recent reviews page with avatars (60.16 KB, image/jpeg)
2011-05-05 11:47 UTC, Francois Marier
Details
add ShowReviewerPhoto pref to the manual (1.46 KB, patch)
2011-05-07 06:37 UTC, Francois Marier
Details | Diff | Splinter Review
manual: explain where the reviewer photos come from and how to get one (994 bytes, patch)
2011-05-07 06:38 UTC, Francois Marier
Details | Diff | Splinter Review
no avatar if it's 'my' comment (21.45 KB, image/png)
2011-05-07 22:12 UTC, Nicole C. Engard
Details
works if i'm logged out (45.27 KB, image/png)
2011-05-07 22:13 UTC, Nicole C. Engard
Details
avatar shows on 'my' comments on recent comments (44.25 KB, image/png)
2011-05-07 22:15 UTC, Nicole C. Engard
Details
5 signed off patches (8.42 KB, application/x-zip-compressed)
2011-05-08 00:10 UTC, Nicole C. Engard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Marier 2011-05-04 12:13:58 UTC
Created attachment 4035 [details]
Screenshot of user reviews on book with avatars

Adding Libravatar (http://www.libravatar.org) support to the OPAC will make it possible to display photos next to the reviewers' name as long as that patron has an email address on file.

This is actually pretty simple to do since the Gravatar::URL CPAN package includes a module called Libravatar::URL:

  http://search.cpan.org/~fmarier/Gravatar-URL-1.04/lib/Libravatar/URL.pm

which is in Debian as of wheezy. Otherwise:

  sudo apt-get install libnet-dns-perl libtest-warn-perl
  sudo cpan Gravatar::URL

My branch is here:

  https://gitorious.org/~fmarier/koha/francois-sandbox/commits/libravatar_support

and I will submit it to the mailing list for review once it's ready.
Comment 1 Nicole C. Engard 2011-05-04 12:25:30 UTC
I would note that you should also edit the recent comments page with this code so that they're consistent.
Comment 2 Francois Marier 2011-05-04 12:33:59 UTC
Nicole, I quickly looked around but I couldn't find that recent comments page. Is it in the OPAC or on the admin side?
Comment 3 Nicole C. Engard 2011-05-04 12:54:06 UTC
http://YOURCATALOG/cgi-bin/koha/opac-showreviews.pl
Comment 4 Francois Marier 2011-05-05 11:47:14 UTC
Created attachment 4038 [details]
Screenshot of the recent reviews page with avatars

I have added (smaller) avatars to the recent reviews page as per Nicole's suggestion.
Comment 5 Nicole C. Engard 2011-05-05 11:50:04 UTC
Awesome!! :) Can't wait to see and test the patch.
Comment 6 Nicole C. Engard 2011-05-06 14:53:31 UTC
Francois, the patches for this apply just fine, but I'm not seeing the avatars (I have fake patrons with fake email addresses - so I need to get some real addresses in there).  I was thinking though that you don't have a preference for this.  So that means if the library isn't showing patron names you're still showing avatars and if the library doesn't want to show avatars due to potentially offensive pictures showing they have no way to turn it off.

There should be two edits:

1 - a preference to turn this on and off
2 - a check to see if the names are showing and if not then don't show the pictures either

I'm off to add some of my friends email addresses to my test system so I can see some avatars ;)
Comment 7 Nicole C. Engard 2011-05-06 14:58:35 UTC
Francois,

I tried using your email address in a patron record and still don't see the avatar on the review.  Where are you looking for the email?

Nicole
Comment 8 Nicole C. Engard 2011-05-06 17:26:24 UTC
I tested again with Magnus's email and still no avatars.
Comment 9 Francois Marier 2011-05-07 06:35:52 UTC
I have just sent a revised patchset to the list:

- checks to see if ShowReviewer is ON
- adds a new ShowReviewerPhoto pref
- add Gravatar::URL >= 1.03 to list of optional perl dependencies

The email address that's used for each patron is the "Primary Email" (under "Contact").

Have you got the extra Perl module that's required? (Gravatar::URL version 1.03 or later)? If it's not installed then the photos don't show up but no errors are thrown.
Comment 10 Francois Marier 2011-05-07 06:37:04 UTC
Created attachment 4055 [details] [review]
add ShowReviewerPhoto pref to the manual

Here is a quick patch for the Koha documentation to add the new system preference.
Comment 11 Francois Marier 2011-05-07 06:38:58 UTC
Created attachment 4056 [details] [review]
manual: explain where the reviewer photos come from and how to get one

Here is a rough idea for the manual: a small explanation of where the reviewer photos come from.
Comment 12 Nicole C. Engard 2011-05-07 21:58:17 UTC
You did say that I needed that dependency right there is the first comment didn't you :) I'll install that now and test. Thanks for taking my suggestions into consideration! This is gonna be a cool enhancement.  

Testing now.
Comment 13 Nicole C. Engard 2011-05-07 22:06:40 UTC
Question about manual updates - are they for the master branch or the 3.4 branch?

Also, patches for the manual can be sent to the docs mailing list (https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-docs) in the future.  I don't always look for them in the bug reports (I just saw these cause I'm testing things).

Nicole
Comment 14 Nicole C. Engard 2011-05-07 22:12:58 UTC
Created attachment 4058 [details]
no avatar if it's 'my' comment

This patch works as long as the comment isn't my own.  Is it supposed to show your own avatar if you're logged in? Or just show your avatar to others?
Comment 15 Nicole C. Engard 2011-05-07 22:13:38 UTC
Created attachment 4059 [details]
works if i'm logged out

Of course that's not my picture ;) but that handsome man shows only if I'm logged out because it's attached to my account.
Comment 16 Nicole C. Engard 2011-05-07 22:15:19 UTC
Created attachment 4060 [details]
avatar shows on 'my' comments on recent comments

When on the recent comments page and I'm logged in I see my avatar. So this confirms that it should show on the bib detail as well if I'm logged in.
Comment 17 Nicole C. Engard 2011-05-07 22:20:03 UTC
Okay, I tested all 5 patches and they work beautifully except for the issue of my avatar not showing on the bib detail if I'm logged in.  Fix that and I'm ready to sign off.
Comment 18 Nicole C. Engard 2011-05-07 22:24:28 UTC
Also, in updatedatabase you should have this line:

$DBversion = "3.05.00.002";

reading

$DBversion = "3.05.00.XXX";

The RM will assign a version number and kohaversion.pl shouldn't be updated by anyone but the RM.
Comment 19 Francois Marier 2011-05-07 22:55:13 UTC
The manual patches were for the master branch.

I'll add the "me" pictures when logged in (I must have forgotten to test that), remove the DB version and then submit the update patches to the list.
Comment 20 Nicole C. Engard 2011-05-07 22:56:57 UTC
Awesome. And thanks so very very much for the manual patches!! It would be awesome if everyone wrote the manual bits for their devs :) hint hint.
Comment 21 Francois Marier 2011-05-07 23:23:09 UTC
New patch submitted to the list (and pushed to my Gitorious branch):

- don't bump kohaversion
- show your own avatar on the bib detail page
Comment 22 Nicole C. Engard 2011-05-08 00:09:11 UTC
Signed off and submitted to the list!!
Comment 23 Nicole C. Engard 2011-05-08 00:10:38 UTC
Created attachment 4061 [details]
5 signed off patches
Comment 24 Chris Cormack 2011-07-05 03:03:58 UTC
Pushed to master, please test