Hi,
francois wrote:If it is a feature, is it possible to display only categories fo the current language ? And i can do that ?
it's a supposed to be a feature (the search is perfomed upon any faq w/o any constraint on the language) but we're interested in examing scenarios in which this feature (the search over all faq contents) becomes something like a "bug".
If you want to limit the categories list to those ones for the current language, locate, backup and open the
[PATH_TO_PMFINSTALL]/search.php file and move the lines below from:
Code: Select all
// HACK: (re)evaluate the Category object w/o passing the user language
// so the result set of a Search will have the Category Path
// for any of the multilanguage faq records and the Category list
// on the left pane will not be affected
$tree = new Category();
$tree->transform(0);
to:
Code: Select all
// HACK: (re)evaluate the Category object w/o passing the user language
// so the result set of a Search will have the Category Path
// for any of the multilanguage faq records and the Category list
// on the left pane will not be affected
//$tree = new Category();
//$tree->transform(0);
and then you need to modify the
searchEngine() function in order to limit the search result set to the current language: locate, backup and open the
[PATH_TO_PMFINSTALL]/inc/functions.php and move these lines below from:
Code: Select all
...
global $db, $sids, $tree, $PMF_LANG, $PMF_CONF;
...
if ('%' == $category) {
$cond = array(SQLPREFIX."faqdata.active" => "'yes'");
} else {
$cond = array(SQLPREFIX."faqdata.active" => "'yes'",
SQLPREFIX."faqcategoryrelations.category_id" => $category);
}
...
to:
Code: Select all
...
global $db, $sids, $tree, $PMF_LANG, $PMF_CONF, $LANGCODE;
...
if ('%' == $category) {
$cond = array(SQLPREFIX."faqdata.active" => "'yes'", "faqdata.lang" => $LANGCODE);
} else {
$cond = array(SQLPREFIX."faqdata.active" => "'yes'",
"faqdata.lang" => $LANGCODE,
SQLPREFIX."faqcategoryrelations.category_id" => $category);
}
...
Thanks in advance for any feedback coming from your multilanguage scenarios.
Regards,
Matteo