Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Wildcat characters on search. Do we have them?  (Read 2401 times)

0 Members and 1 Guest are viewing this topic.

mr5

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Wildcat characters on search. Do we have them?
« on: December 21, 2011, 03:12:51 pm »

Hi, sorry for so basic question, but I didn't find the answer after seraching all docs and forum...
Can we use wild characters * or ? on search? Documentation mentions them only when searching for a user, but not in a general album search. Could it be that wildcat characters are not supported at search???  For example, '?' does not work for "any character".
Thanks
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wildcat characters on search. Do we have them?
« Reply #1 on: December 22, 2011, 11:46:44 am »

Wildcard '?' isn't supported out of the box, but '*' is.

If you want to use '?' as wildcard, open include/search.inc.php, find
Code: [Select]
$search_string = strtr($search_string, array('_' => '\_', '%' => '\%', '*' => '%'));and replace with
Code: [Select]
$search_string = strtr($search_string, array('_' => '\_', '%' => '\%', '*' => '%', '?' => '_'));
Logged

mr5

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: Wildcat characters on search. Do we have them?
« Reply #2 on: December 23, 2011, 02:26:33 pm »

Thanks a lot Andre! The change works OK. I would suggest to make it permanent as it helps a lot, specially when searching on text with special national characters.
I see that '*' includes string with blanks, that is will find a string with blanks inside. This is news to me, but it probably should work this way. You can close this. Thanks.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wildcat characters on search. Do we have them?
« Reply #3 on: December 24, 2011, 11:12:18 am »

Please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.