mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-09 10:13:00 +02:00
*** empty log message ***
git-svn-id: http://piwigo.org/svn/trunk@19 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -405,6 +405,10 @@ function initialize_category( $calling_page = 'category' )
|
||||
$words = explode( ',', $_GET['search'] );
|
||||
$sql_search = array();
|
||||
foreach ( $words as $i => $word ) {
|
||||
// if the user searchs any of the words, the where statement must
|
||||
// be :
|
||||
// field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' ...
|
||||
// OR field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' ...
|
||||
if ( $_GET['mode'] == 'OR' )
|
||||
{
|
||||
if ( $i != 0 ) $page['where'].= ' OR';
|
||||
@@ -413,6 +417,9 @@ function initialize_category( $calling_page = 'category' )
|
||||
$page['where'].= ' '.$field." LIKE '%".$word."%'";
|
||||
}
|
||||
}
|
||||
// if the user searchs all the words :
|
||||
// ( field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' )
|
||||
// AND ( field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' )
|
||||
else if ( $_GET['mode'] == 'AND' )
|
||||
{
|
||||
if ( $i != 0 ) $page['where'].= ' AND';
|
||||
|
||||
Reference in New Issue
Block a user