From 383a33b597b729fa551974b2f8d03ce088ab1bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 4 Apr 2013 14:27:27 +0200 Subject: [PATCH] Fix book detail with multi database. re #40 --- book.php | 13 ++++++++----- bookdetail.php | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/book.php b/book.php index 5fd8367..275abdd 100644 --- a/book.php +++ b/book.php @@ -94,15 +94,18 @@ class Book extends Base { } public function getUri () { - return "?page=".parent::PAGE_BOOK_DETAIL."&id=$this->id"; + return "?page=".parent::PAGE_BOOK_DETAIL."&id=$this->id"; } - public function getDetailUrl () { + public function getDetailUrl ($permalink = false) { global $config; - if ($config['cops_use_fancyapps'] == 0) { - return 'index.php' . $this->getUri (); + $urlParam = $this->getUri (); + if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB)); + $urlParam = str_replace ("&", "&", $urlParam); + if ($permalink || $config['cops_use_fancyapps'] == 0) { + return 'index.php' . $urlParam; } else { - return 'bookdetail.php?id=' . $this->id; + return 'bookdetail.php' . $urlParam; } } diff --git a/bookdetail.php b/bookdetail.php index 27343b5..d52747b 100644 --- a/bookdetail.php +++ b/bookdetail.php @@ -50,7 +50,7 @@ $book->getLinkArray (); } ?> -
" alt="permalink" />title) ?>
+
" alt="permalink" />title) ?>