Changeset 710 for trunk/include/functions_category.inc.php
- Timestamp:
- Jan 20, 2005, 12:52:59 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r707 r710 426 426 $clauses = array(); 427 427 428 // Author Search 429 if (isset($search['fields']['author'])) 428 $textfields = array('file', 'name', 'comment', 'keywords', 'author'); 429 foreach ($textfields as $textfield) 430 { 431 if (isset($search['fields'][$textfield])) 430 432 { 431 433 $local_clauses = array(); 432 foreach ($search['fields'][ 'author']['words'] as $word)434 foreach ($search['fields'][$textfield]['words'] as $word) 433 435 { 434 array_push($local_clauses, "authorLIKE '%".$word."%'");436 array_push($local_clauses, $textfield." LIKE '%".$word."%'"); 435 437 } 436 438 // adds brackets around where clauses 437 439 array_walk($local_clauses,create_function('&$s','$s="(".$s.")";')); 438 440 array_push($clauses, 439 implode(' '.$search['fields'][ 'author']['mode'].' ',441 implode(' '.$search['fields'][$textfield]['mode'].' ', 440 442 $local_clauses)); 441 443 } 442 443 // All words search (author included) 444 } 445 444 446 if (isset($search['fields']['allwords'])) 445 447 { 446 $textfields = array('file', 'name', 'comment', 'keywords', 'author');448 $fields = array('file', 'name', 'comment', 'keywords', 'author'); 447 449 // in the OR mode, request bust be : 448 450 // ((field1 LIKE '%word1%' OR field2 LIKE '%word1%') … … 456 458 { 457 459 $field_clauses = array(); 458 foreach ($ textfields as $field)460 foreach ($fields as $field) 459 461 { 460 462 array_push($field_clauses, $field." LIKE '%".$word."%'");
Note: See TracChangeset
for help on using the changeset viewer.