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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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.