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