From eb637ff5f13491678daf8fede8b0605f8fd787de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 3 Dec 2012 16:05:13 +0100 Subject: [PATCH] Add language in the book detail. --- book.php | 15 +++++++++++++++ bookdetail.php | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/book.php b/book.php index bc11bf9..221343c 100644 --- a/book.php +++ b/book.php @@ -95,6 +95,21 @@ class Book extends Base { return $this->serie; } + public function getLanguages () { + $lang = array (); + $result = parent::getDb ()->prepare('select languages.lang_code + from books_languages_link, languages + where books_languages_link.lang_code = languages.id + and book = ? + order by item_order'); + $result->execute (array ($this->id)); + while ($post = $result->fetchObject ()) + { + array_push ($lang, $post->lang_code); + } + return implode (", ", $lang); + } + public function getTags () { if (is_null ($this->tags)) { $this->tags = array (); diff --git a/bookdetail.php b/bookdetail.php index 2529834..d893ae6 100644 --- a/bookdetail.php +++ b/bookdetail.php @@ -74,6 +74,10 @@ $book->getLinkArray (); +
+ + getLanguages () ?> +