coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Upload => Topic started by: johnwr on June 17, 2004, 01:28:40 AM

Title: Multiple uploads in reverse order
Post by: johnwr on June 17, 2004, 01:28:40 AM
Hi,

I wonder why the multipic upload inserts the uploaded pictures in reversed order?

Not really a problem, other than on the last uploads view, and easy to workaround (Upload the pics in reversed order).

However I would feel a queue implementation of this rather than a stack is more logical?

regards
John
Title: Re: Multiple uploads in reverse order
Post by: hyperion on June 17, 2004, 01:35:08 AM
Well, I think in stacks, and I like the array_pop function. It was an arbitrary decision, really.

How would this affect the Last Uploads album?  The images are not inserted into the gallery until after the data page, so they are shown in the order uploaded.
Title: Re: Multiple uploads in reverse order
Post by: johnwr on June 17, 2004, 02:04:56 AM
If I upload two pics at the same time, I'm first prompted to comment and place the second one, and then the first one.
(If my memory serves me right).

Then in the "last uploaded" section the first one shows first (which means it is uploaded last), as is natural if you pop from a stack when you present the pics for commenting and placing.

I like using stacks a lot as well, but maybe a queue would be more natural in this case?

I'm not a php programmer, so I don't even know if there is such queue functionality there...

John
Title: Re: Multiple uploads in reverse order
Post by: p.s.b on June 18, 2004, 08:17:26 AM
Hi,

Here is my Solution:

in upload.php

replace
for ($counter = 0; $counter < $file_upload_count; $counter++) {
with
for ($counter = $file_upload_count - 1; $counter >= 0; $counter--) {

and
for ($counter = 0; $counter < $URI_upload_count; $counter++) {
with
for ($counter = $URI_upload_count - 1; $counter >= 0; $counter--) {

Title: Re: Multiple uploads in reverse order
Post by: p.s.b on June 28, 2004, 10:45:37 AM
I found out a better solution:

undo the changes above

in upload.php

search for

   // Count errors in each error array and the escrow array.
   $escrow_array_count = count($escrow_array);
   $file_error_count = count($file_failure_array);
   $URI_error_count = count($URI_failure_array);
   $zip_error_count = count($zip_failure_array);


and paste before:

   // Reverse Array to Show the Uploaded Files in the right Way
   if(is_array($escrow_array)) $escrow_array = array_reverse($escrow_array);


it should work