forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: bigun on April 13, 2007, 01:41:52 pm

Title: Posting Moved Pictures
Post by: bigun on April 13, 2007, 01:41:52 pm
On my server I have setup a script to move pictures into a certain directory on a daily basis.

Does Coppermine have the ability to "post" new files just by having them moved into a certain directory and make thumbnails for them on the fly?
Title: Re: Posting Moved Pictures
Post by: Joachim Müller on April 13, 2007, 02:48:19 pm
Coppermine doesn't have a feature that adds pics to the database just based on the fact that they exist within a particular folder. You'd need to set up a cron job on your server that triggers a script (that you would have to come up with based on searchnew.php) that looks up your "special" folder and automatically adds the files to the database.
Title: Re: Posting Moved Pictures
Post by: bigun on April 13, 2007, 03:00:35 pm
Yeah, I was afraid of that.

I somewhat versed in PHP and Perl.. but I don't feel confident enough in my skills to read the code coppermine has and re-write the same function in some command-line type script, I would assume Perl could handle it.

Meh, I'll try anyway, couldn't hurt.  If I do manage to get this script to work, anyway you guys could use it?
Title: Re: Posting Moved Pictures
Post by: Joachim Müller on April 13, 2007, 03:13:07 pm
You'll "just" have to modify searchnew.php, skipping the first step where the folder is being determined (instead: hard-code a particular folder to be used). In the second step, just modify the script to automatically add the files that are ticked (i.e. new) without user interaction. No fiddling with the command line needed, nor the use of Perl.
I guess others might be interessted in your script as well, so yes: please post your code once you have come up with it.