Hello,
recently someone asked how to limit the search on a multilingual site while using
PAGE_LANGUAGES (i.e. Settings --> "Advanced Settings" --> "Page Languages" activated) instead of /en/, /de/... page hierarchies.
Multilingual sites using those /en/, /de/... page hierarchies are able to use the
search_path-parameter inside there search-form. This won't work for sites using PAGE_LANGUAGES, though.
So i figured out a way to make this work for those sites, too. Please find attached the file search.php (from the SVN, latest revision) with some small changes:
- in case PAGE_LANGUAGES is set to true, all database-queries are adjusted accordingly ("
... AND language = ".LANGUAGE)
additional:
- if "
Max lines of excerpt" is set to 0 (zero) the new search-method is completely omitted. -- No need to manually rename the search.php-files to deactivate the new search.
- export "time_limit" to the module-based search (this was missing)
- replaced a require_once() by require() -- that doesn't hurt, and fixes issues like
http://www.websitebaker2.org/forum/index.php/topic,13187.0.html- some minor changes
Could someone test this, please?
Even though it's somewhat late, maybe it could make its way into 2.8 ?
thorn.