Add a new config item to ignore a category in search. Simplify the queries. re #123
This commit is contained in:
parent
21f31d92aa
commit
7ba85d150b
3 changed files with 56 additions and 19 deletions
7
base.php
7
base.php
|
@ -745,14 +745,13 @@ class PageQueryResult extends Page
|
|||
}
|
||||
|
||||
$crit = "%" . $this->query . "%";
|
||||
$bad = "QQQQQ";
|
||||
|
||||
// Special case when we are doing a search and no database is selected
|
||||
if (is_array ($config['calibre_directory']) && is_null (GetUrlParam (DB))) {
|
||||
$i = 0;
|
||||
foreach ($config['calibre_directory'] as $key => $value) {
|
||||
Base::clearDb ();
|
||||
list ($array, $totalNumber) = Book::getBooksByQuery (array ($crit, $crit, $crit, $crit, $crit), 1, $i, 1);
|
||||
list ($array, $totalNumber) = Book::getBooksByQuery (array ("all" => $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 +771,14 @@ class PageQueryResult extends Page
|
|||
break;
|
||||
case self::SCOPE_BOOK :
|
||||
list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery (
|
||||
array ($bad, $bad, $bad, $bad, $crit), $this->n);
|
||||
array ("book" => $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, $crit), $this->n);
|
||||
array ("all" => $crit), $this->n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue