From 79c2c431cc9e73d3b034950964ca748eca5dce2a Mon Sep 17 00:00:00 2001 From: At-Libitum Date: Sun, 8 Dec 2013 15:43:23 +0100 Subject: [PATCH] publisher category did not get included in regular search. added publisher "exists (select ..." as 4th or branch to SQL_BOOKS_QUERY added argument placeholder as 4th to the various calls to getBooksByQuery. re #123 --- base.php | 6 +++--- book.php | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/base.php b/base.php index 74f6791..ac3be89 100644 --- a/base.php +++ b/base.php @@ -752,7 +752,7 @@ class PageQueryResult extends Page $i = 0; foreach ($config['calibre_directory'] as $key => $value) { Base::clearDb (); - list ($array, $totalNumber) = Book::getBooksByQuery (array ($crit, $crit, $crit, $crit), 1, $i, 1); + list ($array, $totalNumber) = Book::getBooksByQuery (array ($crit, $crit, $crit, $crit, $crit), 1, $i, 1); array_push ($this->entryArray, new Entry ($key, DB . ":query:{$i}", str_format (localize ("bookword", $totalNumber), $totalNumber), "text", array ( new LinkNavigation ("?" . DB . "={$i}&page=9&query=" . $this->query)))); @@ -772,14 +772,14 @@ class PageQueryResult extends Page break; case self::SCOPE_BOOK : list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery ( - array ($bad, $bad, $bad, $crit), $this->n); + array ($bad, $bad, $bad, $bad, $crit), $this->n); break; case self::SCOPE_PUBLISHER : $this->entryArray = Publisher::getAllPublishersByQuery ($this->query); break; default: list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery ( - array ($crit, $crit, $crit, $crit), $this->n); + array ($crit, $crit, $crit, $crit, $crit), $this->n); } } } diff --git a/book.php b/book.php index 5d59ae2..bbe2603 100644 --- a/book.php +++ b/book.php @@ -40,6 +40,7 @@ define ('SQL_BOOKS_QUERY', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . " exists (select null from authors, books_authors_link where book = books.id and author = authors.id and authors.name like ?) or exists (select null from tags, books_tags_link where book = books.id and tag = tags.id and tags.name like ?) or exists (select null from series, books_series_link on book = books.id and books_series_link.series = series.id and series.name like ?) or + exists (select null from publishers, books_publishers_link where book = books.id and books_publishers_link.publisher = publishers.id and publishers.name like ?) or title like ?) {1} order by books.sort"); define ('SQL_BOOKS_RECENT', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . " where 1=1 {1} order by timestamp desc limit ");