fix query

This commit is contained in:
Jean-Christian Paul 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 2021.08.20
* update license * update license
* fix query
2013.10.28 2013.10.28
* Switch to Dotclear 2.6 * Switch to Dotclear 2.6

View File

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

View File

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