ZenphotoCMS Forum
Add credit to allowed search fields - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Add credit to allowed search fields (/thread-11199.html)



Add credit to allowed search fields - SierraBravoFour - 2013-07-17

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




Add credit to allowed search fields - acrylian - 2013-07-17

You can enable/disable all fields on Options > Search.




Add credit to allowed search fields - SierraBravoFour - 2013-07-17

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




Add credit to allowed search fields - sbillard - 2013-07-17

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?




Add credit to allowed search fields - SierraBravoFour - 2013-07-18

That's the only one I am interested in at the moment. I'll add a post to the feature request forum.