Member
Member
bryanbrazil   2009-12-20, 02:21
#1

I don't use the searchfields icon in my theme. I'd like for all searches to use the searchfields set in the Zenphoto admin.

Currently, searches made on the tag pages default to only searching the "tag" field. I'm assuming I might have to rewrite the allowedSearchFields() function and put it in my functions.php file. Does anyone know how I can modify this function to always return the searchfields set in the Zenphoto admin?

function allowedSearchFields() { $setlist = array(); $fields = getOption('search_fields'); if (is_numeric($fields)) { $setlist = $this->numericFields($fields); } else { $list = explode(',',$fields); foreach ($this->search_structure as $key=>$display) { if (in_array($key,$list)) { $setlist[$key] = $display; } } } return $setlist; }
This post is related to my initial report on trac: http://www.zenphoto.org/trac/ticket/1339

Member
Member
sbillard   2009-12-20, 03:00
#2

And as well, anyone can read the response to that ticket. But bottom line is that you can set the search fields to whatever default you want by just passing the appropriate parameter printSearchForm function. But then, of course, you would have to read the function definition to know that.

Member
Member
bryanbrazil   2009-12-20, 03:11
#3

Ah, never noticed the query_fields option for printSearchForm. Thanks!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.