fix query

This commit is contained in:
Jean-Christian Denis 2021-08-21 23:01:37 +02:00
parent 89cce6e0d5
commit 6ff3c0a2d3
3 changed files with 6 additions and 8 deletions

View file

@ -1,5 +1,6 @@
2021.08.20
* update license
* fix query
2013.10.28
* Switch to Dotclear 2.6

View file

@ -24,7 +24,7 @@ $this->registerModule(
/* Author */
"Jean-Christian Denis",
/* Version */
'2021.08.20.1',
'2021.08.20.2',
/* Properies */
array(
'permissions' => 'admin',

View file

@ -144,7 +144,7 @@ class pubSaba
$params = array(
'sql'=>'',
'post_type' => ''
'post_type' => array()
);
# search string
@ -194,6 +194,8 @@ class pubSaba
$options['q_type'][] = $v;
$params['post_type'][] = $v;
}
} else {
$params['post_type'][] = 'post';
}
# age
@ -274,13 +276,8 @@ class pubSaba
}
}
if (!empty($OR)) {
$req = "AND (".implode (' OR ',$OR).") ";
}
# Return
if (!empty($req)) {
$p[0] = '';
$p[2]['sql'] = (isset($p[2]['sql']) ? $p[2]['sql'] : '').$req;
$p[2]['sql'] = (isset($p[2]['sql']) ? $p[2]['sql'] : '') . "AND (" . implode (' OR ', $OR) . ") ";
}
}
}