WebsiteBaker Community Forum
General Community => Global WebsiteBaker 2.8.x discussion => Topic started by: thorn on July 24, 2009, 09:41:41 PM
-
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 https://forum.WebsiteBaker.org/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.
[gelöscht durch Administrator]
-
hi thorn,
Are there any bigger changes betwen this and https://forum.WebsiteBaker.org/index.php/topic,14555.0.html
?
All best,
Ivan
-
Hello,
Are there any bigger changes betwen this and https://forum.WebsiteBaker.org/index.php/topic,14555.0.html
Not really, just added $search_language_sql to the old searchfunction, too. That was still missing in the post you mentioned. Also did some code-cleanup.
Although the attached file is for wb 2.8 RC1, it should (not fully tested) work with 2.7, too.
thorn.
-
can you please tell me in short what was this about as I dont understand deuche
replaced a require_once() by require() -- that doesn't hurt, and fixes issues like https://forum.WebsiteBaker.org/index.php/topic,13187.0.html
and what does search_convert.php do ?
cheers
-
Hello,
replaced a require_once() by require() -- that doesn't hurt, and fixes issues like https://forum.WebsiteBaker.org/index.php/topic,13187.0.html
That's not related to the language-problem. I did some additional fixes, too.
In this thread someone have had a (erroneous?) template which forced wb to call search.php twice -- we didn't figured out why.
In the second call, search_convert.php wasn't loaded, and a relevant variable wasn't set correctly.
The file search_convert.php converts between language-specific spelling.
In time of writing there are only some german entries: in general ä==ae, ß==ss, ...
and some very uncommon (ſt==st, fi==fi, ...).
thorn.
-
so if we have for example some word: äbc and add a line there ä==a , then also abc will be displayed as search result right ?
In that case, we can all define that letter with accent is == letter without it for each of our own language :-D :-D :-D
-
Hello,
Even though it's somewhat late, maybe it could make its way into 2.8 ?
Why not, as far as i see it only fixes "bugs" :-D. If i got the time to test maybe i'll add it to RC2, this way it can be tested from RC2 testers too.
Matthias