BatchAdd tweak required BatchAdd tweak required
 

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

BatchAdd tweak required

Started by sjj1805, October 04, 2014, 06:35:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sjj1805

Linkto my Albums:
http://stevejjones.co.uk/photo/index.php
I have spent several hours searching through these forums for the answer but alas I need to ask your help!
I know what needs to be done but I just dont know how to do it myself.
I have over 25,000 photographs stored on my hard drive and when I first began I created a directory structure where my photographs would be stored according to the date they were taken.
Under the built in Directory "Albums" in my coppermine installation
C:\inetpub\wwwroot\photo\albums
I then create sub-directoriesfor the year e.g.
C:\inetpub\wwwroot\photo\albums\2010
C:\inetpub\wwwroot\photo\albums\2011
C:\inetpub\wwwroot\photo\albums\2012
C:\inetpub\wwwroot\photo\albums\2013
C:\inetpub\wwwroot\photo\albums\2014

Below the 'year' Comes the month. eg.
C:\inetpub\wwwroot\photo\albums\2014\01Jan
C:\inetpub\wwwroot\photo\albums\2014\02feb
C:\inetpub\wwwroot\photo\albums\2014\02mar

Below this the actual album itself eg.
C:\inetpub\wwwroot\photo\albums\2014\02mar\Med_Cruise
C:\inetpub\wwwroot\photo\albums\2014\02mar\Someones_Party
C:\inetpub\wwwroot\photo\albums\2014\02mar\Stonehenge

The problem I have encountered with "Batch Add" is that If I later add new photographs to an existing album (on the harddrive) the batch add process is marking ALL of the photographs for upload and not just the new ones.

After several tests I discovered that the batch add process works correctly if a folder is under the actual root directory "Albums" and only marks new photographs for upload.
eg.
C:\inetpub\wwwroot\photo\albums\newDirectory

It seems that a tweak to "Searchnew.php" is required - I think probably to the variable $expic_array
But I do not know howto do so.

Any help appreciated. Thank you in advance.


Αndré

Quote from: sjj1805 on October 04, 2014, 06:35:36 PM
After several tests I discovered that the batch add process works correctly if a folder is under the actual root directory "Albums" and only marks new photographs for upload.
eg.
C:\inetpub\wwwroot\photo\albums\newDirectory

Batch-add should only mark new files, regardless of the directory depth. I confirmed the issue on my test bed and try to fix it as soon as possible.

Αndré

Issue occurs on Windows driven systems, because of the directory separator "\" used in the parameter "startdir".

Please open searchnew.php, find
$startdir = $matches[0];
and replace with
$startdir = str_replace('\\', '/', $matches[0]);

sjj1805

Andre, Works perfectly. Thank you for doing this and so quickly.

Αndré

Committed fix in SVN revision 8740. Will be part of cpg1.5.32 and above.