coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: Garibaldi on April 16, 2009, 12:11:03 AM

Title: [Solved]: Autopopulate Custom Field 1 on Upload?
Post by: Garibaldi on April 16, 2009, 12:11:03 AM
Hello All,

I'm working on a new Coppermine install in which I'd like to be able to upload a jpg or png and have other versions of the same image associated with it. For example I upload picture.jpg and then on the intermediate page for picture.jpg I could choose to download the files picture.psd, picture.tif, etc. The way I was thinking of doing this is just having a zip file that contains all these files.

My question is, is there a way to:
- on normal upload prompt the user when they get to the page to set each individual picture's information to upload the zip file and then populate its URL to the Custom Field 1 input field?
- on batch upload simply check to see if there is a file with the same name as the photo (e.g. picture.zip) in the same directory and to populate the Custom Field 1 input field with that URL?

Maybe there is a better way to do this - please let me know what you think!

Thanks,

Garibaldi
Title: Re: Autopopulate Custom Field 1 on Upload?
Post by: Joachim Müller on April 16, 2009, 08:10:12 AM
Possible if you code it, but no pre-existing solution.
Title: Re: Autopopulate Custom Field 1 on Upload?
Post by: Garibaldi on April 16, 2009, 04:53:37 PM
Sure, I'd be glad to code it but I need a little help getting started. I'd like to add some javascript and a link to the page where you can enter each individual file's information (and select the album to put it in) during a regular upload. Could you help me find where the Custom User Field 1 box is generated in the codebase? Is it in upload.php? Moreover, could you tell me where to look for the batch add files when it sends the queries to the database for the new files in the directory? I could add code at this point to check for the existence of an identically-named file and populate the Custom User Field 1 accordingly at that time.

Thanks
Title: Re: Autopopulate Custom Field 1 on Upload?
Post by: Joachim Müller on April 16, 2009, 10:54:00 PM
If you can't figure out what code to edit then the mod you're trying to accomplish will be beyond your skills I'm afraid. Telling you where the code that needs modification resides at would mean doing half the work. Things are not that simple, you know.
Additionally, we have a strict "one question per thread" policy that you agreed to respect when signing up.
Title: Re: Autopopulate Custom Field 1 on Upload?
Post by: Garibaldi on April 17, 2009, 10:55:56 PM
I've completed the first version of this modification, which I posted in this thread (http://forum.coppermine-gallery.net/index.php/topic,59073.0.html).