[Solved]: Autopopulate Custom Field 1 on Upload? [Solved]: Autopopulate Custom Field 1 on Upload?
 

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

[Solved]: Autopopulate Custom Field 1 on Upload?

Started by Garibaldi, April 16, 2009, 12:11:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Garibaldi

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

Joachim Müller

Possible if you code it, but no pre-existing solution.

Garibaldi

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

Joachim Müller

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.

Garibaldi

I've completed the first version of this modification, which I posted in this thread.