Fix search in correct language
This commit is contained in:
parent
0de8cb7096
commit
12e090eed6
@ -720,9 +720,10 @@ function getSocialNetworkSharingLinks()
|
|||||||
* @param int $max Max number of answers
|
* @param int $max Max number of answers
|
||||||
* @param string $sortfield Sort Fields
|
* @param string $sortfield Sort Fields
|
||||||
* @param string $sortorder Sort order ('DESC' or 'ASC')
|
* @param string $sortorder Sort order ('DESC' or 'ASC')
|
||||||
|
* @param string $langcode Language code ('' or 'en', 'fr', 'es', ...)
|
||||||
* @return string HTML content
|
* @return string HTML content
|
||||||
*/
|
*/
|
||||||
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC')
|
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '')
|
||||||
{
|
{
|
||||||
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers.
|
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers.
|
||||||
|
|
||||||
@ -764,6 +765,9 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
|
|||||||
{
|
{
|
||||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'website_page';
|
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'website_page';
|
||||||
$sql .= " WHERE fk_website = ".$website->id;
|
$sql .= " WHERE fk_website = ".$website->id;
|
||||||
|
if ($langcode) {
|
||||||
|
$sql .= " AND lang ='".$db->escape($langcode).'"';
|
||||||
|
}
|
||||||
if ($type) {
|
if ($type) {
|
||||||
$tmparrayoftype = explode(',', $type);
|
$tmparrayoftype = explode(',', $type);
|
||||||
$typestring = '';
|
$typestring = '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user