From 0ba361e4341ce7fbaa3c78c40fde4a4259d92a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 3 Jan 2013 21:40:43 +0100 Subject: [PATCH] Add a permalink to book (the little linkish thingy) fix the image zoom in the book detail Add book title to the book detail clean the code a little (more to do) --- base.php | 3 ++- book.php | 13 +++++++++++++ bookdetail.php | 4 ++-- fetch.php | 7 +++++-- images/Link.png | Bin 0 -> 720 bytes index.php | 2 +- 6 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 images/Link.png diff --git a/base.php b/base.php index 654af50..dbf8d55 100644 --- a/base.php +++ b/base.php @@ -413,7 +413,8 @@ class PageBookDetail extends Page { public function InitializeContent () { - $this->title = "Book"; + $book = Book::getBookById ($this->idGet); + $this->title = $book->title; } } diff --git a/book.php b/book.php index 2e6112a..20e4dda 100644 --- a/book.php +++ b/book.php @@ -89,6 +89,19 @@ class Book extends Base { return self::ALL_BOOKS_ID.":letter:".$startingLetter; } + public function getUri () { + return "?page=".parent::PAGE_BOOK_DETAIL."&id=$this->id"; + } + + public function getDetailUrl () { + global $config; + if ($config['cops_use_fancyapps'] == 0) { + return 'index.php' . $this->getUri (); + } else { + return 'bookdetail.php?id=' . $this->id; + } + } + public function getTitle () { return $this->title; } diff --git a/bookdetail.php b/bookdetail.php index ff55374..1edd2f3 100644 --- a/bookdetail.php +++ b/bookdetail.php @@ -23,7 +23,7 @@ $book->getLinkArray (); hasCover) { ?> - cover + cover @@ -38,7 +38,7 @@ $book->getLinkArray (); } ?> -
title) ?>
+
" alt="permalink" />title) ?>
diff --git a/fetch.php b/fetch.php index f6340ed..325a4c3 100644 --- a/fetch.php +++ b/fetch.php @@ -92,7 +92,10 @@ $book->getUpdatedEpub ($idData); return; } - - header('Content-Disposition: attachment; filename="' . basename ($file) . '"'); + if ($type == "jpg") { + header('Content-Disposition: filename="' . basename ($file) . '"'); + } else { + header('Content-Disposition: attachment; filename="' . basename ($file) . '"'); + } header ($config['cops_x_accel_redirect'] . ": " . $config['calibre_internal_directory'] . $file); ?> \ No newline at end of file diff --git a/images/Link.png b/images/Link.png new file mode 100644 index 0000000000000000000000000000000000000000..2a5278e90582eed53341405f644efb0d3b8fbae1 GIT binary patch literal 720 zcmV;>0x$iEP)LoK~y-6rIJrbR8bVhzw;(vGX#-f4G2aso4|4v22xvz5Q+XE z!3;!Ut}I$iQ<4k{(x6aT6GZ8z!P+=7%oqt#*1|E|1ci%sB1F_6G@I@{_r3d0n+6=m z2R+2WBo6i^Yxxg4x;G>qK2SM=G7}G{X$E~$H9mh$C$Z*2~rPM_t8UzqnYmYQFHSIOVtPoKJK&Q3# zpyN2N0W7w(wA`)zqwQ*(oSf_xkr^U-6^TURN~wg1WC1*>R;yRi>9pTKP*Wz8NfJ>8 zz_`|WSZh52U=YByR4VmgtG|w5baeDSfB^uP!{P9p*7`YsV*vWX;c%Im2SlV*MDC^2 z>Ge8-p`oFk-x>5+Yd>kNmxySWh;)g_Pi8I?(RvUBOGLB?AO>tYBxXLLwO$z;8++k- z-aBUg!OTaMQq8{auQ2l=rPRZXjg1LrZcZkX`?l6t7Lju!BO{Jd>OwRcU9MCr=K(zS zJntERHvk^Fu3Obw7qZ#x_qq(?@%ZjYB=U`jmPI57;3R<4B64$TYHAz+`uqE%K@jYj zo}T`^ZHS3PqKk;`0N5`gMF3B8xm>xS=RdXZFZu;mWJc&E!3$3S0000