Hi guys,
I would like to implement a little modification in cpg. Everytime the cpg15x_pictures table is changing (e.g. when uploading a new pictures) I would like to update another table in the same database. The coding shouldn't be the problem. But I need help to find the right places in the php files.
Where do I have to place my table update lines. In the upload.php and update.php? If so, where exactly in those files?
Thanks in advance
Regards
Best way would be to make a plugin using the add_file_data_success (http://documentation.coppermine-gallery.net/en/dev_plugin_hooks.htm#plugin_hooks_filename_add_file_data_success) action. You could also use a database trigger. If you must edit the code directly then it's include/picmgmt.inc.php, add_picture function.
thanks a lot. this leeds me to some further questions
1. is the add_picture function in include/picmgmt.inc.php just executed when adding a file or is it also executed when you change attributes from an existing image?
2. do you have a how-to link where I can see how to make a plugin with the add-file_data_success action?
3. where can I found more infos about the database trigger?
Thanks in advance!
Regards
1. New files only.
2. We don't have tutorials for all possible actions. Plugin docs are at http://documentation.coppermine-gallery.net/en/dev_plugins.htm
3. http://dev.mysql.com/doc/refman/5.1/en/triggers.html
thanks for your quick answer. I read the provided link about the trigger and it sounds fascinating!!! haven't heard that before. I will try that and report my experience after that.. thanks a lot! sounds to be exactly what I was locking for.