I would like to add new fields to the metadata section at Albums->Images.
I have read on the forums about a workaround, but no one goes into greater detail.
What I want is to add fields where City, Location, Copyright exist. I understand that the data comes from the image, but I want the user to be able to add their content so that it is searchable.
how can I do that without augmenting the core files?
Comments
The general technique is to store multiple fields in an array with the array index of the field being then name of the field. That array is serialized when stored in the custom data database field and unserialized when you want to use the data. There is a filter `save_image_custom_data` that you would attach to copllect and serialize the data for storage and one `edit_image_custom_data` to format the admin page data input.
The `comment_form` plugin would be a good example of this technique. It saves the user's address, etc in the user object custom data field. The filters here are of course for `admin` not `image` but the mechanism is the same.
Please tell me how I would go about doing that? What pages in your code would I need to change?
I am competent with using PHP and MySQL and I know that queries are going to need to be written, but I want to safeguard that anything I touch won't get wiped out with an upgrade of your product.
I have already successfully created a new theme for my purposes with your product, so this last little bit would be extremely useful to get my last project finished.
http://www.zenphoto.org/news/zenphoto-plugin-architecture#zenphoto-filters
http://www.zenphoto.org/news/zenphotos-object-model-framework
Here is a demp plugin that splits teh custom field into several fields:
https://github.com/zenphoto/Unsupported/tree/master/plugins/filter-custom_data
Instead splitting you need to return it plain and the additional input fields that then are stored in the plugin_ storage table.
Info about all database tables on the admin overview pages. There is also a pdf in your install under /docs that shows the rough interactions between the tables