diff --git a/base.php b/base.php index 5317789..9bbb45b 100644 --- a/base.php +++ b/base.php @@ -464,22 +464,22 @@ class Page Base::clearDb (); } } else { - if (!in_array ("author", $config ['cops_ignored_search_scope'])) { + if (!in_array ("author", $config ['cops_ignored_categories'])) { array_push ($this->entryArray, Author::getCount()); } - if (!in_array ("series", $config ['cops_ignored_search_scope'])) { + if (!in_array ("series", $config ['cops_ignored_categories'])) { $series = Serie::getCount(); if (!is_null ($series)) array_push ($this->entryArray, $series); } - if (!in_array ("publisher", $config ['cops_ignored_search_scope'])) { + if (!in_array ("publisher", $config ['cops_ignored_categories'])) { $publisher = Publisher::getCount(); if (!is_null ($publisher)) array_push ($this->entryArray, $publisher); } - if (!in_array ("tag", $config ['cops_ignored_search_scope'])) { + if (!in_array ("tag", $config ['cops_ignored_categories'])) { $tags = Tag::getCount(); if (!is_null ($tags)) array_push ($this->entryArray, $tags); } - if (!in_array ("language", $config ['cops_ignored_search_scope'])) { + if (!in_array ("language", $config ['cops_ignored_categories'])) { $languages = Language::getCount(); if (!is_null ($languages)) array_push ($this->entryArray, $languages); } diff --git a/book.php b/book.php index de67fc5..b6d9687 100644 --- a/book.php +++ b/book.php @@ -602,7 +602,7 @@ where data.book = books.id and data.id = ?'); PageQueryResult::SCOPE_SERIES, PageQueryResult::SCOPE_PUBLISHER, PageQueryResult::SCOPE_BOOK) as $key) { - if (in_array($key, $config ['cops_ignored_search_scope']) || + if (in_array($key, $config ['cops_ignored_categories']) || (!array_key_exists ($key, $query) && !array_key_exists ("all", $query))) { $critArray [$i] = self::BAD_SEARCH; } @@ -694,7 +694,7 @@ function getJson ($complete = false) { PageQueryResult::SCOPE_SERIES, PageQueryResult::SCOPE_TAG, PageQueryResult::SCOPE_PUBLISHER) as $key) { - if (in_array($key, $config ['cops_ignored_search_scope'])) { + if (in_array($key, $config ['cops_ignored_categories'])) { continue; } switch ($key) { diff --git a/config_default.php b/config_default.php index be8a627..a201b9f 100644 --- a/config_default.php +++ b/config_default.php @@ -236,7 +236,7 @@ $config['cops_server_side_render'] = "Kindle|EBRD1101|EBRD1201|cybook"; /* - * Specify the ignored categories with autocomplete search and standard search + * Specify the ignored categories for the home screen and with search * Meaning that if you don't want to search in publishers or tags just add them from the list * Only accepted values : * - author @@ -244,8 +244,9 @@ * - series * - tag * - publisher + * - language */ - $config ['cops_ignored_search_scope'] = array (); + $config ['cops_ignored_categories'] = array (); /* * If you use a Sony eReader or Aldiko you can't download ebooks if your catalog diff --git a/test/pageTest.php b/test/pageTest.php index baf3da8..9e1b6ce 100644 --- a/test/pageTest.php +++ b/test/pageTest.php @@ -510,7 +510,7 @@ class PageTest extends PHPUnit_Framework_TestCase // Match Lewis Caroll & Scarlet $query = "car"; - $config ['cops_ignored_search_scope'] = array ("author"); + $config ['cops_ignored_categories'] = array ("author"); $currentPage = Page::getPage ($page, $qid, $query, $n); $currentPage->InitializeContent (); @@ -519,7 +519,7 @@ class PageTest extends PHPUnit_Framework_TestCase $this->assertEquals ("A Study in Scarlet", $currentPage->entryArray [0]->title); $this->assertTrue ($currentPage->ContainsBook ()); - $config ['cops_ignored_search_scope'] = array (); + $config ['cops_ignored_categories'] = array (); $currentPage = Page::getPage ($page, $qid, $query, $n); $currentPage->InitializeContent ();