cops/bookdetail.php

103 lines
3.2 KiB
PHP
Raw Normal View History

2012-06-02 09:48:07 +03:00
<?php
/**
* COPS (Calibre OPDS PHP Server) book detail script
2012-06-02 09:48:07 +03:00
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author S<EFBFBD>bastien Lucas <sebastien@slucas.fr>
*
*/
require_once ("config.php");
require_once ("book.php");
$book = Book::getBookById($_GET["id"]);
$authors = $book->getAuthors ();
2012-06-11 22:30:25 +03:00
$tags = $book->getTags ();
2012-06-17 14:50:33 +03:00
$serie = $book->getSerie ();
2012-06-24 09:24:28 +03:00
$book->getLinkArray ();
2012-06-02 09:48:07 +03:00
?>
<article class="bookpopup">
2013-05-16 15:00:28 +03:00
<span class="cover">
<?php
if ($book->hasCover) {
?>
2013-04-03 22:10:28 +03:00
<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
}
?>
2013-05-16 15:00:28 +03:00
</span>
2012-06-24 09:24:28 +03:00
<?php
2012-06-26 15:45:09 +03:00
foreach ($book->getDatas() as $data)
2012-06-24 09:24:28 +03:00
{
?>
2013-05-16 15:00:28 +03:00
<h2 class="download"><a href="<?php echo $data->getHtmlLink () ?>"><?php echo $data->format ?></a></h2>
2012-06-24 09:24:28 +03:00
<?php
}
?>
2013-05-16 15:00:28 +03:00
<h1><a rel="bookmark" href="<?php echo $book->getDetailUrl (true) ?>"><img src="<?php echo getUrlWithVersion("images/Link.png") ?>" alt="<?php echo localize ("permalink.alternate") ?>" /></a><?php echo htmlspecialchars ($book->title) ?></h1>
<p class="popupless">
<h3><?php echo localize("authors.title") ?>: </h3>
2012-06-02 09:48:07 +03:00
<?php
2012-06-12 23:46:54 +03:00
$i = 0;
foreach ($authors as $author) {
if ($i > 0) echo ", ";
2012-06-02 09:48:07 +03:00
?>
<a href="<?php $link = new LinkNavigation ($author->getUri ()); echo $link->hrefXhtml () ?>"><?php echo htmlspecialchars ($author->name) ?></a>
2012-06-11 22:30:25 +03:00
<?php
2012-06-12 23:46:54 +03:00
}
2012-06-11 22:30:25 +03:00
?>
2013-05-16 14:59:53 +03:00
</p>
<?php
if (count ($tags) > 0) {
?>
2013-05-16 14:59:53 +03:00
<p class="popupless">
<h3><?php echo localize("tags.title") ?>: </h3>
2012-06-11 22:30:25 +03:00
<?php
2012-06-12 23:46:54 +03:00
$i = 0;
foreach ($tags as $tag) {
if ($i > 0) echo ", ";
2012-06-11 22:30:25 +03:00
?>
<a href="<?php $link = new LinkNavigation ($tag->getUri ()); echo $link->hrefXhtml () ?>"><?php echo htmlspecialchars ($tag->name) ?></a>
2012-06-02 09:48:07 +03:00
<?php
2012-06-12 23:46:54 +03:00
}
2012-06-02 09:48:07 +03:00
?>
2013-05-16 14:59:53 +03:00
</p>
2012-06-17 14:50:33 +03:00
<?php
}
2012-06-17 14:50:33 +03:00
if (!is_null ($serie))
{
?>
2013-05-16 14:59:53 +03:00
<p class="popupless">
2013-05-16 15:00:28 +03:00
<h3><a href="index.php<?php $link = new LinkNavigation ($serie->getUri ()); echo $link->hrefXhtml () ?>"><?php echo localize("series.title") ?></a>: </h3>
<?php echo str_format (localize ("content.series.data"), $book->seriesIndex, htmlspecialchars ($serie->name)) ?>
2013-05-16 14:59:53 +03:00
</p>
<?php
}
2013-02-20 22:08:48 +02:00
if ($book->getPubDate() != "")
{
?>
2013-05-16 14:59:53 +03:00
<p class="popupless">
<h3><?php echo localize("pubdate.title") ?>: </h3>
<?php echo $book->getPubDate() ?>
2013-05-16 14:59:53 +03:00
</p>
2012-06-17 14:50:33 +03:00
<?php
}
2013-02-20 22:36:34 +02:00
if ($book->getLanguages () != "")
{
2012-06-17 14:50:33 +03:00
?>
2013-05-16 14:59:53 +03:00
<p class="popupless">
<h3><?php echo localize("config.Language.label") ?>: </h3>
2012-12-03 17:05:13 +02:00
<?php echo $book->getLanguages () ?>
2013-05-16 14:59:53 +03:00
</p>
<?php
}
?>
<br />
2013-05-16 07:52:22 +03:00
<h4><?php echo localize("content.summary") ?></h4>
<div <?php if (!isset ($page)) echo 'style="max-width:700px;"' ?> ><?php echo $book->getComment (false) ?></div>
</article>