hint for advanced search ?

i am trying to write a small plugin to expand the search possibilities on top of the keyword list like be able to look for black&white pictures only, date of publication (mtime), date photographed, orientation (portrait or landscape or square) and so on.

i see 2 ways of doing this. either i stick to the current search engine and then i test each image for different criteria before displaying it. it may be time consuming if we have a search result with lots of images (or maybe not i have actually no idea). the other way to do this advanced search is to write new functions with extended sql queries that mix the keyword and the rest.

to do that i have been trying to see how the current search goes to get inspired. so far i am lost. all i know is that i set up the form by calling `printSearchForm` then i type in some keywords, hit return and results are there. couldn't find the trail of function calls that leads to that results.

would you mind helping me to better understand what's behind the scenes ?

otherwise i gonna stick to the first idea of using IF statements in large numbers. actually maybe you reckon it is the way to go.

thanks for your help,
frank.

Comments

  • acrylian Administrator, Developer
    The search engine itself is in `zp-core/class-search.php`. Of course there are other place that are involved as well (Dynamic albums etc.)
  • Generally speaking, index.php (the Zenphoto root one) , controller.php, and functions-controller.php are where you look to see how loading a theme page.

    Specifically for a search, the Post is made to your theme search.php script. When that page is loaded, the loading process detects the POST for the search and does a "load_search()" call which will instantiate the search engine.
  • @sbillard, thanks for your explanation. i'll try to better understand how things work and see from there if i can implement an 'advanced search' feature in my theme.
Sign In or Register to comment.