From 27e72da0af7094baf1e0799b51bdb32892069443 Mon Sep 17 00:00:00 2001 From: Reed Wade Date: Wed, 26 May 2010 22:05:40 +1200 Subject: [PATCH] bug 4460 : - Amazon's AssociateID tag not used in links so referred revenue lost Content-Type: text/plain; charset="utf-8" - Added AmazonAssocTag if set for all links from the cover art - updated the reader url dropping some bits (/ref=sib_dp_pt/002-7879865-0184864#reader-link) that appear to have no function - I don't have a good way to test if the associate info will actually pass through on a purchase; all AWS docs relate to the product page and not the reader page.--but I suspect this will work - nothing done re: 'The same might be true for other Amazon related links that koha generates' mentioned on the bug as I couldn't sort out how to trigger that --- C4/Auth.pm | 2 ++ C4/External/Amazon.pm | 6 ++++++ .../prog/en/modules/catalogue/detail.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 2 +- .../prog/en/modules/opac-readingrecord.tmpl | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl | 4 ++-- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 4f76ea6..a6314de 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -354,6 +354,7 @@ sub get_template_and_user { if ( $in->{'type'} eq "intranet" ) { $template->param( AmazonContent => C4::Context->preference("AmazonContent"), + AmazonAssocTag => C4::Context->preference("AmazonAssocTag"), AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), AmazonEnabled => C4::Context->preference("AmazonEnabled"), AmazonSimilarItems => C4::Context->preference("AmazonSimilarItems"), @@ -399,6 +400,7 @@ sub get_template_and_user { } $template->param( AmazonContent => "" . C4::Context->preference("AmazonContent"), + AmazonAssocTag => C4::Context->preference("AmazonAssocTag"), AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"), AuthorisedValueImages => C4::Context->preference("AuthorisedValueImages"), LibraryName => "" . C4::Context->preference("LibraryName"), diff --git a/C4/External/Amazon.pm b/C4/External/Amazon.pm index 9e503b6..11ae79c 100644 --- a/C4/External/Amazon.pm +++ b/C4/External/Amazon.pm @@ -174,6 +174,12 @@ sub SignRequest{ return hmac_sha256_base64($string,C4::Context->preference('AWSPrivateKey')) . '='; } +## +## check_search_inside() doesn't appear to be called anywhere and is using a reader url that I think is +## a bit out of date; it probably makes sense to drop this method unless it's going to be needed. +## I kind of doubt it would even work given the js-ish nature of the Amazon reader page. +## -- 26 May 2010, Reed Wade +## sub check_search_inside { my $isbn = shift; my $ua = LWP::UserAgent->new( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index 7bd4959..3f638f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -116,7 +116,7 @@ function verify_images() { +/gp/reader/?tag=">.01.MZZZZZZZ.jpg" alt="" />