Add credit to allowed search fields

I would like to add the Credit field as a searchable element. At first I tried passing a custom array to the printSearchForm function, but that did not have any effect.Ex:
`

$query_fields = array("desc","custom_data","tags","credit");

printSearchForm(NULL,'search',NULL,NULL,NULL,$query_fields,NULL,false);

`

Next, I tried adding it directly to the search_fields option in the DB. No luck there either.

Eventually, I was able to get it to work by adding credit to the search_fields option in the DB and also modifying the search engine construct of the core class-search.php file with the following:
`$this->search_structure['credit'] = gettext('Credit');`

So my question is, is there a way to add Credit to the list of fields to search without modifying the core search file?

Zenphoto 1.4.4.8
PHP 5.3.15
MySQL 5.1.47
custom theme based on zp_bootstrap

Comments

  • acrylian Administrator, Developer
    You can enable/disable all fields on Options > Search.
  • Credit does not appear as a choice in the Fields List under Options > Search.

    I see the following: Country, Custom Data, Description, Location/Place, State, Tags, City, Copyright, Date, File/Folder name, Owner, Title
  • What you did is the correct fix. Probably should create an issue so that this gets added to the mainstream. Any other fields you notice missing?
  • That's the only one I am interested in at the moment. I'll add a post to the feature request forum.
Sign In or Register to comment.