Multiple uploads in reverse order Multiple uploads in reverse order
 

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

Multiple uploads in reverse order

Started by johnwr, June 17, 2004, 01:28:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

johnwr

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

hyperion

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.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

johnwr

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

p.s.b

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--) {


p.s.b

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