update another table when uploading a picture update another table when uploading a picture
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

update another table when uploading a picture

Started by buddy0815, March 19, 2011, 07:02:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

buddy0815

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

Nibbler

Best way would be to make a plugin using the 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.

buddy0815

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


buddy0815

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.