X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=koha.pl;h=7e3482190fde7072e000129d402cd69221483580;hb=c75406fc0566fc14eda5033029f3768e7609b8c2;hp=a0c110eae87ba5bbe58c6cf9b3a31bbe8561c871;hpb=621e3fe935e44ada38c945dae9e08ec733465bef;p=google-map-tiles.git diff --git a/koha.pl b/koha.pl index a0c110e..7e34821 100755 --- a/koha.pl +++ b/koha.pl @@ -14,6 +14,8 @@ my $zoom = param('ZOOM') ; my $maxpix = 15 ; # Maximum pixels between click and point +my $limit_books = 100; # max. for one click + print qq{Content-type: text/xml\r\n\r\n}; print qq{\n} ; print qq!\n! ; @@ -37,7 +39,7 @@ if ( $point =~ /(.*),(.*)/ ) my $sql = qq{ select - city + city_koha ,country ,count ,point @@ -64,19 +66,22 @@ limit 1 my $sth = $dbh->prepare(qq{ select - author, title, max(bi.biblionumber), count(title) + author, title, max(bi.biblionumber) as biblionumber, count(title) from geo_city c join geo_biblioitems bi on bi.city = c.city_koha join biblio b on b.biblionumber = bi.biblionumber -where c.city = ? and country = ? +where c.city_koha = ? and country = ? group by author, title order by min(timestamp) -limit 100 +limit $limit_books }); $sth->execute( $city, $country ); my $rows = $sth->rows; - $rows = "more than $rows" if $rows == 100; + if ( $rows == $limit_books ) { + $rows = "more than $rows"; + $rows = $count if $count > $rows; + }; my $books = 'books'; $books = 'book' if $rows == 1;