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
This commit is contained in:
At-Libitum 2013-12-08 15:43:23 +01:00
parent 79e070833d
commit 79c2c431cc
2 changed files with 4 additions and 3 deletions

View file

@ -752,7 +752,7 @@ class PageQueryResult extends Page
$i = 0; $i = 0;
foreach ($config['calibre_directory'] as $key => $value) { foreach ($config['calibre_directory'] as $key => $value) {
Base::clearDb (); 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}", array_push ($this->entryArray, new Entry ($key, DB . ":query:{$i}",
str_format (localize ("bookword", $totalNumber), $totalNumber), "text", str_format (localize ("bookword", $totalNumber), $totalNumber), "text",
array ( new LinkNavigation ("?" . DB . "={$i}&page=9&query=" . $this->query)))); array ( new LinkNavigation ("?" . DB . "={$i}&page=9&query=" . $this->query))));
@ -772,14 +772,14 @@ class PageQueryResult extends Page
break; break;
case self::SCOPE_BOOK : case self::SCOPE_BOOK :
list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery ( list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery (
array ($bad, $bad, $bad, $crit), $this->n); array ($bad, $bad, $bad, $bad, $crit), $this->n);
break; break;
case self::SCOPE_PUBLISHER : case self::SCOPE_PUBLISHER :
$this->entryArray = Publisher::getAllPublishersByQuery ($this->query); $this->entryArray = Publisher::getAllPublishersByQuery ($this->query);
break; break;
default: default:
list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery ( list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery (
array ($crit, $crit, $crit, $crit), $this->n); array ($crit, $crit, $crit, $crit, $crit), $this->n);
} }
} }
} }

View file

@ -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 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 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 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"); title like ?) {1} order by books.sort");
define ('SQL_BOOKS_RECENT', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . " define ('SQL_BOOKS_RECENT', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . "
where 1=1 {1} order by timestamp desc limit "); where 1=1 {1} order by timestamp desc limit ");