Fix book detail with multi database. re #40

This commit is contained in:
Sébastien Lucas 2013-04-04 14:27:27 +02:00
parent 78b60baebd
commit 383a33b597
2 changed files with 9 additions and 6 deletions

View file

@ -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;
}
}

View file

@ -50,7 +50,7 @@ $book->getLinkArray ();
}
?>
</div>
<div class="entryTitle"><a rel="bookmark" href="<?php echo 'index.php' . $book->getUri () ?>"><img src="<?php echo getUrlWithVersion("images/Link.png") ?>" alt="permalink" /></a><?php echo htmlspecialchars ($book->title) ?></div>
<div class="entryTitle"><a rel="bookmark" href="<?php echo $book->getDetailUrl (true) ?>"><img src="<?php echo getUrlWithVersion("images/Link.png") ?>" alt="permalink" /></a><?php echo htmlspecialchars ($book->title) ?></div>
<div class="entrySection">
<span><?php echo localize("authors.title") ?></span>
<div class="buttonEffect pad6">