Refactor again. re #40
This commit is contained in:
parent
f5d86b37e5
commit
91cf377d95
|
@ -33,7 +33,9 @@ $book->getLinkArray ();
|
|||
<?php
|
||||
if ($book->hasCover) {
|
||||
?>
|
||||
<a href="fetch.php?id=<?php echo $book->id ?>"><img src="fetch.php?id=<?php echo $book->id ?>&height=150" alt="<?php echo localize("i18n.coversection") ?>" /></a>
|
||||
<a href="<?php echo Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml () ?>">
|
||||
<img src="<?php echo Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, 150)->hrefXhtml () ?>" alt="<?php echo localize("i18n.coversection") ?>" />
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
17
data.php
17
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue