Permalink
Browse files

Added a short check for the existend of book cover

The cover url is constructed from the bookid, but should not be
returned if the image does not actually exist. This kind of check was
implemented.
  • Loading branch information...
1 parent 8e806cf commit 6bfab7d4a9fe729514abdda637935af9fdab9d62 @nikan committed Jan 17, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 index.php
View
@@ -77,7 +77,10 @@
$publisher[] = $_a->innertext;
}
}
-$cover_url = "http://biblionet.gr/images/covers/" . $biblionetid . ".jpg";
+ $covers = $html->find('img[src*=s'.$biblionetid .']');
+ if(count($covers) >= 1){
+ $cover_url = "http://biblionet.gr/images/covers/b" . $biblionetid . ".jpg";
+ }
$other = $html->find('span[class=small]');
$td = $other[0]->parent();

0 comments on commit 6bfab7d

Please sign in to comment.