From 91cf377d955675a64968ad5cef20d3bd7a950506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Wed, 3 Apr 2013 21:10:28 +0200 Subject: [PATCH] Refactor again. re #40 --- bookdetail.php | 4 +++- data.php | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bookdetail.php b/bookdetail.php index 4a631ba..27343b5 100644 --- a/bookdetail.php +++ b/bookdetail.php @@ -33,7 +33,9 @@ $book->getLinkArray (); hasCover) { ?> - <?php echo localize(" /> + hrefXhtml () ?>"> + hrefXhtml () ?>" alt="" /> + diff --git a/data.php b/data.php index 1ed427f..f929caf 100644 --- a/data.php +++ b/data.php @@ -107,7 +107,7 @@ class Data extends Base { } } - public static function getLink ($book, $type, $mime, $rel, $filename, $idData, $title = NULL) + public static function getLink ($book, $type, $mime, $rel, $filename, $idData, $title = NULL, $height = NULL) { global $config; @@ -120,13 +120,14 @@ class Data extends Base { { if ($type != "jpg") $urlParam = addURLParameter($urlParam, "type", $type); if ($rel == Link::OPDS_THUMBNAIL_TYPE) { - $height = "50"; - if (preg_match ('/feed.php/', $_SERVER["SCRIPT_NAME"])) { - $height = $config['cops_opds_thumbnail_height']; - } - else - { - $height = $config['cops_html_thumbnail_height']; + if (is_null ($height)) { + if (preg_match ('/feed.php/', $_SERVER["SCRIPT_NAME"])) { + $height = $config['cops_opds_thumbnail_height']; + } + else + { + $height = $config['cops_html_thumbnail_height']; + } } $urlParam = addURLParameter($urlParam, "height", $height); }